23 Jun, 2012

2 commits

  • This patch (as1560) reverts commit
    afff07e61a5243e14ee3f0a272a0380cd744a8a3 (usb-storage: Add 090c:1000
    to unusal-devs). It is no longer needed, because usb-storage now
    tells the sd driver to try READ CAPACITY(10) before READ CAPACITY(16)
    for every USB mass-storage device.

    Signed-off-by: Alan Stern
    Acked-by: Hans de Goede
    CC: Matthew Dharm
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Several bug reports have been received recently for USB mass-storage
    devices that don't handle READ CAPACITY(16) commands properly. They
    report bogus sizes, in some cases becoming unusable as a result.

    The bugs were triggered by commit
    09b6b51b0b6c1b9bb61815baf205e4d74c89ff04 (SCSI & usb-storage: add
    flags for VPD pages and REPORT LUNS), which caused usb-storage to stop
    overriding the SCSI level reported by devices. By default, the sd
    driver will try READ CAPACITY(16) first for any device whose level is
    above SCSI_SPC_2.

    It seems likely that any device large enough to require the use of
    READ CAPACITY(16) (i.e., 2 TB or more) would be able to handle READ
    CAPACITY(10) commands properly. Indeed, I don't know of any devices
    that don't handle READ CAPACITY(10) properly.

    Therefore this patch (as1559) adds a new flag telling the sd driver
    to try READ CAPACITY(10) before READ CAPACITY(16), and sets this flag
    for every USB mass-storage device. If a device really is larger than
    2 TB, sd will fall back to READ CAPACITY(16) just as it used to.

    This fixes Bugzilla #43391.

    Signed-off-by: Alan Stern
    Acked-by: Hans de Goede
    CC: "James E.J. Bottomley"
    CC: Matthew Dharm
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

14 Jun, 2012

1 commit

  • This device gives a bogus answer to get_capacity(16):
    [ 8628.278614] scsi 8:0:0:0: Direct-Access USB 2.0 USB Flash Drive 1100 PQ: 0 ANSI: 4
    [ 8628.279452] sd 8:0:0:0: Attached scsi generic sg4 type 0
    [ 8628.280338] sd 8:0:0:0: [sdd] 35747322042253313 512-byte logical blocks: (18.3 EB/15.8 EiB)

    So set the quirk flag to avoid using get_capacity(16) with it:
    [11731.386014] usb-storage 2-1.6:1.0: Quirks match for vid 090c pid 1000: 80000
    [11731.386075] scsi9 : usb-storage 2-1.6:1.0
    [11731.386172] usbcore: registered new interface driver usb-storage
    [11731.386175] USB Mass Storage support registered.
    [11732.387394] scsi 9:0:0:0: Direct-Access USB 2.0 USB Flash Drive 1100 PQ: 0 ANSI: 4
    [11732.388462] sd 9:0:0:0: Attached scsi generic sg3 type 0
    [11732.389432] sd 9:0:0:0: [sdc] 7975296 512-byte logical blocks: (4.08 GB/3.80 GiB)

    Which makes the capacity look a lot more sane :)

    Signed-off-by: Hans de Goede
    Tested-by: Simon Raffeiner
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     

23 May, 2012

1 commit

  • Pull trivial updates from Jiri Kosina:
    "As usual, it's mostly typo fixes, redundant code elimination and some
    documentation updates."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits)
    edac, mips: don't change code that has been removed in edac/mips tree
    xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer
    lib: Change mail address of Oskar Schirmer
    net: Change mail address of Oskar Schirmer
    arm/m68k: Change mail address of Sebastian Hess
    i2c: Change mail address of Oskar Schirmer
    net: Fix tcp_build_and_update_options comment in struct tcp_sock
    atomic64_32.h: fix parameter naming mismatch
    Kconfig: replace "--- help ---" with "---help---"
    c2port: fix bogus Kconfig "default no"
    edac: Fix spelling errors.
    qla1280: Remove redundant NULL check before release_firmware() call
    remoteproc: remove redundant NULL check before release_firmware()
    qla2xxx: Remove redundant NULL check before release_firmware() call.
    aic94xx: Get rid of redundant NULL check before release_firmware() call
    tehuti: delete redundant NULL check before release_firmware()
    qlogic: get rid of a redundant test for NULL before call to release_firmware()
    bna: remove redundant NULL test before release_firmware()
    tg3: remove redundant NULL test before release_firmware() call
    typhoon: get rid of redundant conditional before all to release_firmware()
    ...

    Linus Torvalds
     

