1. 22 7月, 2008 1 次提交
    • A
      usb-storage: separate dynamic flags from fixed flags · 7e4d6c38
      Alan Stern 提交于
      This patch (as1089) separates out the dynamic atomic bitflags and the
      static bitfields in usb-storage.  Until now the two sorts of flags
      have been sharing the same word; this has always been awkward.
      
      To help prevent possible confusion, the two new fields each have a
      different name from the original.  us->fflags contains the fixed
      bitfields (mostly taken from the USB ID table in unusual_devs.h), and
      us->dflags contains the dynamic atomic bitflags (used with set_bit,
      test_bit, and so on).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7e4d6c38
  2. 03 5月, 2008 1 次提交
  3. 25 4月, 2008 2 次提交
  4. 19 10月, 2007 1 次提交
  5. 13 10月, 2007 1 次提交
  6. 13 9月, 2007 1 次提交
  7. 23 8月, 2007 1 次提交
    • A
      usb-storage: fix bugs in the disconnect pathway · 2f67cd5b
      Alan Stern 提交于
      This patch (as961) fixes a couple of bugs in the disconnect pathway of
      usb-storage.
      
      The first problem, which apparently has been around for a while
      although nobody noticed it, shows up when an aborted command is still
      pending when a disconnect occurs.  The SCSI error-handler will
      continue to wait in command_abort() until the us->notify completion is
      signalled.  Thus quiesce_and_remove_host() needs to signal it.
      
      The second problem was introduced recently along with autosuspend
      support.  Since usb_stor_scan_thread() now calls
      usb_autopm_put_interface() before exiting, we can't simply leave the
      scanning thread running after a disconnect; we must wait until the
      thread exits.  This is solved by adding a new struct completion to the
      private data structure.  Fortuitously, it allows the removal of the
      rather clunky mechanism used in the past to insure that all threads
      have finished before the module is unloaded.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2f67cd5b
  8. 18 7月, 2007 1 次提交
    • R
      Freezer: make kernel threads nonfreezable by default · 83144186
      Rafael J. Wysocki 提交于
      Currently, the freezer treats all tasks as freezable, except for the kernel
      threads that explicitly set the PF_NOFREEZE flag for themselves.  This
      approach is problematic, since it requires every kernel thread to either
      set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
      care for the freezing of tasks at all.
      
      It seems better to only require the kernel threads that want to or need to
      be frozen to use some freezer-related code and to remove any
      freezer-related code from the other (nonfreezable) kernel threads, which is
      done in this patch.
      
      The patch causes all kernel threads to be nonfreezable by default (ie.  to
      have PF_NOFREEZE set by default) and introduces the set_freezable()
      function that should be called by the freezable kernel threads in order to
      unset PF_NOFREEZE.  It also makes all of the currently freezable kernel
      threads call set_freezable(), so it shouldn't cause any (intentional)
      change of behaviour to appear.  Additionally, it updates documentation to
      describe the freezing of tasks more accurately.
      
      [akpm@linux-foundation.org: build fixes]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NNigel Cunningham <nigel@nigel.suspend2.net>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      83144186
  9. 13 7月, 2007 5 次提交
    • A
      usb-storage: implement autosuspend · 8dfe4b14
      Alan Stern 提交于
      This patch (as930) implements autosuspend for usb-storage.  It is
      adapted from a patch by Oliver Neukum.  Autosuspend is allowed except
      during LUN scanning, resets, and command execution.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8dfe4b14
    • A
      USB: usb-storage: use kthread_stop() for the control thread · ed76cacb
      Alan Stern 提交于
      This patch (as923) makes usb-storage's control thread use
      kthread_should_stop()/kthread_stop().  The scanning thread can't be
      similarly converted until the core kthread implementation allows
      threads to call do_exit().
      
      The advantage of this change is that we can now be certain the control
      thread has terminated before storage_disconnect() returns.  This will
      simplify the locking requirements when autosuspend support is added.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ed76cacb
    • A
      USB: add reset_resume method · f07600cf
      Alan Stern 提交于
      This patch (as918) introduces a new USB driver method: reset_resume.
      It is called when a device needs to be reset as part of a resume
      procedure (whether because of a device quirk or because of the
      USB-Persist facility), thereby taking over a role formerly assigned to
      the post_reset method.  As a consequence, post_reset no longer needs
      an argument indicating whether it is being called as part of a
      reset-resume.  This separation of functions makes the code clearer.
      
      In addition, the pre_reset and post_reset method return types are
      changed; they now must return an error code.  The return value is
      unused at present, but at some later time we may unbind drivers and
      re-probe if they encounter an error during reset handling.
      
      The existing pre_reset and post_reset methods in the usbhid,
      usb-storage, and hub drivers are updated to match the new
      requirements.  For usbhid the post_reset routine is also used for
      reset_resume (duplicate method pointers); for the other drivers a new
      reset_resume routine is added.  The change to hub.c looks bigger than
      it really is, because mark_children_for_reset_resume() gets moved down
      next to the new hub_reset_resume() routine.
      
      A minor change to usb-storage makes the usb_stor_report_bus_reset()
      routine acquire the host lock instead of requiring the caller to hold
      it already.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      f07600cf
    • A
      USB: add USB-Persist facility · 0458d5b4
      Alan Stern 提交于
      This patch (as886) adds the controversial USB-persist facility,
      allowing USB devices to persist across a power loss during system
      suspend.
      
      The facility is controlled by a new Kconfig option (with appropriate
      warnings about the potential dangers); when the option is off the
      behavior will remain the same as it is now.  But when the option is
      on, people will be able to use suspend-to-disk and keep their USB
      filesystems intact -- something particularly valuable for small
      machines where the root filesystem is on a USB device!
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0458d5b4
    • A
      USB: remove references to dev.power.power_state · f3fd77cd
      Alan Stern 提交于
      This revised patch (as891b) removes two unnecessary references to
      intf->dev.power.power_state from usb-storage, and replaces a reference
      to root_hub->dev.power.power_state with a check of hcd->state.  This
      is in preparation for the removal of dev.power.power_state, which is
      already deprecated.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f3fd77cd
  10. 05 3月, 2007 1 次提交
  11. 08 2月, 2007 1 次提交
  12. 08 12月, 2006 1 次提交
  13. 02 12月, 2006 1 次提交
  14. 28 9月, 2006 1 次提交
  15. 03 8月, 2006 1 次提交
  16. 13 7月, 2006 2 次提交
  17. 01 7月, 2006 1 次提交
  18. 22 6月, 2006 2 次提交
  19. 21 3月, 2006 1 次提交
  20. 05 1月, 2006 6 次提交
  21. 29 10月, 2005 5 次提交
    • A
      [PATCH] PATCH: usb-storage: use kthread API · 3f13e66e
      Alan Stern 提交于
      This patch is originally from Alan Stern (as569).  It has been rediffed
      against a current tree.
      
      This patch converts usb-storage to use the kthread API for creating its
      control and scanning threads.  The new code doesn't use kthread_stop
      because the threads need (or will need in the future) to exit
      asynchronously.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3f13e66e
    • A
      [PATCH] PATCH: usb-storage: implement minimal PM · ce2596df
      Alan Stern 提交于
      This patch from Alan Stern started as as568.  It has been rediffed against
      a current tree.
      
      This patch adds minimal suspend/resume support to usb-storage.  Just enough
      for it to qualify as PM-aware.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ce2596df
    • A
      [PATCH] PATCH: usb-storage: allocate separate sense buffer · bbafa466
      Alan Stern 提交于
      This patch is from Alan Stern (as560).  It has been rediffed against a
      current tree.
      
      This patch allocates a separate buffer for usb-storage to use when
      auto-sensing.  Up to now we have been using the sense buffer embedded in a
      scsi_cmnd struct, which is dangerous on hosts that (a) don't do
      cache-coherent DMA or (b) have DMA alignment restrictions.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bbafa466
    • A
      [PATCH] PATCH: usb-storage: move GetMaxLUN later in time · b876aef7
      Alan Stern 提交于
      This patch is originally from Alan Stern (as557).  It has been re-diffed
      against a current tree, and I also corrected a minor merging error.
      
      Some time ago we introduced a delay before device scanning, because many
      devices do not like to receive SCSI commands right after enumeration.
      Now it turns out there's a device that doesn't like to receive
      Get-Max-LUN right after enumeration either.  Accordingly this patch
      delays the Get-Max-LUN request until the beginning of the scanning
      procedure.  This fixes Bugzilla entry #5010.
      
      Three things are worth noting.  First, I removed the locking code from
      usb_stor_acquire_resources.  It's not needed, because the locking is to
      protect against disconnect events and acquire_resources is only called
      during probe (so the disconnect routine can't be called).  Second, I
      initialized to 0 the buffer used for the Get-Max-LUN response.  It's not
      really necessary, but it will prevent random values from showing up in
      the debugging log when the request fails.  Third, I added a test against
      the SINGLE_LUN flag.  This will allow us to use the flag to indicate
      Bulk-only devices that can't handle Get-Max-LUN.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b876aef7
    • D
      [PATCH] usb-storage: Some minor shuttle_usbat cleanups · b7b1e655
      Daniel Drake 提交于
      A while ago, Matthew Dharm wrote:
      > Looks good.  Tho, I would like to see a future patch to do two things:
      > 	1) Change comments from C++ style to C-style
      > 	2) Make sure we're naming consistently everywhere SCM, USBAT,
      > 	USBAT-02 (most noticably needing fixing is the string used at
      > 	transport-selection time, but a sweep of all uses to be consistent
      > 	would be in order).
      
      Sorry for the long delay, here is a patch to address this. I also clarified
      some ATA/ATAPI wording + function names.
      Signed-off-by: NDaniel Drake <dsd@gentoo.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/usb/storage/shuttle_usbat.c |  306 ++++++++++++++++++++----------------
       drivers/usb/storage/shuttle_usbat.h |   66 +++----
       drivers/usb/storage/transport.h     |    2
       drivers/usb/storage/unusual_devs.h  |   10 -
       drivers/usb/storage/usb.c           |    4
       5 files changed, 213 insertions(+), 175 deletions(-)
      b7b1e655
  22. 13 9月, 2005 1 次提交
    • M
      [PATCH] USB: storage: Fix messed-up locking · 226173ed
      Matthew Dharm 提交于
      This is patch as550 from Alan Stern.
      
      Apparently someone changed the SCSI core so that it no longer holds the
      host lock when doing a device or bus reset.  usb-storage was updated at
      the time, but the change was done carelessly.  Some of the code depends
      on that lock being held.
      
      This patch reintroduces the host lock where needed and tries to clarify
      the comments explaining why the lock is necessary.  It also moves the
      code that clears the TIMED_OUT and ABORTING bitflags so that it executes
      as soon as the timed-out command has completed (and while the host lock
      is held).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      226173ed
  23. 09 9月, 2005 2 次提交