aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/storage
AgeCommit message (Collapse)AuthorFilesLines
2014-09-23uas: Add another ASM1051 usb-id to the uas blacklistHans de Goede1-0/+8
As most ASM1051 based devices, this one has unfixable issues with uas too. Cc: [email protected] # 3.16 Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-23uas: Add US_FL_NO_ATA_1X quirk for Seagate (0bc2:ab20) drivesHans de Goede1-0/+7
https://bbs.archlinux.org/viewtopic.php?pid=1457492 Signed-off-by: Hans de Goede <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-23uas: Add no-report-opcodes quirkHans de Goede3-1/+15
Besides the ASM1051 (*) needing sdev->no_report_opcodes = 1, it turns out that the JMicron JMS567 also needs it to work properly with uas (usb-storage always sets it). Since some of the scsi devs were not to keen on the idea to outrightly set sdev->no_report_opcodes = 1 for all uas devices, so add a quirk for this, and set it for the JMS567. *) Which has become a non-issue since we've completely blacklisted uas on the ASM1051 for other reasons Cc: [email protected] Reported-and-tested-by: Claudio Bizzarri <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-23uas: Add a quirk for rejecting ATA_12 and ATA_16 commandsHans de Goede3-11/+31
And set this quirk for the Seagate Expansion Desk (0bc2:2312), as that one seems to hang upon receiving an ATA_12 or ATA_16 command. https://bugzilla.kernel.org/show_bug.cgi?id=79511 https://bbs.archlinux.org/viewtopic.php?id=183190 While at it also add missing documentation for the u value for usb-storage quirks. Cc: [email protected] # 3.16, 3.17 Signed-off-by: Hans de Goede <[email protected]> -- Changes in v2: Add documentation for new t and u usb-storage.quirks flags Changes in v3: Fix typo in documentation Changes in v4: Also apply the quirk to (0bc2:3312) Changes in v5: Rebased on 3.17-rc5, drop u documentation, already upstream Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-23uas: replace WARN_ON_ONCE() with lockdep_assert_held()Sanjeev Sharma1-4/+4
on some architecture spin_is_locked() always return false in uniprocessor configuration and therefore it would be advise to replace with lockdep_assert_held(). Signed-off-by: Sanjeev Sharma <[email protected]> Acked-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-19USB: storage: Add quirks for Entrega/Xircom USB to SCSI convertersMark1-0/+20
This patch adds quirks for Entrega Technologies (later Xircom PortGear) USB- SCSI converters. They use Shuttle Technology EUSB-01/EUSB-S1 chips. The US_FL_SCM_MULT_TARG quirk is needed to allow multiple devices on the SCSI chain to be accessed. Without it only the (single) device with SCSI ID 0 can be used. The standalone converter sold by Entrega had model number U1-SC25. Xircom acquired Entrega and re-branded the product line PortGear. The PortGear USB to SCSI Converter (model PGSCSI) is internally identical to the Entrega product, but later models may use a different USB ID. The Entrega-branded units have USB ID 1645:0007, as does my Xircom PGSCSI, but the Windows and Macintosh drivers also support 085A:0028. Entrega also sold the "Mac USB Dock", which provides two USB ports, a Mac (8-pin mini-DIN) serial port and a SCSI port. It appears to the computer as a four-port hub, USB-serial, and USB-SCSI converters. The USB-SCSI part may have initially used the same ID as the standalone U1-SC25 (1645:0007), but later production used 085A:0026. My Xircom PortGear PGSCSI has bcdDevice=0x0100. Units with bcdDevice=0x0133 probably also exist. This patch adds quirks for 1645:0007, 085A:0026 and 085A:0028. The Windows driver INF file also mentions 085A:0032 "PortStation SCSI Module", but I couldn't find any mention of that actually existing in the wild; perhaps it was cancelled before release? Signed-off-by: Mark Knibbs <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-19USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapterMark1-0/+6
Hi, The Ariston Technologies iConnect 025 and iConnect 050 (also known as e.g. iSCSI-50) are SCSI-USB converters which use Shuttle Technology/SCM Microsystems chips. Only the connectors differ; both have the same USB ID. The US_FL_SCM_MULT_TARG quirk is required to use SCSI devices with ID other than 0. I don't have one of these, but based on the other entries for Shuttle/ SCM-based converters this patch is very likely correct. I used 0x0000 and 0x9999 for bcdDeviceMin and bcdDeviceMax because I'm not sure which bcdDevice value the products use. Signed-off-by: Mark Knibbs <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-19USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI AdapterMark1-0/+6
The Adaptec USBConnect 2000 is another SCSI-USB converter which uses Shuttle Technology/SCM Microsystems chips. The US_FL_SCM_MULT_TARG quirk is required to use SCSI devices with ID other than 0. I don't have a USBConnect 2000, but based on the other entries for Shuttle/ SCM-based converters this patch is very likely correct. I used 0x0000 and 0x9999 for bcdDeviceMin and bcdDeviceMax because I'm not sure which bcdDevice value the product uses. Signed-off-by: Mark Knibbs <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-15scsi: don't store LUN bits in CDB[1] for USB mass-storage devicesAlan Stern1-0/+8
The SCSI specification requires that the second Command Data Byte should contain the LUN value in its high-order bits if the recipient device reports SCSI level 2 or below. Nevertheless, some USB mass-storage devices use those bits for other purposes in vendor-specific commands. Currently Linux has no way to send such commands, because the SCSI stack always overwrites the LUN bits. Testing shows that Windows 7 and XP do not store the LUN bits in the CDB when sending commands to a USB device. This doesn't matter if the device uses the Bulk-Only or UAS transports (which virtually all modern USB mass-storage devices do), as these have a separate mechanism for sending the LUN value. Therefore this patch introduces a flag in the Scsi_Host structure to inform the SCSI midlayer that a transport does not require the LUN bits to be stored in the CDB, and it makes usb-storage set this flag for all devices using the Bulk-Only transport. (UAS is handled by a separate driver, but it doesn't really matter because no SCSI-2 or lower device is at all likely to use UAS.) The patch also cleans up the code responsible for storing the LUN value by adding a bitflag to the scsi_device structure. The test for whether to stick the LUN value in the CDB can be made when the device is probed, and stored for future use rather than being made over and over in the fast path. Signed-off-by: Alan Stern <[email protected]> Reported-by: Tiziano Bacocco <[email protected]> Acked-by: Martin K. Petersen <[email protected]> Acked-by: James Bottomley <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-09-11storage: Add single-LUN quirk for Jaz USB AdapterMark1-0/+6
The Iomega Jaz USB Adapter is a SCSI-USB converter cable. The hardware seems to be identical to e.g. the Microtech XpressSCSI, using a Shuttle/ SCM chip set. However its firmware restricts it to only work with Jaz drives. On connecting the cable a message like this appears four times in the log: reset full speed USB device number 4 using uhci_hcd That's non-fatal but the US_FL_SINGLE_LUN quirk fixes it. Signed-off-by: Mark Knibbs <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-11uas: Add missing le16_to_cpu calls to asm1051 / asm1053 usb-id checkHans de Goede1-2/+2
Reported-by: kbuild test robot <[email protected]> Cc: [email protected] # 3.16 Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-10uas: Disable uas on ASM1051 devicesHans de Goede1-4/+23
There are a large numbers of issues with ASM1051 devices in uas mode: 1) They do not support REPORT SUPPORTED OPERATION CODES 2) They use out of spec 8 byte status iu-s when they have no sense data, switching to normal 16 byte status iu-s when they do have sense data. 3) They hang / crash when combined with some disks, e.g. a Crucial M500 ssd. 4) They hang / crash when stressed (through e.g. sg_reset --bus) with disks with which then normally do work (once 1 & 2 are worked around). Where as in BOT mode they appear to work fine, so the best way forward with these devices is to just blacklist them for uas usage. Unfortunately this is easier said then done. as older versions of the ASM1053 (which works fine) use the same usb-id as the ASM1051. When connected over USB-3 the 2 can be told apart by the number of streams they support. So this patch adds some less then pretty code to disable uas for the ASM1051. When connected over USB-2, simply disable uas alltogether for devices with the shared usb-id. Cc: [email protected] # 3.16 Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-08-25USB: storage: add quirk for Newer Technology uSCSI SCSI-USB converterMark1-0/+6
The uSCSI from Newer Technology is a SCSI-USB converter with USB ID 06ca:2003. Like several other SCSI-USB products, it's a Shuttle Technology OEM device. Without a suitable entry in unusual-devs.h, the converter can only access the (single) device with SCSI ID 0. Copying the entry for device 04e6:0002 allows it to work with devices with other SCSI IDs too. There are currently six entries for Shuttle-developed SCSI-USB devices in unusual-devs.h (grep for euscsi): 04e6:0002 Shuttle eUSCSI Bridge USB_SC_DEVICE, USB_PR_DEVICE 04e6:000b Shuttle eUSCSI Bridge USB_SC_SCSI, USB_PR_BULK 04e6:000c Shuttle eUSCSI Bridge USB_SC_SCSI, USB_PR_BULK 050d:0115 Belkin USB SCSI Adaptor USB_SC_SCSI, USB_PR_BULK 07af:0004 Microtech USB-SCSI-DB25 USB_SC_DEVICE, USB_PR_DEVICE 07af:0005 Microtech USB-SCSI-HD50 USB_SC_DEVICE, USB_PR_DEVICE lsusb -v output for the uSCSI lists bInterfaceSubClass 6 SCSI bInterfaceProtocol 80 Bulk (Zip) This patch adds an entry for the uSCSI to unusual_devs.h. Signed-off-by: Mark Knibbs <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-08-06Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds3-9/+9
Pull SCSI updates from James Bottomley: "This patch set consists of the usual driver updates (ufs, storvsc, pm8001 hpsa). It also has removal of the user space target driver code (everyone is using LIO now), a partial PCI MSI-X update, more multi-queue updates, conversion to 64 bit LUNs (so we could theoretically cope with any LUN returned by a device) and placeholder support for the ZBC device type (Shingle drives), plus an assortment of minor updates and bug fixes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (143 commits) scsi: do not issue SCSI RSOC command to Promise Vtrak E610f vmw_pvscsi: Use pci_enable_msix_exact() instead of pci_enable_msix() pm8001: Fix invalid return when request_irq() failed lpfc: Remove superfluous call to pci_disable_msix() isci: Use pci_enable_msix_exact() instead of pci_enable_msix() bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() bfa: Cleanup bfad_setup_intr() function bfa: Do not call pci_enable_msix() after it failed once fnic: Use pci_enable_msix_exact() instead of pci_enable_msix() scsi: use short driver name for per-driver cmd slab caches scsi_debug: support scsi-mq, queues and locks Drivers: add blist flags scsi: ufs: fix endianness sparse warnings scsi: ufs: make undeclared functions static bnx2i: Update driver version to 2.7.10.1 pm8001: fix a memory leak in nvmd_resp pm8001: fix update_flash pm8001: fix a memory leak in flash_update pm8001: Cleaning up uninitialized variables pm8001: Fix to remove null pointer checks that could never happen ...
2014-08-04Merge tag 'usb-3.17-rc1' of ↵Linus Torvalds2-22/+20
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB updates from Greg KH: "Here is the big USB driver update for 3.17-rc1. Loads of gadget driver changes in here, including some big file movements to make things easier to manage over time. There's also the usual xhci and uas driver updates, and a handful of other changes in here. The changelog has the full details. All of these have been in linux-next for a while" * tag 'usb-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (211 commits) USB: devio: fix issue with log flooding uas: Log a warning when we cannot use uas because the hcd lacks streams uas: Only complain about missing sg if all other checks succeed xhci: Add missing checks for xhci_alloc_command failure xhci: Rename Asrock P67 pci product-id to EJ168 xhci: Blacklist using streams on the Etron EJ168 controller uas: Limit qdepth to 32 when connected over usb-2 uwb/whci: use correct structure type name in sizeof usb-core bInterval quirk USB: serial: ftdi_sio: Add support for new Xsens devices USB: serial: ftdi_sio: Annotate the current Xsens PID assignments usb: chipidea: debug: fix sparse non static symbol warnings usb: ci_hdrc_imx doc: fsl,usbphy is required usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY usb: core: allow zero packet flag for interrupt urbs usb: lvstest: Fix sparse warnings generated by kbuild test bot USB: core: hcd-pci: free IRQ before disabling PCI device when shutting down phy: miphy365x: Represent each PHY channel as a DT subnode phy: miphy365x: Provide support for the MiPHY356x Generic PHY phy: miphy365x: Add Device Tree bindings for the MiPHY365x ...
2014-08-01uas: Log a warning when we cannot use uas because the hcd lacks streamsHans de Goede1-3/+9
So that an user who wants to use uas can see why he is not getting uas. Also move the check down so that we don't warn if there are other reasons why uas cannot work. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-08-01uas: Only complain about missing sg if all other checks succeedHans de Goede1-18/+10
Don't complain about controllers without sg support if there are other reasons why uas cannot be used anyways. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-08-01uas: Limit qdepth to 32 when connected over usb-2Hans de Goede1-1/+1
Some jmicron uas chipsets act up (they disconnect from the bus) when sending more then 32 commands to them at once. Rather then building an ever growing list with usb-id based quirks for devices using this chipset, simply reduce the qdepth to 32 when connected over usb-2. 32 should be plenty to keep things close to maximum possible throughput on usb-2. Cc: [email protected] Tested-and-reported-by: Laszlo T. <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-07-23staging: keucr: remove driverKristina Martšenko2-3/+3
The driver hasn't been fully cleaned up and it doesn't look like anyone is working on it anymore (including the original author). So remove the driver and all references to it. If someone wants to finish cleaning the driver up and moving it out of staging, this commit can be reverted. Signed-off-by: Kristina Martšenko <[email protected]> Cc: Cho, Yu-Chen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-07-17scsi: use 64-bit LUNsHannes Reinecke2-6/+8
The SCSI standard defines 64-bit values for LUNs, and large arrays employing large or hierarchical LUN numbers become more and more common. So update the linux SCSI stack to use 64-bit LUN numbers. Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Ewan Milne <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-17scsi: Remove CONFIG_SCSI_MULTI_LUNHannes Reinecke1-3/+1
Obsolete; either use 'max_lun' if the host supports only a limited number of LUNs or BLIST_NOLUN if the target has problems addressing more than one LUN. Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Ewan Milne <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-06-30usb-storage/SCSI: Add broken_fua blacklist flagAlan Stern2-0/+11
Some buggy JMicron USB-ATA bridges don't know how to translate the FUA bit in READs or WRITEs. This patch adds an entry in unusual_devs.h and a blacklist flag to tell the sd driver not to use FUA. Signed-off-by: Alan Stern <[email protected]> Reported-by: Michael Büsch <[email protected]> Tested-by: Michael Büsch <[email protected]> Acked-by: James Bottomley <[email protected]> CC: Matthew Dharm <[email protected]> CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-27USB: storage: ene_ub6250: Use kmemdup instead of kmalloc + memcpyBenoit Taine1-2/+1
This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci Signed-off-by: Benoit Taine <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-03USB: Nokia 5300 should be treated as unusual devDaniele Forsi1-0/+7
Signed-off-by: Daniele Forsi <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-03USB: Nokia 305 should be treated as unusual devVictor A. Santos1-0/+7
Signed-off-by: Victor A. Santos <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-03usb: storage: shuttle_usbat: fix discs being detected twiceDaniele Forsi1-1/+1
Even if the USB-to-ATAPI converter supported multiple LUNs, this driver would always detect the same physical device or media because it doesn't use srb->device->lun in any way. Tested with an Hewlett-Packard CD-Writer Plus 8200e. Signed-off-by: Daniele Forsi <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-04-16uas: fix deadlocky memory allocationsOliver Neukum1-2/+2
There are also two allocations with GFP_KERNEL in the pre-/post_reset code paths. That is no good because that is a part of the SCSI error handler. Signed-off-by: Oliver Neukum <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Acked-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-04-16uas: fix error handling during scsi_scan()Oliver Neukum1-1/+2
intfdata is set only after scsi_scan(). uas_pre_reset() however needs intfdata to be valid and will follow the NULL pointer killing khubd. intfdata must be preemptively set before the host is registered and undone in the error case. Signed-off-by: Oliver Neukum <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Acked-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-04-16uas: fix GFP_NOIO under spinlockOliver Neukum1-3/+3
Quote Dan: The patch e36e64930cff: "uas: Use GFP_NOIO rather then GFP_ATOMIC where possible" from Nov 7, 2013, leads to the following static checker warning: drivers/usb/storage/uas.c:806 uas_eh_task_mgmt() error: scheduling with locks held: 'spin_lock:lock' Some other allocations under spinlock are not caught. The fix essentially reverts e36e64930cffd94e1c37fdb82f35989384aa946b Signed-off-by: Oliver Neukum <[email protected]> Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Acked-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-03-04storage: accept some UAS devices if streams are unavailableOliver Neukum1-0/+4
On some older XHCIs streams are not supported and the UAS driver will fail at probe time. For those devices storage should try to bind to UAS devices. This patch adds a flag for stream support to HCDs and evaluates it. [Note: Sarah fixed a bug where the USB 2.0 root hub, not USB 3.0 root hub would get marked as being able to support streams.] Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Sarah Sharp <[email protected]> Acked-by: Hans de Goede <[email protected]>
2014-03-04uas: Remove comment about registering a uas scsi controller for each usb busHans de Goede1-6/+0
Although an interesting concept, I don't think that this is a good idea: -This will result in lots of "virtual" scsi controllers confusing users -If we get a scsi-bus-reset we will now need to do a usb-device-reset of all uas devices on the same usb bus, which is something to avoid if possible Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Add Hans de Goede as uas maintainerHans de Goede1-1/+3
At the kernel-summit Sarah Sharp asked me if I was willing to become the uas maintainer. I said yes, and here is a patch to make this official. Also remove Matthew Wilcox and Sarah Sharp as maintainers at their request. I've also added myself to the module's author tag, so that if people look there rather then in maintainers they will know they should bug me about uas too. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: remove BROKENGerd Hoffmann1-1/+1
xhci streams support is fixed, unblock usb attached scsi. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Make sure sg elements are properly alignedHans de Goede1-0/+18
Copy the sg alignment trick from the usb-storage driver, without this I'm seeing intermittent errors when using uas devices with an ehci controller. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Add some data in/out ready iu sanity checksHans de Goede1-0/+10
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Improve error reportingHans de Goede1-14/+46
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Use the right error codes for different kinds of errorsHans de Goede1-9/+10
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Clear cmdinfo on command queue-ingHans de Goede1-0/+2
The scsi error handling path re-uses previously queued up (and errored-out) cmds. If such a re-used cmd had a data-phase then cmdinfo will have data_in_urb / data_out_urb still set to the free-ed urbs from the errored-out cmd, and they will get free-ed a second time when the error handling cmd completes, corrupting the kernel heap. Clearing cmdinfo on command queue-ing fixes this, and seems like a good idea in general. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Fix memory managementHans de Goede1-19/+14
The scsi-host structure is refcounted, scsi_remove_host tears down the scsi-host but does not decrement the refcount, so we need to call scsi_put_host on disconnect to get the underlying memory to be freed. After calling scsi_remove_host, the scsi-core may still hold a reference to the scsi-host, iow we may still get called after uas_disconnect, but we do our own life cycle management of uas_devinfo, freeing it on disconnect, and thus may end up using devinfo after it has been freed. Switch to letting scsi_host_alloc allocate and manage the memory for us. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Fix command / task mgmt submission racing with disconnectHans de Goede1-1/+14
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: cmdinfo: use only one list headHans de Goede1-12/+8
cmds are either on the inflight list or on the dead list, never both, so we only need one list head. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: add uas_mark_cmd_dead helper functionHans de Goede1-17/+18
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Properly complete inflight commands on bus-reset or disconnectHans de Goede1-20/+21
Before this commit the uas driver would keep track of scsi commands which still need to have some urbs submitted to the device, and complete this with an ABORT result code on bus-reset or disconnect, but in flight scsi commands which have all their urbs submitted, and thus are not part of the work list, would never get their done callback called. The problem is killed sense urbs don't have any tag info, so it is impossible to tell which scsi cmd they belong to, so merely making sure all the urbs have completed one way or the other is not enough. This commit fixes this by changing the work list to an inflight list, which keeps tracks of all inflight scsi cmnds, using the IS_IN_WORK_LIST flag to determine if actual work needs to be done in uas_do_work(), and by moving marking all inflight scsi commands as aborted and moving them to the dead list on bus-reset or disconnect. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: uas_alloc_data_urb: Remove unnecessary use_streams checkHans de Goede1-2/+1
uas_alloc_data_urb always gets called with a stream_id value of 0 when not using streams. Removing the check makes it consistent with uas_alloc_sense_urb. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Fix task-management not working when connected over USB-2Hans de Goede1-1/+2
For USB-2 connections the stream-id must always be 0. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Reset device on rebootHans de Goede1-0/+30
Some BIOS-es will hang on reboot when an uas device is attached and left in uas mode on reboot. This commit adds a shutdown handler which on reboot puts the device back into usb-storage mode, fixing the hang on reboot on these systems. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Add suspend/resume supportHans de Goede1-0/+42
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Use GFP_NOIO rather then GFP_ATOMIC where possibleHans de Goede1-3/+3
We can sleep in our own workqueue (which is the whole reason for having it), and scsi error handlers are also always called from a context which may sleep. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Don't allow more then one task to run at the same timeHans de Goede1-5/+34
Since we use a fixed tag / stream for tasks we cannot allow more then one to run at the same time. This could happen before this time if a task timed out. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: task_mgmt: Kill the sense-urb if we fail to submit the cmd urbHans de Goede1-11/+13
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>