08 Jan, 2009

8 commits

  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Dan Williams
    Acked-by: Marcel Holtmann
    Cc: Peter Henn
    Cc: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Dan Williams
     
  • 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: Alan Stern
    CC: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Cc: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    CC: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1171) removes us->sensebuf, since it isn't used anywhere.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

24 Sep, 2008

1 commit


14 Aug, 2008

1 commit

  • 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: Kevin Lloyd
    Signed-off-by: Greg Kroah-Hartman

    Kevin Lloyd
     

22 Jul, 2008

4 commits

  • This patch removes CVS keywords that weren't updated for a long time
    from comments.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Greg Kroah-Hartman

    Adrian Bunk
     
  • This patch (as1092) implements "soft" unbinding for usb-storage. When
    the disconnect routine is called, all commands and reset delays are
    allowed to complete normally until after scsi_remove_host() returns.
    This means that the commands needed for an orderly shutdown will be
    sent through to the device.

    Unlike before, the driver will now execute every command that it
    accepts. Hence there's no need for special code to catch unexecuted
    commands and fail them.

    The new sequence of events when disconnect runs goes as follows:

    If the device is truly unplugged, set the DISCONNECTING
    flag so we won't try to access it any more.

    If the SCSI-scanning thread hasn't started up yet, prevent
    it from doing anything by setting the new DONT_SCAN flag.
    Then wake it up and wait for it to terminate.

    Remove the SCSI host. This unbinds the upper-level drivers,
    doing an orderly shutdown. Commands sent to quiesce the
    device will be transmitted normally, unless the device is
    unplugged.

    Set the DISCONNECTING flag so that we won't accept any new
    commands that might get submitted (there aren't supposed to be
    any) and we won't try to access the device for resets.

    Tell the control thread to exit by waking it up with no
    pending command, and wait for it to terminate.

    Go on to do all the other normal stuff: releasing resources,
    freeing memory, and so on.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1090) converts the one remaining semaphore in
    usb-storage into a completion.

    Signed-off-by: Alan Stern
    Cc: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    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: Alan Stern
    Cc: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

03 May, 2008

1 commit

  • drivers/usb/storage/unusual_devs.h lists the address
    linux-usb-devel@lists.sourceforge.net for patches to that file. This
    address results in a bounce and a pointer to vger. This patch updates
    the address in the header file.

    Signed-off-by: Andrew Lunn
    Signed-off-by: Greg Kroah-Hartman

    Andrew Lunn
     

25 Apr, 2008

2 commits

  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Signed-off-by: Greg Kroah-Hartman

    Harvey Harrison
     
  • I have got a cypress usb-ide bridge and I would like to tune or monitor
    my disk with tools like hdparm, hddtemp or smartctl.

    My controller support a way to send raw ATA command to the disk with
    something call atacb (see
    http://download.cypress.com.edgesuite.net/design_resources/datasheets/contents/cy7c68300c_8.pdf).

    Atacb support can be added for each application, but there is some disadvantages :
    - all application need to be patched
    - A race is possible if there other accesses, because the emulation can
    be split in 2 atacb scsi transactions. One for sending the command, one
    for reading the register (if ck_cond is set).

    I have implemented the emulation in usb-storage with a special proto_handler,
    and an unsual entry.

    Signed-off-by: Matthieu CASTET
    Signed-off-by: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    matthieu castet
     

19 Oct, 2007

1 commit

  • Introduce freezer-friendly wrappers around wait_event_interruptible() and
    wait_event_interruptible_timeout(), originally defined in , to
    be used in freezable kernel threads. Make some of the freezable kernel
    threads use them.

    This is necessary for the freezer to stop sending signals to kernel threads,
    which is implemented in the next patch.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Cc: Nigel Cunningham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

13 Oct, 2007

1 commit

  • Attached is a very small patch (several comment lines) and a one-line
    coded change) that allows for USB storage devices that are larger than
    2TB.

    At the company where I work we need such support, and one of my
    co-workers, Jane Liu, pointed out that SCSI low-layer drivers need to
    specify what size CDBs they accept. After looking through the code it
    became obvious that the current USB Storage code accepted the default of
    12-byte CDBs, so I changed it to accept 16-byte CDBs. This allows our
    device to work.

    Signed-off-by: Richard Sharpe
    Signed-off-by: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Richard Sharpe
     

