aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/storage/usb.c
AgeCommit message (Collapse)AuthorFilesLines
2024-04-11scsi: core: Add a no_highmem flag to struct Scsi_HostChristoph Hellwig1-0/+10
While we really should be killing the block layer bounce buffering ASAP, I even more urgently need to stop the drivers to fiddle with the limits from ->slave_configure. Add a no_highmem flag to the Scsi_Host to centralize this setting and switch the remaining four drivers that use block layer bounce buffering to it. Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2023-10-21usb-storage,uas: make internal quirks flags 64bitMilan Broz1-4/+4
Switch internal usb-storage quirk value to 64-bit as quirks currently use all 32 bits. Signed-off-by: Milan Broz <[email protected]> Reviewed-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-10-21usb-storage: remove UNUSUAL_VENDOR_INTF macroMilan Broz1-12/+0
This patch removes macro that was used only by commit that was reverted in commit ab4b71644a26 ("USB: storage: fix Huawei mode switching regression") Signed-off-by: Milan Broz <[email protected]> Reviewed-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-03-24scsi: usb: uas: Declare two host templates and host template pointers constBart Van Assche1-1/+1
Improve source code documentation by constifying host templates that are not modified. Acked-by: Alan Stern <[email protected]> (for usb-storage) Acked-by: Oliver Neukum <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: [email protected] Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2022-02-07scsi: usb: storage: Complete the SCSI request directlySebastian Andrzej Siewior1-1/+1
The USB storage driver can complete its requests directly from a kernel thread. Use scsi_done_direct() to avoid waking ksoftirqd. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: usb: Call scsi_done() directlyBart Van Assche1-2/+2
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2020-12-09USB: UAS: introduce a quirk to set no_write_sameOliver Neukum1-0/+3
UAS does not share the pessimistic assumption storage is making that devices cannot deal with WRITE_SAME. A few devices supported by UAS, are reported to not deal well with WRITE_SAME. Those need a quirk. Add it to the device that needs it. Reported-by: David C. Partridge <[email protected]> Signed-off-by: Oliver Neukum <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-12-04Revert "usb-storage: fix sdev->host->dma_dev"Greg Kroah-Hartman1-3/+2
This reverts commit 0154012f8018bba4d9971d1007c12ffd48539ddb as Hans reports it causes problems on some systems. Until a "real" fix for this can be found, revert this change to get normal functionality back. Link: https://lore.kernel.org/r/[email protected] Cc: Tom Yan <[email protected]> Cc: Alan Stern <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-04usb-storage: fix sdev->host->dma_devTom Yan1-2/+3
Use scsi_add_host_with_dma() instead of scsi_add_host(). When the scsi request queue is initialized/allocated, hw_max_sectors is clamped to the dma max mapping size. Therefore, the correct device that should be used for the clamping needs to be set. The same clamping is still needed in usb-storage as hw_max_sectors could be changed there. The original clamping would be invalidated in such cases. Signed-off-by: Tom Yan <[email protected]> Reviewed-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-02-19usb-storage: Use const to reduce object data sizeJoe Perches1-5/+5
Make structs const to reduce data size ~20KB. Change function arguments and prototypes as necessary to compile. $ size (x86-64 defconfig pre) text data bss dec hex filename 12281 10948 480 23709 5c9d ./drivers/usb/storage/usb.o 111 10528 8 10647 2997 ./drivers/usb/storage/usual-tables.o $ size (x86-64 defconfig post) text data bss dec hex filename 22809 420 480 23709 5c9d drivers/usb/storage/usb.o 10551 0 0 10551 2937 drivers/usb/storage/usual-tables.o Signed-off-by: Joe Perches <[email protected]> Acked-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-23USB: storage: remove invalid URL from driversGreg Kroah-Hartman1-3/+0
The old URL for usb-storage driver help is long gone. So remove it from the comments to not confuse people anymore. Reported-by: Matthew Dharm <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-12-06USB: storage: Remove obsolete "FIXME"Mikhail Zaytsev1-4/+4
The fix of "FIXME: Notify the subdrivers..." doesn't actually have any real effect. The "FIXME" changed to simple comment. Signed-off-by: Mikhail Zaytsev <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-04USB: storage: Remove redundant license textGreg Kroah-Hartman1-14/+0
Now that the SPDX tag is in all USB files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-04USB: add SPDX identifiers to all remaining files in drivers/usb/Greg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/usb/ and include/linux/usb* files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner <[email protected]> Cc: Kate Stewart <[email protected]> Cc: Philippe Ombredanne <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Acked-by: Felipe Balbi <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-01usb-storage: make use of srb local variableAlan Stern1-17/+17
Commit 8b52291a0743 ("usb-storage: fix deadlock involving host lock and scsi_done") added a local variable to usb_stor_control_thread() in the usb-storage driver. This local variable holds the value of us->srb, for use after the host lock has been released. But as long as we have the value in a local variable, we may as well use it instead of dereferencing the us pointer all over the place. This patch makes no functional change; it just makes the code a little shorter and a little neater. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-30usb-storage: fix deadlock involving host lock and scsi_doneAlan Stern1-6/+12
Christoph Hellwig says that since version 4.12, the kernel switched to using blk-mq by default. The old code used a softirq for handling request completions, but blk-mq can handle completions in the caller's context. This may cause a problem for usb-storage, because it invokes the ->scsi_done callback while holding the host lock, and the completion routine sometimes tries to acquire the same lock (when running the error handler, for example). The consequence is that the existing code will sometimes deadlock upon error completion of a SCSI command (with a lockdep warning). This is easy enough to fix, since usb-storage doesn't really need to hold the host lock while the callback runs. It was simpler to write it that way, but moving the call outside the locked region is pretty easy and there's no downside. That's what this patch does. Signed-off-by: Alan Stern <[email protected]> Reported-and-tested-by: Arthur Marsh <[email protected]> CC: Christoph Hellwig <[email protected]> CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-03-23USB: storage: refactor endpoint retrievalJohan Hovold1-27/+13
Use the new endpoint helpers to lookup the required bulk-in and bulk-out endpoints and the (typically) optional interrupt-in endpoint. Cc: [email protected] Signed-off-by: Johan Hovold <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-07usb: storage: drop freezer.h usageGreg Kroah-Hartman1-1/+0
usb-storage does not use any freezer apis, so drop the inclusion of freezer.h from the drivers/usb/storage/usb.c file. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-09-13scsi: introduce a quirk for false cache reportingOliver Neukum1-1/+5
Some SATA to USB bridges fail to cooperate with some drives resulting in no cache being present being reported to the host. That causes the host to skip sending a command to synchronize caches. That causes data loss when the drive is powered down. Signed-off-by: Oliver Neukum <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-08-15usb: storage: usb: don't print error when allocating urb failsWolfram Sang1-3/+1
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-08-09usb: storage: fix runtime pm issue in usb_stor_probe2Heiner Kallweit1-2/+4
Since commit 71723f95463d "PM / runtime: print error when activating a child to unactive parent" I see the following error message: scsi host2: usb-storage 1-3:1.0 scsi host2: runtime PM trying to activate child device host2 but parent (1-3:1.0) is not active Digging into it it seems to be related to the problem described in the commit message for cd998ded5c12 "i2c: designware: Prevent runtime suspend during adapter registration" as scsi_add_host also calls device_add and after the call to device_add the parent device is suspended. Fix this by using the approach from the mentioned commit and getting the runtime pm reference before calling scsi_add_host. Signed-off-by: Heiner Kallweit <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-04-26usb: storage: fix multi-line comment styleFelipe Balbi1-35/+63
No functional changes here, just making sure our storage driver uses a consistent multi-line comment style. Signed-off-by: Felipe Balbi <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-04-13USB: uas: Add a new NO_REPORT_LUNS quirkHans de Goede1-1/+4
Add a new NO_REPORT_LUNS quirk and set it for Seagate drives with an usb-id of: 0bc2:331a, as these will fail to respond to a REPORT_LUNS command. Cc: [email protected] Reported-and-tested-by: David Webb <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-05-10usb: storage: fix module reference for scsi hostAkinobu Mita1-5/+11
While accessing a unusual usb storage (ums-alauda, ums-cypress, ...), the module reference count is not incremented. Because these drivers allocate scsi hosts with usb_stor_host_template defined in usb-storage module. So these drivers always can be unloaded. This fixes it by preparing scsi host template which is initialized at module_init() for each ums-* driver. In order to minimize the difference in ums-* drivers, introduce module_usb_stor_driver() helper macro which is same as module_usb_driver() except that it also initializes scsi host template. Signed-off-by: Akinobu Mita <[email protected]> Cc: Vinayak Holikatti <[email protected]> Cc: Dolev Raviv <[email protected]> Cc: Sujit Reddy Thumma <[email protected]> Cc: Subhash Jadavani <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Matthew Dharm <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-04-28uas: Add US_FL_MAX_SECTORS_240 flagHans de Goede1-1/+5
The usb-storage driver sets max_sectors = 240 in its scsi-host template, for uas we do not want to do that for all devices, but testing has shown that some devices need it. This commit adds a US_FL_MAX_SECTORS_240 flag for such devices, and implements support for it in uas.c, while at it it also adds support for US_FL_MAX_SECTORS_64 to uas.c. Cc: [email protected] # 3.16 Signed-off-by: Hans de Goede <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-04-28uas: Allow uas_use_uas_driver to return usb-storage flagsHans de Goede1-1/+1
uas_use_uas_driver may set some US_FL_foo flags during detection, currently these are stored in a local variable and then throw away, but these may be of interest to the caller, so add an extra parameter to (optionally) return the detected flags, and use this in the uas driver. Cc: [email protected] # 3.16 Signed-off-by: Hans de Goede <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-02-24usb-storage: support for more than 8 LUNsOliver Neukum1-0/+6
This is necessary to make some storage arrays work. Some storage devices have more than 8 LUNs. In addition you can hook up a WideSCSI bus to USB. In these cases even level 2 devices can have more than 8 LUNs. For them it is necessary to simply believe the class specific command and report its result back to the SCSI layer. Off by one Alan noticed is fixed. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-24storage: Fix bus scan and multi-LUN support for SCM eUSCSI devicesMark Knibbs1-12/+24
This patch does two things for SCM eUSCSI USB-SCSI converters: 1. SCM eUSCSI bridge devices are hard-wired to use SCSI ID 7. On connecting the converter, access to that ID is attempted during the bus scan. Asking the converter to issue INQUIRY commands to itself isn't very polite and wastes time. Set this_id to 7 so __scsi_scan_target() skips it in the scan. 2. Enable multi-LUN support. eUSCSI devices don't support Get Max LUN requests, returning an error (-32). [Different targets could have different numbers of LUNs, so it wouldn't make sense to return a particular value in response to Get Max LUN.] usb_stor_scan_dwork() does this: /* For bulk-only devices, determine the max LUN value */ if (us->protocol == USB_PR_BULK && !(us->fflags & US_FL_SINGLE_LUN)) { mutex_lock(&us->dev_mutex); us->max_lun = usb_stor_Bulk_max_lun(us); mutex_unlock(&us->dev_mutex); It avoids calling usb_stor_Bulk_max_lun() if US_FL_SINGLE_LUN, but not for US_FL_SCM_MULT_TARG. Since usb_stor_Bulk_max_lun() returns 0 in the error case, us->max_lun was always set to 0. [If the user doesn't want multi-LUN support (perhaps there are SCSI devices which respond to commands on all LUNs?), the US_FL_SINGLE_LUN quirk can be specified on the kernel command line.] Signed-off-by: Mark Knibbs <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-10-08Merge tag 'usb-3.18-rc1' of ↵Linus Torvalds1-2/+9
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB updates from Greg KH: "Here's the big USB patchset for 3.18-rc1. Also in here is the PHY tree, as it seems to fit well with the USB tree for various reasons... Anyway, lots of little changes in here, all over the place, full details in the changelog All have been in the linux-next tree for a while with no issues" * tag 'usb-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (244 commits) USB: host: st: fix typo 'CONFIG_USB_EHCI_HCD_ST' uas: Reduce number of function arguments for uas_alloc_foo functions xhci: Allow xHCI drivers to be built as separate modules xhci: Export symbols used by host-controller drivers xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold xhci: Introduce xhci_init_driver() usb: hcd: add generic PHY support usb: rename phy to usb_phy in HCD usb: gadget: uvc: fix up uvcg_v4l2_get_unmapped_area typo USB: host: st: fix ehci/ohci driver selection usb: host: ehci-exynos: Remove unnecessary usb-phy support usb: core: return -ENOTSUPP for all targeted hosts USB: Remove .owner field for driver usb: core: log higher level message on malformed LANGID descriptor usb: Add LED triggers for USB activity usb: Rename usb-common.c usb: gadget: Refactor request completion usb: gadget: Introduce usb_gadget_giveback_request() usb: dwc2/gadget: move phy bus legth initialization phy: remove .owner field for drivers using module_platform_driver ...
2014-09-23usb: Fixed a few typosMickael Maison1-1/+1
Fixed typos in comments of various drivers/usb files Signed-off-by: Mickael Maison <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-23uas: Add no-report-opcodes quirkHans de Goede1-1/+4
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 Goede1-1/+5
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-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-07-17scsi: use 64-bit LUNsHannes Reinecke1-4/+6
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-03-04usb-storage: Modify and export adjust_quirks so that it can be used by uasHans de Goede1-6/+10
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04usb-storage: Don't bind to uas devices if the uas driver is enabledHans de Goede1-0/+10
uas devices have 2 alternative settings on their usb-storage interface, one for usb-storage and one for uas. Using the uas driver is preferred, so if the uas driver is enabled, and the device has an uas alt setting, don't bind. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-01-08usb: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-04-19USB: storage: convert to use module_usb_driver()Greg Kroah-Hartman1-29/+1
Now that Joe cleaned up the init/exit functions, we can just get rid of them entirely and use the proper macro that almost all other USB drivers now use. Cc: Matthew Dharm <[email protected]> Cc: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-04-19usb: storage: Convert US_DEBUGP to usb_stor_dbgJoe Perches1-57/+36
Use a more current logging style with dev_printk where possible. o Convert uses of US_DEBUGP to usb_stor_dbg o Add "struct us_data *" to usb_stor_dbg uses o usb_stor_dbg now uses struct device */dev_vprint_emit o Removed embedded function names o Coalesce formats o Remove trailing whitespace o Remove useless OOM messages o Remove useless function entry/exit logging o Convert some US_DEBUGP uses to dev_info and dev_dbg Object size is slightly reduced when debugging is enabled, slightly increased with no debugging because some initialization and removal messages are now always emitted. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-02-08Merge usb-linus branch into usb-nextGreg Kroah-Hartman1-0/+12
This pulls in a bunch of fixes that are in Linus's tree because we need them here for testing and development. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-02-04USB: storage: Define a new macro for USB storage match rulesfangxiaozhi1-0/+12
1. Define a new macro for USB storage match rules: matching with Vendor ID and interface descriptors. Signed-off-by: fangxiaozhi <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-20USB: storage: avoid scanning other targets for single target deviceMing Lei1-0/+3
This patch sets scsi_host->max_id as 1 if the device's quirk flag of US_FL_SCM_MULT_TARG isn't set, because there are only 6 mass storage devices marked as mutiple targets from unusual_devs.h. This patch is a small optimization about scanning targets, and avoid scanning other 7 non-existed targets for single target device. Signed-off-by: Ming Lei <[email protected]> Acked-by: Alan Stern <[email protected]> Acked-by: Matthew Dharm <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-26usb: storage: remove redundant memset() in usb_probe_stor1()Yan Hong1-1/+0
scsi_host_alloc() will zero our private data, no need to memset it. Signed-off-by: Yan Hong <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-05usb: remove libusualSebastian Andrzej Siewior1-12/+5
The "Low Performance USB Block driver" has been removed which a user of libusual. Now we have only the usb-storage driver as the only driver in tree. This makes libusual needless. This patch removes libusal, fixes up all users. The usual-table is now linked into usb-storage. usb_usual.h remains in public include directory because some staging users seem to need it. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-20[SCSI] usb-storage: add support for write cache quirkNamjae Jeon1-1/+4
Add support for write cache quirk on usb hdd. scsi driver will be set to wce by detecting write cache quirk in quirk list when plugging usb hdd. Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Pankaj Kumar <[email protected]> Signed-off-by: Amit Sahrawat <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-05-17USB: storage: fixed keyword related space issues.Jeffrin Jose1-2/+2
Fixed keyword related space issues found by checkpatch.pl tool in drivers/usb/storage/usb.c Signed-off-by: Jeffrin Jose <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-17USB: storage: fixed several trailing white spaces issues.Jeffrin Jose1-9/+9
Fixed several trailing white spaces issues found by checkpatch.pl tool in drivers/usb/storage/usb.c Signed-off-by: Jeffrin Jose <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-17USB: storage: fixed C99 comment issue.Jeffrin Jose1-1/+1
Fixed C99 comment issue in drivers/usb/storage/usb.c found using checkpatch.pl tool. Signed-off-by: Jeffrin Jose <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-04-06usb: storage: fix lockdep warning inside usb_stor_pre_reset(v2)Ming Lei1-0/+30
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: Dave Jones <[email protected]> Signed-off-by: Ming Lei <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-02-23Merge branch 'usb-3.3-rc4' into usb-nextGreg Kroah-Hartman1-3/+18
This is to pull in the xhci changes and the other fixes and device id updates that were done in Linus's tree. Signed-off-by: Greg Kroah-Hartman <[email protected]>