18 May, 2012

3 commits


10 May, 2012

1 commit


23 Apr, 2012

1 commit


19 Apr, 2012

1 commit


09 Apr, 2012

1 commit


07 Apr, 2012

1 commit

  • This patch fixes one lockdep warning[1] inside usb_stor_pre_reset.

    If the current configuration includes multiple mass storage interfaces,
    the 'AA' lockdep warning will be triggered since the lock class of
    'us->dev_mutex' is acquired two times in .reset path. It isn't
    a real deadlock, so just take the lockdep_set_class annotation to
    remove the warning.

    [1], lockdep warning log
    :[ INFO: possible recursive locking detected ]
    :3.3.0-0.rc5.git3.1.fc17.x86_64 #1 Tainted: G W
    :---------------------------------------------
    :usb-storage/14846 is trying to acquire lock:
    : (&(us->dev_mutex)){+.+.+.}, at: [] usb_stor_pre_reset+0x1c/0x20 [usb_storage]
    :but task is already holding lock:
    : (&(us->dev_mutex)){+.+.+.}, at: [] usb_stor_pre_reset+0x1c/0x20 [usb_storage]
    :other info that might help us debug this:
    : Possible unsafe locking scenario:
    : CPU0
    : ----
    : lock(&(us->dev_mutex));
    : lock(&(us->dev_mutex));
    : *** DEADLOCK ***
    : May be due to missing lock nesting notation
    :2 locks held by usb-storage/14846:
    : #0: (&__lockdep_no_validate__){......}, at: [] usb_lock_device_for_reset+0x95/0x100
    : #1: (&(us->dev_mutex)){+.+.+.}, at: [] usb_stor_pre_reset+0x1c/0x20 [usb_storage]
    :stack backtrace:
    :Pid: 14846, comm: usb-storage Tainted: G W 3.3.0-0.rc5.git3.1.fc17.x86_64 #1
    :Call Trace:
    : [] __lock_acquire+0x168f/0x1bb0
    : [] ? native_sched_clock+0x13/0x80
    : [] ? sched_clock+0x9/0x10
    : [] ? sched_clock+0x9/0x10
    : [] ? sched_clock_local+0x25/0xa0
    : [] lock_acquire+0xa1/0x1e0
    : [] ? usb_stor_pre_reset+0x1c/0x20 [usb_storage]
    : [] mutex_lock_nested+0x76/0x3a0
    : [] ? usb_stor_pre_reset+0x1c/0x20 [usb_storage]
    : [] ? usb_stor_pre_reset+0x1c/0x20 [usb_storage]
    : [] usb_stor_pre_reset+0x1c/0x20 [usb_storage]
    : [] usb_reset_device+0x7d/0x190
    : [] usb_stor_port_reset+0x7c/0x80 [usb_storage]
    : [] usb_stor_invoke_transport+0x94/0x560 [usb_storage]
    : [] ? mark_held_locks+0xb2/0x130
    : [] ? _raw_spin_unlock_irq+0x30/0x50
    : [] usb_stor_transparent_scsi_command+0xe/0x10 [usb_storage]
    : [] usb_stor_control_thread+0x173/0x280 [usb_storage]
    : [] ? fill_inquiry_response+0x20/0x20 [usb_storage]
    : [] kthread+0xb7/0xc0
    : [] kernel_thread_helper+0x4/0x10
    : [] ? retint_restore_args+0x13/0x13
    : [] ? kthread_worker_fn+0x1a0/0x1a0
    : [] ? gs_change+0x13/0x13

    Reported-By: Dave Jones
    Signed-off-by: Ming Lei
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     

31 Mar, 2012

