1. 25 4月, 2008 2 次提交
  2. 19 10月, 2007 1 次提交
  3. 13 10月, 2007 1 次提交
  4. 13 9月, 2007 1 次提交
  5. 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
  6. 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
  7. 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
  8. 05 3月, 2007 1 次提交
  9. 08 2月, 2007 1 次提交
  10. 08 12月, 2006 1 次提交
  11. 02 12月, 2006 1 次提交
  12. 28 9月, 2006 1 次提交
  13. 03 8月, 2006 1 次提交
  14. 13 7月, 2006 2 次提交
  15. 01 7月, 2006 1 次提交
  16. 22 6月, 2006 2 次提交
  17. 21 3月, 2006 1 次提交
  18. 05 1月, 2006 6 次提交
  19. 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
  20. 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
  21. 09 9月, 2005 3 次提交
  22. 26 6月, 2005 1 次提交
    • C
      [PATCH] Cleanup patch for process freezing · 3e1d1d28
      Christoph Lameter 提交于
      1. Establish a simple API for process freezing defined in linux/include/sched.h:
      
         frozen(process)		Check for frozen process
         freezing(process)		Check if a process is being frozen
         freeze(process)		Tell a process to freeze (go to refrigerator)
         thaw_process(process)	Restart process
         frozen_process(process)	Process is frozen now
      
      2. Remove all references to PF_FREEZE and PF_FROZEN from all
         kernel sources except sched.h
      
      3. Fix numerous locations where try_to_freeze is manually done by a driver
      
      4. Remove the argument that is no longer necessary from two function calls.
      
      5. Some whitespace cleanup
      
      6. Clear potential race in refrigerator (provides an open window of PF_FREEZE
         cleared before setting PF_FROZEN, recalc_sigpending does not check
         PF_FROZEN).
      
      This patch does not address the problem of freeze_processes() violating the rule
      that a task may only modify its own flags by setting PF_FREEZE. This is not clean
      in an SMP environment. freeze(process) is therefore not SMP safe!
      Signed-off-by: NChristoph Lameter <christoph@lameter.com>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3e1d1d28