1. 17 Jun, 2004 6 commits
  2. 14 Jun, 2004 4 commits
    • Alan Stern's avatar
      [PATCH] USB: Remove private khubd semaphore · 02cd8571
      Alan Stern authored
      This patch removes the private semaphore used by the hub driver, and uses
      the regular "serialize" semaphore instead.  This will satisfy the general
      locking requirements for adding and removing devices attached to the hub.
      The only tricky aspect is that now the hub event handler must take a
      reference to the hub device while waiting to acquire the semaphore, in
      case the hub is disconnected during the wait.
      
      The patch also replaces a few occurrences of spin_lock_irqsave() in
      regions where interrupts are known to be enabled with spin_lock_irq().
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      02cd8571
    • Alan Stern's avatar
      [PATCH] USB: Fix bug in TT initialization introduced by earlier · bc1e4d14
      Alan Stern authored
      This patch repairs a bug introduced by an earlier patch: The TT
      initialization code was moved to _after_ the TT's first use.  The patch
      simply puts the code back the way it used to be.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      bc1e4d14
    • Matthew Dharm's avatar
      [PATCH] USB Storage: Fix race when removing the SCSI host · bd7ae0db
      Matthew Dharm authored
      This patch fixes a race is disconnecting a usb-storage device that occurs
      with the SCSI layer.  It's primarily reproducable via adding delays into
      various disconnect and reset processing paths, but has also been
      encountered in the field.
      
      This patch started life as as281b, and was modified by me only to patch
      properly against current kernels.
      
      The main features of the patch are:
      
      	Store the host pointer at the start of the control thread
      	rather than trying to get it from srb->device; after the host
      	is removed the SCSI device structure may no longer exist.
      
      	Keep dev_semaphore locked during the entire time the control
      	thread or reset handlers are using the us_data structure.
      
      	Reorder the items in dissociate_dev() and release_resources()
      	so that things are released in the opposite order from the way
      	they were acquired originally.  Don't bother to increment and
      	decrement the usb_device's reference count; it's unnecessary.
      
      	In disconnect(), first set the DISCONNECTING flag so that no
      	more I/O will take place and no more requests will be accepted.
      	Next, cut short the current command and wait for it to finish.
      	Then call scsi_remove_host().  The SCSI core guarantees that
      	when scsi_remove_host() returns, the host will not be in error
      	recovery and all outstanding commands will have been cancelled.
      
      	Remove some old useless left-over code that was #if'ed out.
      
      	Use a wait_queue for the 6-second delay during device resets
      	so that we can be woken up in the middle if a disconnect occurs.
      
      The key point here is that after scsi_remove_host(), everything is idle as
      far as the SCSI midlayer is concerned.  But if there was a command in
      progress at the time, the midlayer will abort it without telling us or
      waiting for it to complete.  Hence we have to wait for the control thread
      to be idle before we can try to kill it.  This should happen quickly,
      since all I/O attempted by the thread will fail immediately.
      Signed-off-by: default avatarMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      bd7ae0db
    • Matthew Dharm's avatar
      [PATCH] USB Storage: INQUIRY fixup, mode-sense options, Genesys devices · 47f1558e
      Matthew Dharm authored
      This patch does a few things (all in the same section of code).  It started
      life as patches as226b, as280, and as275.  Later it was merged into as226e
      and I added significantly to it.
      
      
      First, this patch introduces a new config option to allow people to enable
      write-protect detection for their USB devices.  With some luck, we've
      finally got it right and can eventually remove this option in favor of
      enabling this behavior all the time.
      
      Next, we change how we force some flags on -- it turns out that there are
      some 'generic' entries in the SCSI devinfo which was overriding us when we
      didn't want it.
      
      Finally, we add a safety check to the workaround for GeneSys Logic devices
      -- if the max_sectors parameter has already been turned down, we won't turn
      it up.
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      47f1558e
  3. 11 Jun, 2004 6 commits
  4. 10 Jun, 2004 3 commits
  5. 09 Jun, 2004 5 commits
    • Greg Kroah-Hartman's avatar
      USB: crap, I misapplied a patch with the wrong level · b4a8f23b
      Greg Kroah-Hartman authored
      This gets rid of usb/host and puts the file in the proper drivers/usb/host
      directory.
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      b4a8f23b
    • Alan Stern's avatar
      [PATCH] USB: Update root-hub code for the ohci-lh7a404 driver · 12161d56
      Alan Stern authored
      On Wed, 9 Jun 2004, David Brownell wrote:
      
      > Needs an update for ohci-lh7a404.c too ...
      
      I didn't even know this driver existed!  Where did usb/host/* come from?
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      12161d56
    • Alan Stern's avatar
      [PATCH] USB: Minor tidying up of hub driver · 72ab0f27
      Alan Stern authored
      After my last few changesets there were a few small items that needed to
      be tidied up.
      
      	Update kerneldoc to reflect the actual operation of
      	usb_disconnect() and usb_new_device().  The new locking
      	requirements are listed too, though they aren't all
      	implemented yet.
      
      	Fulfill the new locking requirement in hcd_panic().
      
      	Remove unneeded local variables to conserve stack space in
      	usb_disconnect(), which calls itself recursively.
      
      	In hub_port_connect_change(), store the parent's children[]
      	pointer as late as possible and don't lock the new device until
      	then (that's when it becomes globally accessible).  This will
      	minimize the time that the not-fully-configured device structure
      	is visible to other parts of the kernel.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      72ab0f27
    • Alan Stern's avatar
      [PATCH] USB: Fix bus-list root-hub race · f1eb6dba
      Alan Stern authored
      There are a few places where the code enumerates through all the USB
      devices on all the buses, starting with each bus's root hub and working
      down.  However a bus does not always have a root hub, and the code does
      not check that the root_hub pointer is non-NULL.  This patch fixes the
      problem, using the usb_bus_list_lock semaphore to synchronize access when
      root hubs are added or removed.
      
      In addition it seemed like a good idea to minimize the time that a
      non-fully-configured root hub is accessible through the bus's pointer.  So
      this patch delays setting the pointer and holds usb_bus_list_lock while
      configuring a root hub.
      
      It turned out that a bunch of things needed to be changed for all this to
      work:
      
      	Check for NULL root_hub pointer in usb_device_read() and
      	usb_find_device().
      
      	Pass the root-hub device as a separate argument to
      	hcd_register_root().
      
      	Make usb_register_root_hub() acquire the usb_bus_list_lock and
      	set the bus->root_hub pointer.
      
      	For consistency's sake, move the place where the children[]
      	pointer to a non-root-hub device gets stored as close as possible
      	to where usb_new_device() is called.
      
      	Make usb_disconnect() acquire the usb_bus_list_lock when removing
      	a root hub.
      
      	Change usb_hcd_pci_remove() and the non-PCI host drivers so that
      	they call usb_disconnect() with a pointer to the bus's root_hub
      	pointer, not a pointer to a temporary variable.
      
      	Change all the host controller drivers not to store the root_hub
      	pointer in the bus structure but instead to pass it as a new
      	argument to hcd_register_root().
      
      I made some attempt to update the hc_sl811 driver along with the rest, but
      it's pretty clear that driver won't work in the current framework.  Among
      other things, it never reads the root hub's device descriptor.  To what
      extent is the driver really supported?
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      f1eb6dba
    • Oliver Neukum's avatar
      [PATCH] USB: add printer reset ioctl · 18e63cd5
      Oliver Neukum authored
        - add soft reset ioctl
      Signed-off-by: default avatarOliver Neukum <oliver@neukum.name>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      18e63cd5
  6. 08 Jun, 2004 16 commits