1 commit

  • Usage of /etc/modprobe.conf file was deprecated by module-init-tools and
    is no longer parsed by new kmod tool. References to this file are
    replaced in Documentation, comments and Kconfig according to the
    context.

    There are also some references to the old /etc/modules.conf from 2.4
    kernels that are being removed.

    Signed-off-by: Lucas De Marchi
    Acked-by: Takashi Iwai
    Acked-by: Mauro Carvalho Chehab
    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Lucas De Marchi
     

28 Mar, 2012

1 commit


29 Feb, 2012

2 commits


25 Feb, 2012

1 commit


24 Feb, 2012

1 commit


22 Feb, 2012

1 commit

  • This patch (as1521b) fixes the interaction between usb-storage's
    scanning thread and the freezer. The current implementation has a
    race: If the device is unplugged shortly after being plugged in and
    just as a system sleep begins, the scanning thread may get frozen
    before the khubd task. Khubd won't be able to freeze until the
    disconnect processing is complete, and the disconnect processing can't
    proceed until the scanning thread finishes, so the sleep transition
    will fail.

    The implementation in the 3.2 kernel suffers from an additional
    problem. There the scanning thread calls set_freezable_with_signal(),
    and the signals sent by the freezer will mess up the thread's I/O
    delays, which are all interruptible.

    The solution to both problems is the same: Replace the kernel thread
    used for scanning with a delayed-work routine on the system freezable
    work queue. Freezable work queues have the nice property that you can
    cancel a work item even while the work queue is frozen, and no signals
    are needed.

    The 3.2 version of this patch solves the problem in Bugzilla #42730.

    Signed-off-by: Alan Stern
    Acked-by: Seth Forshee
    CC: stable
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

11 Feb, 2012

1 commit


09 Feb, 2012

2 commits

  • Now that usb-storage has a target_alloc() routine, this patch (as1508)
    moves some existing target-specific code out of the slave_alloc()
    routine to where it really belongs.

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

    Alan Stern
     
  • This patch (as1507) adds a skip_vpd_pages flag to struct scsi_device
    and a no_report_luns flag to struct scsi_target. The first is used to
    control whether sd will look at VPD pages for information on block
    provisioning, limits, and characteristics. The second prevents
    scsi_report_lun_scan() from issuing a REPORT LUNS command.

    The patch also modifies usb-storage to set the new flag bits for all
    USB devices and targets, and to stop adjusting the scsi_level value.

    Historically we have seen that USB mass-storage devices often don't
    support VPD pages or REPORT LUNS properly. Until now we have avoided
    these things by setting the scsi_level to SCSI_2 for all USB devices.
    But this has the side effect of storing the LUN bits into the second
    byte of each CDB, and now we have a report of a device which doesn't
    like that. The best solution is to stop abusing scsi_level and
    instead have separate flags for VPD pages and REPORT LUNS.

    Signed-off-by: Alan Stern
    Reported-by: Perry Wagle
    CC: Matthew Dharm
    Cc: James Bottomley
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

03 Feb, 2012

4 commits

  • Just run into the following:
    - new disk arrived in the system
    - udev couldn't wait to get its hands on to to run ata_id /dev/sda
    - this sent the cdb 0xa1 to the device.
    - my UAS-gadget recevied the cdb and had no idea what to do with it. It
    decided to send a status URB back with sense set to invalid opcode.
    - the host side received it status and completed the scsi command.
    - the host sent another scsi with 4kib data buffer
    - Now I was confused why the data transfer is only 512 bytes instead of
    4kib since the host is always allocating the complete transfer in one
    go.
    - Finally the system crashed while walking through the sg list.

    This patch adds three new flags in order to distinguish between DATA
    URB completed and outstanding. If we receive status before data, we
    cancel data and let data complete the command.
    This solves the problem for IN and OUT transfers but does not work for
    BIDI.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Sarah Sharp

    Sebastian Andrzej Siewior
     
  • The protocol specific structures and defines which are used by UAS are
    moved into a header files by this patch so it can be accessed by the UAS
    gadget as well.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Sarah Sharp

    Sebastian Andrzej Siewior
     
  • The UAS driver requires SG support by the HCD operating the device. This
    patch stops UAS from operating on a HCD without sg support and prints a
    message to let him know.

    The spec says:
    |For [USB2] backward compatibility, the device shall present [BOT] as
    |alternate interface zero (primary) and [UAS] as alternate interface one
    |(secondary). A device which does not need backward compatibility with
    |[BOT] shall present [UAS] as alternate interface zero. In [USB2]
    |systems, the [BOT] driver or an associated filter driver may need to
    |issue a SET INTERFACE request for alternate interface one and then allow
    |the [UAS] driver to load.

    If the user used usb_modeswitch to switch to UAS then he can go back to
    BOT or use a different HCD. In case UAS is the only interface then there
    is currently no way out.
    In future usb_sg_wait() should be extended to provide a non-blocking
    interface so it can work with the UAS driver.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Sarah Sharp

    Sebastian Andrzej Siewior
     
  • Merge UAS bug fixes from Sebastian Andrzej Siewior, including some patches of
    mine that he signed.

    UAS fixes for Sarah

    Sarah Sharp
     

