An error occurred fetching the project authors.
  1. 22 Aug, 2011 1 commit
    • Seth Forshee's avatar
      usb_storage: Don't freeze in usb-stor-scan · f02fe890
      Seth Forshee authored
      Scanning cannot be run during suspend or hibernation, but if
      usb-stor-scan freezes another thread waiting on scanning to
      complete may fail to freeze.
      
      However, if usb-stor-scan is left freezable without ever actually
      freezing then the freezer will wait on it to exit, and threads
      waiting for scanning to finish will no longer be blocked. One
      problem with this approach is that usb-stor-scan has a delay to
      wait for devices to settle (which is currently the only point where
      it can freeze). To work around this we can request that the freezer
      send a fake signal when freezing, then use interruptible sleep to
      wake the thread early when freezing happens.
      
      To make this happen, the following changes are made to
      usb-stor-scan:
      
       * Use set_freezable_with_signal() instead of set_freezable() to
         request a fake signal when freezing
      
       * Use wait_event_interruptible_timeout() instead of
         wait_event_freezable_timeout() to avoid freezing
      Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f02fe890
  2. 07 Jun, 2011 1 commit
    • Alan Stern's avatar
      usb-storage: redo incorrect reads · 21c13a4f
      Alan Stern authored
      Some USB mass-storage devices have bugs that cause them not to handle
      the first READ(10) command they receive correctly.  The Corsair
      Padlock v2 returns completely bogus data for its first read (possibly
      it returns the data in encrypted form even though the device is
      supposed to be unlocked).  The Feiya SD/SDHC card reader fails to
      complete the first READ(10) command after it is plugged in or after a
      new card is inserted, returning a status code that indicates it thinks
      the command was invalid, which prevents the kernel from retrying the
      read.
      
      Since the first read of a new device or a new medium is for the
      partition sector, the kernel is unable to retrieve the device's
      partition table.  Users have to manually issue an "hdparm -z" or
      "blockdev --rereadpt" command before they can access the device.
      
      This patch (as1470) works around the problem.  It adds a new quirk
      flag, US_FL_INVALID_READ10, indicating that the first READ(10) should
      always be retried immediately, as should any failing READ(10) commands
      (provided the preceding READ(10) command succeeded, to avoid getting
      stuck in a loop).  The patch also adds appropriate unusual_devs
      entries containing the new flag.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Tested-by: default avatarSven Geggus <sven-usbst@geggus.net>
      Tested-by: default avatarPaul Hartman <paul.hartman+linux@gmail.com>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      CC: <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      21c13a4f
  3. 19 May, 2011 1 commit
  4. 22 Oct, 2010 1 commit
  5. 10 Aug, 2010 1 commit
    • Alan Stern's avatar
      USB: usb-storage: implement autosuspend · f283925f
      Alan Stern authored
      This patch (as1400) adds runtime-PM support to usb-storage.  It
      utilizes the SCSI layer's runtime-PM implementation, so its scope is
      limited.  Currently the only effect is that disk-like devices (such as
      card readers or flash drives) will be autosuspended if they aren't
      mounted and their device files aren't open.  This would apply, for
      example, to card readers that don't contain a memory card.
      
      Unfortunately this won't interact very well with the removable-media
      polling normally carried out by hal or DeviceKit.  Maybe those
      programs can be changed to use a longer polling interval, or maybe the
      default autosuspend time for usb-storage should be set to something
      below 1 second.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: James Bottomley <James.Bottomley@suse.de>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f283925f
  6. 20 May, 2010 4 commits
    • Felipe Contreras's avatar
      usb-storage: always print quirks · 39f2f080
      Felipe Contreras authored
      Right now quirks are printed only when the are manually overriden with
      the module parameters. It's not so useful to remind the user that his
      parameters are correctly applied; what is useful is to print out the
      quirks the user is not aware are being applied.
      
      So let's do the smart thing and print the quirks when they are present.
      Signed-off-by: default avatarFelipe Contreras <felipe.contreras@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      39f2f080
    • Felipe Contreras's avatar
      USB: usb-storage: trivial debug improvements · cbd3af54
      Felipe Contreras authored
      Use pr_foo and dev_foo instead of printk. Maybe US_DEBUG* should be
      replaced too.
      Signed-off-by: default avatarFelipe Contreras <felipe.contreras@gmail.com>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      cbd3af54
    • Daniel Mack's avatar
      USB: rename usb_buffer_alloc() and usb_buffer_free() users · 997ea58e
      Daniel Mack authored
      For more clearance what the functions actually do,
      
        usb_buffer_alloc() is renamed to usb_alloc_coherent()
        usb_buffer_free()  is renamed to usb_free_coherent()
      
      They should only be used in code which really needs DMA coherency.
      
      All call sites have been changed accordingly, except for staging
      drivers.
      Signed-off-by: default avatarDaniel Mack <daniel@caiaq.de>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Pedro Ribeiro <pedrib@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      997ea58e
    • Alan Stern's avatar
      USB: remove uses of URB_NO_SETUP_DMA_MAP · 0ede76fc
      Alan Stern authored
      This patch (as1350) removes all usages of coherent buffers for USB
      control-request setup-packet buffers.  There's no good reason to
      reserve coherent memory for these things; control requests are hardly
      ever used in large quantity (the major exception is firmware
      transfers, and they aren't time-critical).  Furthermore, only seven
      drivers used it.  We might as well always use streaming DMA mappings
      for setup-packet buffers, and remove some extra complexity from
      usbcore.
      
      The DMA-mapping portion of hcd.c is currently in flux.  A separate
      patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP
      after everything else settles down.  The removal should go smoothly,
      as by then nobody will be using it.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0ede76fc
  7. 26 Feb, 2010 1 commit
    • Linus Torvalds's avatar
      Lower USB storage settling delay to something more reasonable · a4a47bc0
      Linus Torvalds authored
      The five-second delay can be rather annoying, and makes the system
      appear much less responsive when you connect a USB drive.
      
      It's also not entirely clear that it is needed - the settling delay has
      at least historically been an issue on some Apple iPods, for example,
      and some devices have been reported to need even more than the old 5s
      delay.
      
      But before we penalize them all, let's see how bad it really is.  Some
      of the reasons for long delays seem to be actual historical kernel bugs
      that should probably never have been papered over with a delay in the
      first place (there's a Ubuntu bug report for 2.6.20 about a NULL pointer
      dereference unless 'delay_use' is 8 or more, for example).
      
      It also looks like some distros have already shipped with delay_use=0,
      so the five second default may well be totally historical.
      
      In other words: "Let's see if anybody screams".
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a4a47bc0
  8. 20 Jan, 2010 1 commit
  9. 11 Dec, 2009 5 commits
  10. 24 Mar, 2009 13 commits
  11. 07 Jan, 2009 8 commits
    • Alan Stern's avatar
      USB: storage: make the "quirks=" module parameter writable · c838ea46
      Alan Stern authored
      This patch (as1190) makes usb-storage's "quirks=" module parameter
      writable, so that users can add entries for their devices at runtime
      with no need to reboot or reload usb-storage.
      
      New codes are added for the SANE_SENSE, CAPACITY_HEURISTICS, and
      CAPACITY_OK flags.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c838ea46
    • Alan Stern's avatar
      USB: storage: add last-sector hacks · 25ff1c31
      Alan Stern authored
      This patch (as1189b) adds some hacks to usb-storage for dealing with
      the growing problems involving bad capacity values and last-sector
      accesses:
      
      	A new flag, US_FL_CAPACITY_OK, is created to indicate that
      	the device is known to report its capacity correctly.  An
      	unusual_devs entry for Linux's own File-backed Storage Gadget
      	is added with this flag set, since g_file_storage always
      	reports the correct capacity and since the capacity need
      	not be even (it is determined by the size of the backing
      	file).
      
      	An entry in unusual_devs.h which has only the CAPACITY_OK
      	flag set shouldn't prejudice libusual, since the device will
      	work perfectly well with either usb-storage or ub.  So a
      	new macro, COMPLIANT_DEV, is added to let libusual know
      	about these entries.
      
      	When a last-sector access succeeds and the total number of
      	sectors is odd (the unexpected case, in which guessing that
      	the number is even might cause trouble), a WARN is triggered.
      	The kerneloops.org project will collect these warnings,
      	allowing us to add CAPACITY_OK flags for the devices in
      	question before implementing the default-to-even heuristic.
      	If users want to prevent the stack dump produced by the WARN,
      	they can disable the hack by adding an unusual_devs entry
      	for their device with the CAPACITY_OK flag.
      
      	When a last-sector access fails three times in a row and
      	neither the FIX_CAPACITY nor the CAPACITY_OK flag is set,
      	we assume the last-sector bug is present.  We replace the
      	existing status and sense data with values that will cause
      	the SCSI core to fail the access immediately rather than
      	retry indefinitely.  This should fix the difficulties
      	people have been having with Nokia phones.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      25ff1c31
    • Dan Williams's avatar
      USB: unusual dev for Option N.V. ZeroCD modems · 281b064f
      Dan Williams authored
      Many newer Option mobile broadband devices initially provide a
      usb-storage "driver CD" device that's pretty useless on Linux since
      any software on it most likely wouldn't be compatible with your
      kernel or distro anyway.  Thus, by default just kill the driver
      CD device by sending the SCSI 'rezero' command, but allow override
      of the default behavior via usb-storage module parameter so users
      can keep the ZeroCD device if they really want to.  Inspired by
      the Sierra TruInstall patch.
      Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
      Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Cc: Peter Henn <p.henn@option.com
      Cc: Denis Joseph Barrow <D.Barow@option.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      281b064f
    • Alan Stern's avatar
      USB: usb-storage: merge DPCM support into SDDR09 · c20b15fd
      Alan Stern authored
      The DPCM subdriver is a little peculiar, in that it's meant to support
      devices where LUN 0 is Compact Flash and uses the CB transport whereas
      LUN 1 is SmartMedia and uses the SDDR09 transport.  Thus DPCM isn't
      really a transport in itself; it's more like a demultiplexer.
      
      Much of the DPCM code is part of the SDDR09 subdriver already, and the
      remaining part is fairly small.  This patch (as1182) moves that extra
      piece into sddr09.c, thereby eliminating dpcm.c.  Also eliminated is
      the Kconfig entry for DPCM support; it is now listed as part of the
      SDDR09 entry.
      
      In order to make sure that the semantics are the same as before, each
      unusual_devs entry for DPCM is now present twice: once with DPCM
      support if SDDR09 is configured (as before), and once with the
      SINGLE_LUN flag and CB support otherwise.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c20b15fd
    • Alan Stern's avatar
      USB: usb-storage: merge ATAPI and QIC-157 protocol routines · 3dae5345
      Alan Stern authored
      This patch (as1174) merges usb-storage's QIC-157 and ATAPI protocol
      routines.  Since the two functions are identical, there's no reason to
      keep them separate.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3dae5345
    • Alan Stern's avatar
      USB: usb-storage: merge CB and CBI transport routines · 64648a9d
      Alan Stern authored
      This patch (as1173) merges usb-storage's CB and CBI transports into a
      single routine.  So much of their code is common, it's silly to keep
      them separate.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      64648a9d
    • Alan Stern's avatar
      USB: usb-storage: remove us->sensebuf · a658367d
      Alan Stern authored
      This patch (as1171) removes us->sensebuf, since it isn't used anywhere.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      a658367d
    • Alan Stern's avatar
      USB: usb-storage: add "quirks=" module parameter · d4f373e5
      Alan Stern authored
      This patch (as1163b) adds a "quirks=" module parameter to usb-storage.
      This will allow people to make short-term changes to their
      unusual_devs list without rebuilding the entire driver.  Testing will
      become much easier, and less-sophisticated users will be able to
      access their buggy devices after a simple config-file change instead
      of having to wait for a new kernel release.
      
      The patch also adds a documentation entry for usb-storage's
      "delay_use" parameter, which has been around for years but but was
      never listed among the kernel parameters.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d4f373e5
  12. 23 Sep, 2008 1 commit
  13. 14 Aug, 2008 1 commit
    • Kevin Lloyd's avatar
      USB Storage Sierra: TRU-Install feature update · 32fe5e39
      Kevin Lloyd authored
      This patch upgrades the support for the Sierra Wireless TRU-Install
      feature (i.e. zeroCD) to allow for future support of Linux enabled
      TRU-Install devices.
      
      By default all devices that do not have a Linux enabled TRU-Install
      device (i.e. the device does not have a Linux package on the virtual CD
      partition) will be switched into "modem mode." Devices that do contain a
      Linux package in the TRU-Install virtual CD will be allowed to enumerate
      as a CD-Rom so that either (a) a user can install the packaged software
      or (b) a user-space application (e.g. udev) can switch it to modem mode.
      
      This patch does allow for manual override by adding a usb-storage module
      parameter 'swi_tru_install' which can force the modem into either mode
      regardless of what packages it contains.
      Signed-off-by: default avatarKevin Lloyd <klloyd@sierrawireless.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      32fe5e39
  14. 21 Jul, 2008 1 commit