1. 06 9月, 2012 1 次提交
  2. 21 8月, 2012 1 次提交
  3. 16 8月, 2012 1 次提交
  4. 20 7月, 2012 2 次提交
  5. 17 7月, 2012 2 次提交
  6. 26 6月, 2012 7 次提交
  7. 23 6月, 2012 2 次提交
    • A
      usb-storage: revert commit afff07e6 (Add 090c:1000 to unusal-devs) · 0070513b
      Alan Stern 提交于
      This patch (as1560) reverts commit
      afff07e6 (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: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NHans de Goede <hdegoede@redhat.com>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0070513b
    • A
      SCSI & usb-storage: add try_rc_10_first flag · 6a0bdffa
      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
      09b6b51b (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: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NHans de Goede <hdegoede@redhat.com>
      CC: "James E.J. Bottomley" <JBottomley@parallels.com>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6a0bdffa
  8. 14 6月, 2012 2 次提交
  9. 18 5月, 2012 3 次提交
  10. 10 5月, 2012 1 次提交
  11. 19 4月, 2012 1 次提交
  12. 07 4月, 2012 1 次提交
    • M
      usb: storage: fix lockdep warning inside usb_stor_pre_reset(v2) · c825bab0
      Ming Lei 提交于
      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: [<ffffffffa0481c0c>] usb_stor_pre_reset+0x1c/0x20 [usb_storage]
      :but task is already holding lock:
      : (&(us->dev_mutex)){+.+.+.}, at: [<ffffffffa0481c0c>] 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: [<ffffffff8147e6a5>] usb_lock_device_for_reset+0x95/0x100
      : #1:  (&(us->dev_mutex)){+.+.+.}, at: [<ffffffffa0481c0c>] 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:
      : [<ffffffff810cbdaf>] __lock_acquire+0x168f/0x1bb0
      : [<ffffffff81021083>] ? native_sched_clock+0x13/0x80
      : [<ffffffff810210f9>] ? sched_clock+0x9/0x10
      : [<ffffffff810210f9>] ? sched_clock+0x9/0x10
      : [<ffffffff810a2975>] ? sched_clock_local+0x25/0xa0
      : [<ffffffff810cc9a1>] lock_acquire+0xa1/0x1e0
      : [<ffffffffa0481c0c>] ? usb_stor_pre_reset+0x1c/0x20 [usb_storage]
      : [<ffffffff81699c86>] mutex_lock_nested+0x76/0x3a0
      : [<ffffffffa0481c0c>] ? usb_stor_pre_reset+0x1c/0x20 [usb_storage]
      : [<ffffffffa0481c0c>] ? usb_stor_pre_reset+0x1c/0x20 [usb_storage]
      : [<ffffffffa0481c0c>] usb_stor_pre_reset+0x1c/0x20 [usb_storage]
      : [<ffffffff8148184d>] usb_reset_device+0x7d/0x190
      : [<ffffffffa048119c>] usb_stor_port_reset+0x7c/0x80 [usb_storage]
      : [<ffffffffa0481234>] usb_stor_invoke_transport+0x94/0x560 [usb_storage]
      : [<ffffffff810cd3b2>] ? mark_held_locks+0xb2/0x130
      : [<ffffffff8169dbd0>] ? _raw_spin_unlock_irq+0x30/0x50
      : [<ffffffffa047fe3e>] usb_stor_transparent_scsi_command+0xe/0x10 [usb_storage]
      : [<ffffffffa0481ae3>] usb_stor_control_thread+0x173/0x280 [usb_storage]
      : [<ffffffffa0481970>] ? fill_inquiry_response+0x20/0x20 [usb_storage]
      : [<ffffffff8108a3f7>] kthread+0xb7/0xc0
      : [<ffffffff816a7d34>] kernel_thread_helper+0x4/0x10
      : [<ffffffff8169e0f4>] ? retint_restore_args+0x13/0x13
      : [<ffffffff8108a340>] ? kthread_worker_fn+0x1a0/0x1a0
      : [<ffffffff816a7d30>] ? gs_change+0x13/0x13
      Reported-By: NDave Jones <davej@redhat.com>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c825bab0
  13. 31 3月, 2012 1 次提交
  14. 28 3月, 2012 1 次提交
  15. 29 2月, 2012 2 次提交
  16. 25 2月, 2012 1 次提交
  17. 22 2月, 2012 1 次提交
    • A
      usb-storage: fix freezing of the scanning thread · bb94a406
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NSeth Forshee <seth.forshee@canonical.com>
      CC: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bb94a406
  18. 09 2月, 2012 2 次提交
    • A
      usb-storage: reorganize target-specific code · af74d2da
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      af74d2da
    • A
      SCSI & usb-storage: add flags for VPD pages and REPORT LUNS · 09b6b51b
      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: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NPerry Wagle <wagle@mac.com>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      09b6b51b
  19. 03 2月, 2012 3 次提交
    • S
      usb/uas: make sure data urb is gone if we receive status before that · e4d8318a
      Sebastian Andrzej Siewior 提交于
      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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      e4d8318a
    • S
      usb/uas: move UAS structs / defines into a header file · 348748b0
      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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      348748b0
    • S
      usb/uas: only bind if the hcd supports SG · c898add5
      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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      c898add5
  20. 27 1月, 2012 1 次提交
  21. 25 1月, 2012 2 次提交
  22. 05 1月, 2012 1 次提交
    • H
      usb: usb-storage doesn't support dynamic id currently, the patch disables the... · 1a3a026b
      Huajun Li 提交于
      usb: usb-storage doesn't support dynamic id currently, the patch disables the feature to fix an oops
      
      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:[<ffffffffa045830d>]  [<ffffffffa045830d>]
      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]  [<ffffffffa0458cd4>] storage_probe+0xa4/0xe0 [usb_storage]
      [ 3105.019173]  [<ffffffffa0097822>] usb_probe_interface+0x172/0x330 [usbcore]
      [ 3105.019211]  [<ffffffff815fda67>] driver_probe_device+0x257/0x3b0
      [ 3105.019243]  [<ffffffff815fdd43>] __device_attach+0x73/0x90
      [ 3105.019272]  [<ffffffff815fdcd0>] ? __driver_attach+0x110/0x110
      [ 3105.019303]  [<ffffffff815fb93c>] bus_for_each_drv+0x9c/0xf0
      [ 3105.019334]  [<ffffffff815fd6c7>] device_attach+0xf7/0x120
      [ 3105.019364]  [<ffffffff815fc905>] bus_probe_device+0x45/0x80
      [ 3105.019396]  [<ffffffff815f98a6>] device_add+0x876/0x990
      [ 3105.019434]  [<ffffffffa0094e42>] usb_set_configuration+0x822/0x9e0 [usbcore]
      [ 3105.019479]  [<ffffffffa00a3492>] generic_probe+0x62/0xf0 [usbcore]
      [ 3105.019518]  [<ffffffffa0097a46>] usb_probe_device+0x66/0xb0 [usbcore]
      [ 3105.019555]  [<ffffffff815fda67>] driver_probe_device+0x257/0x3b0
      [ 3105.019589]  [<ffffffff815fdd43>] __device_attach+0x73/0x90
      [ 3105.019617]  [<ffffffff815fdcd0>] ? __driver_attach+0x110/0x110
      [ 3105.019648]  [<ffffffff815fb93c>] bus_for_each_drv+0x9c/0xf0
      [ 3105.019680]  [<ffffffff815fd6c7>] device_attach+0xf7/0x120
      [ 3105.019709]  [<ffffffff815fc905>] bus_probe_device+0x45/0x80
      [ 3105.021040] usb usb6: usb auto-resume
      [ 3105.021045] usb usb6: wakeup_rh
      [ 3105.024849]  [<ffffffff815f98a6>] device_add+0x876/0x990
      [ 3105.025086]  [<ffffffffa0088987>] usb_new_device+0x1e7/0x2b0 [usbcore]
      [ 3105.025086]  [<ffffffffa008a4d7>] hub_thread+0xb27/0x1ec0 [usbcore]
      [ 3105.025086]  [<ffffffff810d5200>] ? wake_up_bit+0x50/0x50
      [ 3105.025086]  [<ffffffffa00899b0>] ? usb_remote_wakeup+0xa0/0xa0 [usbcore]
      [ 3105.025086]  [<ffffffff810d49b8>] kthread+0xd8/0xf0
      [ 3105.025086]  [<ffffffff81939884>] kernel_thread_helper+0x4/0x10
      [ 3105.025086]  [<ffffffff8192a8c0>] ? _raw_spin_unlock_irq+0x50/0x80
      [ 3105.025086]  [<ffffffff8192b1b4>] ? retint_restore_args+0x13/0x13
      [ 3105.025086]  [<ffffffff810d48e0>] ? __init_kthread_worker+0x80/0x80
      [ 3105.025086]  [<ffffffff81939880>] ? 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 <41> 0f b6 44 24 10 48 89 55 a8 3c ff 0f 84 b8 04 00 00 48
      83 05
      [ 3105.025086] RIP  [<ffffffffa045830d>] usb_stor_probe1+0x2fd/0xc20
      [usb_storage]
      [ 3105.025086]  RSP <ffff880056a3d830>
      [ 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: NHuajun Li <huajun.li.lee@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1a3a026b
  23. 02 1月, 2012 1 次提交