27 Jan, 2012

1 commit


25 Jan, 2012

2 commits


10 Jan, 2012

1 commit

  • * 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (232 commits)
    USB: Add USB-ID for Multiplex RC serial adapter to cp210x.c
    xhci: Clean up 32-bit build warnings.
    USB: update documentation for usbmon
    usb: usb-storage doesn't support dynamic id currently, the patch disables the feature to fix an oops
    drivers/usb/class/cdc-acm.c: clear dangling pointer
    drivers/usb/dwc3/dwc3-pci.c: introduce missing kfree
    drivers/usb/host/isp1760-if.c: introduce missing kfree
    usb: option: add ZD Incorporated HSPA modem
    usb: ch9: fix up MaxStreams helper
    USB: usb-skeleton.c: cleanup open_count
    USB: usb-skeleton.c: fix open/disconnect race
    xhci: Properly handle COMP_2ND_BW_ERR
    USB: remove dead code from suspend/resume path
    USB: add quirk for another camera
    drivers: usb: wusbcore: Fix dependency for USB_WUSB
    xhci: Better debugging for critical host errors.
    xhci: Be less verbose during URB cancellation.
    xhci: Remove debugging about ring structure allocation.
    xhci: Remove debugging about toggling cycle bits.
    xhci: Remove debugging for individual transfers.
    ...

    Linus Torvalds
     

09 Jan, 2012

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
    Kconfig: acpi: Fix typo in comment.
    misc latin1 to utf8 conversions
    devres: Fix a typo in devm_kfree comment
    btrfs: free-space-cache.c: remove extra semicolon.
    fat: Spelling s/obsolate/obsolete/g
    SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
    tools/power turbostat: update fields in manpage
    mac80211: drop spelling fix
    types.h: fix comment spelling for 'architectures'
    typo fixes: aera -> area, exntension -> extension
    devices.txt: Fix typo of 'VMware'.
    sis900: Fix enum typo 'sis900_rx_bufer_status'
    decompress_bunzip2: remove invalid vi modeline
    treewide: Fix comment and string typo 'bufer'
    hyper-v: Update MAINTAINERS
    treewide: Fix typos in various parts of the kernel, and fix some comments.
    clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
    gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
    leds: Kconfig: Fix typo 'D2NET_V2'
    sound: Kconfig: drop unknown symbol ARCH_CLPS7500
    ...

    Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
    kconfig additions, close to removed commented-out old ones)

    Linus Torvalds
     
  • * 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
    PM / Hibernate: Implement compat_ioctl for /dev/snapshot
    PM / Freezer: fix return value of freezable_schedule_timeout_killable()
    PM / shmobile: Allow the A4R domain to be turned off at run time
    PM / input / touchscreen: Make st1232 use device PM QoS constraints
    PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
    PM / shmobile: Remove the stay_on flag from SH7372's PM domains
    PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume
    PM / shmobile: Add support for the sh7372 A4S power domain / sleep mode
    PM: Drop generic_subsys_pm_ops
    PM / Sleep: Remove forward-only callbacks from AMBA bus type
    PM / Sleep: Remove forward-only callbacks from platform bus type
    PM: Run the driver callback directly if the subsystem one is not there
    PM / Sleep: Make pm_op() and pm_noirq_op() return callback pointers
    PM/Devfreq: Add Exynos4-bus device DVFS driver for Exynos4210/4212/4412.
    PM / Sleep: Merge internal functions in generic_ops.c
    PM / Sleep: Simplify generic system suspend callbacks
    PM / Hibernate: Remove deprecated hibernation snapshot ioctls
    PM / Sleep: Fix freezer failures due to racy usermodehelper_is_disabled()
    ARM: S3C64XX: Implement basic power domain support
    PM / shmobile: Use common always on power domain governor
    ...

    Fix up trivial conflict in fs/xfs/xfs_buf.c due to removal of unused
    XBT_FORCE_SLEEP bit

    Linus Torvalds
     