13 Sep, 2007

1 commit


23 Aug, 2007

1 commit

  • 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: Alan Stern
    CC: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

18 Jul, 2007

1 commit

  • 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: Rafael J. Wysocki
    Acked-by: Nigel Cunningham
    Cc: Pavel Machek
    Cc: Oleg Nesterov
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

13 Jul, 2007

5 commits

  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    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: Alan Stern
    Signed-off-by: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    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: Alan Stern
    Signed-off-by: Jiri Kosina
    CC: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

05 Mar, 2007

1 commit


08 Feb, 2007

1 commit

  • According to the Bulk-Only spec, usb-storage is supposed to use the
    _first_ bulk-in and bulk-out endpoints it finds, not the _last_. And
    while we're at it, we ought to test the direction of the interrupt
    endpoint as well. This patch (as842) makes both changes.

    Signed-off-by: Alan Stern
    Cc: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

08 Dec, 2006

1 commit


02 Dec, 2006

1 commit


28 Sep, 2006

1 commit

  • This changeset from Keith Bennett (via Bob Copeland) moves the Karma
    initializer to its own file and adds trapping of the START_STOP command to
    enable eject of the device.

    Signed-off-by: Keith Bennett
    Signed-off-by: Bob Copeland
    Signed-off-by: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Matthew Dharm
     

03 Aug, 2006

1 commit

  • This patch adds a new unusual_devs flag for when usb-storage needs to ignore
    a device that it would otherwise claim.

    We need to ignore the ZyXEL G220F as it is a virtual CDROM drive which
    includes the windows driver for this USB-WLAN adapter. After the windows
    driver is installed on a windows system, it converts it into a WLAN adapter
    (by ejecting the virtual disc).

    The virtual CDROM is of no interest to Linux users. The zd1211rw driver will
    automatically perform the eject operation, we just need to ensure that
    usb-storage does not claim the device.

    Signed-off-by: Daniel Drake
    Signed-off-by: Matthew Dharm
    Signed-off-by: Phil Dibowitz
    Signed-off-by: Greg Kroah-Hartman

    Daniel Drake
     

13 Jul, 2006

2 commits

  • This patch adds the kernel version to the usb-storage Protocol/SubClass
    unneeded message in order to help us troubleshoot such problems.

    Signed-off-by: Phil Dibowitz
    Signed-off-by: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Phil Dibowitz
     
  • My recent patch converting usb-storage to use
    usb_reset_composite_device() added a bug, a race between reset and
    disconnect. It was necessary to drop the private lock while executing a
    reset, and if a disconnect occurs at that time it will cause a crash.

    This patch (as722) fixes the problem by explicitly checking for an early
    termination after executing each command.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

01 Jul, 2006

1 commit


22 Jun, 2006

2 commits


21 Mar, 2006

1 commit


05 Jan, 2006

1 commit

  • This patch adds another usb-storage subdriver, which supports two fairly
    old dual-XD/SmartMedia reader-writers (USB1.1 devices).

    This driver was written by Daniel Drake -- he notes
    that he wrote this driver without specs, however a vendor-supplied GPL
    driver for the previous generation of products ("sma03") did prove to be
    quite useful, as did the sddr09 driver which also has to deal with
    low-level physical block layout on SmartMedia.

    The original patch has been reformed by me, as it clashed with the
    libusual patches.

    We really need to consolidate some of this common SmartMedia code, and
    get together with the MTD guys to share it with them as well.

    Signed-off-by: Daniel Drake
    Signed-off-by: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Matthew Dharm