07 Jan, 2012

1 commit

  • This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file,
    and it fixes the build error in the arch/x86/kernel/microcode_core.c
    file, that the merge did not catch.

    The microcode_core.c patch was provided by Stephen Rothwell
    who was invaluable in the merge issues involved
    with the large sysdev removal process in the driver-core tree.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

05 Jan, 2012

1 commit

  • Echo vendor and product number of a non usb-storage device to
    usb-storage driver's new_id, then plug in the device to host and you
    will find following oops msg, the root cause is usb_stor_probe1()
    refers invalid id entry if giving a dynamic id, so just disable the
    feature.

    [ 3105.018012] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
    [ 3105.018062] CPU 0
    [ 3105.018075] Modules linked in: usb_storage usb_libusual bluetooth
    dm_crypt binfmt_misc snd_hda_codec_analog snd_hda_intel snd_hda_codec
    snd_hwdep hp_wmi ppdev sparse_keymap snd_pcm snd_seq_midi snd_rawmidi
    snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse snd
    serio_raw tpm_infineon soundcore i915 snd_page_alloc tpm_tis
    parport_pc tpm tpm_bios drm_kms_helper drm i2c_algo_bit video lp
    parport usbhid hid sg sr_mod sd_mod ehci_hcd uhci_hcd usbcore e1000e
    usb_common floppy
    [ 3105.018408]
    [ 3105.018419] Pid: 189, comm: khubd Tainted: G I 3.2.0-rc7+
    #29 Hewlett-Packard HP Compaq dc7800p Convertible Minitower/0AACh
    [ 3105.018481] RIP: 0010:[] []
    usb_stor_probe1+0x2fd/0xc20 [usb_storage]
    [ 3105.018536] RSP: 0018:ffff880056a3d830 EFLAGS: 00010286
    [ 3105.018562] RAX: ffff880065f4e648 RBX: ffff88006bb28000 RCX: 0000000000000000
    [ 3105.018597] RDX: ffff88006f23c7b0 RSI: 0000000000000001 RDI: 0000000000000206
    [ 3105.018632] RBP: ffff880056a3d900 R08: 0000000000000000 R09: ffff880067365000
    [ 3105.018665] R10: 00000000000002ac R11: 0000000000000010 R12: ffff6000b41a7340
    [ 3105.018698] R13: ffff880065f4ef60 R14: ffff88006bb28b88 R15: ffff88006f23d270
    [ 3105.018733] FS: 0000000000000000(0000) GS:ffff88007a200000(0000)
    knlGS:0000000000000000
    [ 3105.018773] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [ 3105.018801] CR2: 00007fc99c8c4650 CR3: 0000000001e05000 CR4: 00000000000006f0
    [ 3105.018835] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 3105.018870] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 3105.018906] Process khubd (pid: 189, threadinfo ffff880056a3c000,
    task ffff88005677a400)
    [ 3105.018945] Stack:
    [ 3105.018959] 0000000000000000 0000000000000000 ffff880056a3d8d0
    0000000000000002
    [ 3105.019011] 0000000000000000 ffff880056a3d918 ffff880000000000
    0000000000000002
    [ 3105.019058] ffff880056a3d8d0 0000000000000012 ffff880056a3d8d0
    0000000000000006
    [ 3105.019105] Call Trace:
    [ 3105.019128] [] storage_probe+0xa4/0xe0 [usb_storage]
    [ 3105.019173] [] usb_probe_interface+0x172/0x330 [usbcore]
    [ 3105.019211] [] driver_probe_device+0x257/0x3b0
    [ 3105.019243] [] __device_attach+0x73/0x90
    [ 3105.019272] [] ? __driver_attach+0x110/0x110
    [ 3105.019303] [] bus_for_each_drv+0x9c/0xf0
    [ 3105.019334] [] device_attach+0xf7/0x120
    [ 3105.019364] [] bus_probe_device+0x45/0x80
    [ 3105.019396] [] device_add+0x876/0x990
    [ 3105.019434] [] usb_set_configuration+0x822/0x9e0 [usbcore]
    [ 3105.019479] [] generic_probe+0x62/0xf0 [usbcore]
    [ 3105.019518] [] usb_probe_device+0x66/0xb0 [usbcore]
    [ 3105.019555] [] driver_probe_device+0x257/0x3b0
    [ 3105.019589] [] __device_attach+0x73/0x90
    [ 3105.019617] [] ? __driver_attach+0x110/0x110
    [ 3105.019648] [] bus_for_each_drv+0x9c/0xf0
    [ 3105.019680] [] device_attach+0xf7/0x120
    [ 3105.019709] [] bus_probe_device+0x45/0x80
    [ 3105.021040] usb usb6: usb auto-resume
    [ 3105.021045] usb usb6: wakeup_rh
    [ 3105.024849] [] device_add+0x876/0x990
    [ 3105.025086] [] usb_new_device+0x1e7/0x2b0 [usbcore]
    [ 3105.025086] [] hub_thread+0xb27/0x1ec0 [usbcore]
    [ 3105.025086] [] ? wake_up_bit+0x50/0x50
    [ 3105.025086] [] ? usb_remote_wakeup+0xa0/0xa0 [usbcore]
    [ 3105.025086] [] kthread+0xd8/0xf0
    [ 3105.025086] [] kernel_thread_helper+0x4/0x10
    [ 3105.025086] [] ? _raw_spin_unlock_irq+0x50/0x80
    [ 3105.025086] [] ? retint_restore_args+0x13/0x13
    [ 3105.025086] [] ? __init_kthread_worker+0x80/0x80
    [ 3105.025086] [] ? gs_change+0x13/0x13
    [ 3105.025086] Code: 00 48 83 05 cd ad 00 00 01 48 83 05 cd ad 00 00
    01 4c 8b ab 30 0c 00 00 48 8b 50 08 48 83 c0 30 48 89 45 a0 4c 89 a3
    40 0c 00 00 0f b6 44 24 10 48 89 55 a8 3c ff 0f 84 b8 04 00 00 48
    83 05
    [ 3105.025086] RIP [] usb_stor_probe1+0x2fd/0xc20
    [usb_storage]
    [ 3105.025086] RSP
    [ 3105.060037] hub 6-0:1.0: hub_resume
    [ 3105.062616] usb usb5: usb auto-resume
    [ 3105.064317] ehci_hcd 0000:00:1d.7: resume root hub
    [ 3105.094809] ---[ end trace a7919e7f17c0a727 ]---
    [ 3105.130069] hub 5-0:1.0: hub_resume
    [ 3105.132131] usb usb4: usb auto-resume
    [ 3105.132136] usb usb4: wakeup_rh
    [ 3105.180059] hub 4-0:1.0: hub_resume
    [ 3106.290052] usb usb6: suspend_rh (auto-stop)
    [ 3106.290077] usb usb4: suspend_rh (auto-stop)

    Signed-off-by: Huajun Li
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Huajun Li
     

02 Jan, 2012

1 commit


22 Dec, 2011

5 commits

  • The status/sense URB is allocated on per-command basis. A read/write
    looks the following way on a stream-less connection:

    - send cmd tag X, queue status
    - receive status, oh it is a read for tag X. queue status & read
    - receive read
    - receive status, oh I'm done for tag X. Cool call complete and free
    status urb.

    This block repeats itself 1:1 for further commands and looks great so
    far. Lets take a look now what happens if we do allow multiple commands:

    - send cmd tag X, queue statusX (belongs to the command with the X tag)
    - send cmd tag Y, queue statusY (belongs to the command with the Y tag)
    - receive statusX, oh it is a read for tag X. queue statusX & a read
    - receive read
    - receive statusY, oh I'm done for tag X. Cool call complete and free statusY.
    - receive statusX, oh it is a read for tag Y. queue statusY & before we
    queue the read the the following message can be observed:
    |sd 0:0:0:0: [sda] sense urb submission failure
    followed by a second attempt with the same result.

    In order to address this problem we will use only one status URB for
    each scsi host in case we don't have stream support (as suggested by
    Matthew). This URB is requeued until the device removed. Nothing changes
    on stream based endpoints.

    Signed-off-by: Sebastian Andrzej Siewior

    Sebastian Andrzej Siewior
     
  • In "usb/uas: use unique tags for all LUNs" we make sure to create unique
    tags across all LUNs. This patch uses scsi_host_find_tag() to obtain the
    correct command which is associated with the tag.
    The following changes are required:
    - don't use sdev->current_cmnd anymore
    Since we can have devices which don't support command queueing we must
    ensure that we can tell the two commands apart. Even if a device
    supports comand queuing we send the INQUIRY command "untagged" for
    LUN1 while we can send a tagged command to LUN0 at the same time.
    devinfo->cmnd is used for stashing the one "untagged" command.
    - tag number is altered. If stream support is used then the tag number
    must match the stream number. Therefore we can't use tag 0 and must
    start at tag 1.
    In case we have untagged commands (at least the first command) we must
    be able to distinguish between command tag 0 (which becomes 1) and
    untagged command (which becomes curently also 1).
    The following tag numbers are used:
    0: never
    1: for untagged commands (devinfo->cmnd)
    2+: tagged commands.

    Signed-off-by: Sebastian Andrzej Siewior

    Sebastian Andrzej Siewior
     
  • I observed that on a device with multiple LUNs UAS was re-using the same
    tag number for requests which were issued at the same time to both LUNs.
    This patch uses scsi_init_shared_tag_map() to use unique tags for all
    LUNs. With this patch I haven't seen the same tag number during the init
    sequence anymore. Tag 1 is used for devices which do not adverise
    command queueing.
    This patch initilizes the queue before adding the scsi host like the
    other two user in tree.

    Signed-off-by: Sebastian Andrzej Siewior

    Sebastian Andrzej Siewior
     
  • In the UAS status URB completion handler, we need to free the URB, no
    matter what happens. Fix a bug where we would leak the URB (and its
    buffer) if we couldn't find a SCSI command that is associated with this
    status phase.

    Signed-off-by: Sarah Sharp
    Cc: Matthew Wilcox
    Signed-off-by: Sebastian Andrzej Siewior

    Sarah Sharp
     
  • UAS can work with either USB 3.0 devices that support bulk streams, or
    USB 2.0 devices that do not support bulk streams. When we're working
    with a non-streams device, we need to be able to uniquely identify a
    SCSI command with a tag in the IU. Devices will barf and abort all
    queued commands if they find a duplicate tag.

    uas_queuecommand_lck() sets cmdinfo->stream to zero if the device
    doesn't support streams, which is later passed into uas_alloc_cmd_urb()
    as the variable stream. This means the UAS driver was setting the tag
    in all commands to zero for non-stream devices. So the UAS driver won't
    currently work with USB 2.0 devices.

    Use the SCSI command tag instead of the stream ID for the command IU
    tag. We have to add one to the SCSI command tag because SCSI tags are
    zero-based, but stream IDs are one-based, and the command tag must match
    the stream ID that we're queueing the data IUs for. Untagged SCSI
    commands use stream ID 1.

    Signed-off-by: Sarah Sharp
    Cc: Matthew Wilcox
    Signed-off-by: Sebastian Andrzej Siewior

    Sarah Sharp