aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/storage
AgeCommit message (Collapse)AuthorFilesLines
2013-03-15driver: usb: storage: remove cast for kmalloc return valueZhang Yanfei1-2/+1
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei <[email protected]> Cc: Matthew Dharm <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Andrew Morton <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-03-15usb: storage: onetouch: tighten a range checkDan Carpenter1-2/+2
Smatch complains because we only allocate ONETOUCH_PKT_LEN (2) bytes but later when we call usb_fill_int_urb() we assume maxp can be up to 8 bytes. I talked to the maintainer and maxp should be capped at ONETOUCH_PKT_LEN. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-03-07USB: storage: fix Huawei mode switching regressionBjørn Mork3-78/+331
This reverts commit 200e0d99 ("USB: storage: optimize to match the Huawei USB storage devices and support new switch command" and the followup bugfix commit cd060956 ("USB: storage: properly handle the endian issues of idProduct"). The commit effectively added a large number of Huawei devices to the deprecated usb-storage mode switching logic. Many of these devices have been in use and supported by the userspace usb_modeswitch utility for years. Forcing the switching inside the kernel causes a number of regressions as a result of ignoring existing onfigurations, and also completely takes away the ability to configure mode switching per device/system/user. Known regressions caused by this: - Some of the devices support multiple modes, using different switching commands. There are existing configurations taking advantage of this. - There is a real use case for disabling mode switching and instead mounting the exposed storage device. This becomes impossible with switching logic inside the usb-storage driver. - At least on device fail as a result of the usb-storage switching command, becoming completely unswitchable. This is possibly a firmware bug, but still a regression because the device work as expected using usb_modeswitch defaults. In-kernel mode switching was deprecated years ago with the development of the more user friendly userspace alternatives. The existing list of devices in usb-storage was only kept to prevent breaking already working systems. The long term plan is to remove the list, not to add to it. Ref: http://permalink.gmane.org/gmane.linux.usb.general/28543 Cc: <[email protected]> Cc: stable <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-03-07USB: storage: in-kernel modeswitching is deprecatedBjørn Mork1-0/+8
Acked-by: Matthew Dharm <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-02-14USB: usb-storage: unusual_devs update for Super TOP SATA bridgeJosh Boyer1-1/+1
The current entry in unusual_cypress.h for the Super TOP SATA bridge devices seems to be causing corruption on newer revisions of this device. This has been reported in Arch Linux and Fedora. The original patch was tested on devices with bcdDevice of 1.60, whereas the newer devices report bcdDevice as 2.20. Limit the UNUSUAL_DEV entry to devices less than 2.20. This fixes https://bugzilla.redhat.com/show_bug.cgi?id=909591 The Arch Forum post on this is here: https://bbs.archlinux.org/viewtopic.php?id=152011 Reported-by: Carsten S. <[email protected]> Tested-by: Carsten S. <[email protected]> Cc: stable <[email protected]> Signed-off-by: Josh Boyer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-02-08USB: storage: properly handle the endian issues of idProductfangxiaozhi1-2/+2
1. The idProduct is little endian, so make sure its value to be compatible with the current CPU. Make no break on big endian processors. Signed-off-by: fangxiaozhi <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-02-08Merge usb-linus branch into usb-nextGreg Kroah-Hartman5-331/+105
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: optimize to match the Huawei USB storage devices and support ↵fangxiaozhi3-331/+78
new switch command 1. Optimize the match rules with new macro for Huawei USB storage devices, to avoid to load USB storage driver for the modem interface with Huawei devices. 2. Add to support new switch command for new Huawei USB dongles. Signed-off-by: fangxiaozhi <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-02-04USB: storage: Define a new macro for USB storage match rulesfangxiaozhi2-0/+27
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-25usb-uas: set max_lun and max_channelGerd Hoffmann1-0/+2
256 luns is what the sam-4 address method 0 can handle and what the qemu uas emulation supports. So pick that for now. [ v2: unlike the other two max_* fields max_channel isn't max+1 ] Signed-off-by: Gerd Hoffmann <[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]>
2013-01-11uas: fail any request submitted while resetting the device.Gerd Hoffmann1-0/+6
Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-11uas: improve device resetGerd Hoffmann1-1/+44
Add new function to unlink and abort requests from the work list, call it on bus reset and disconnect where we kill all in-flight urbs. Also reorder calls in disconnect to first cancel transfers, then remove the scsi hba. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-11uas: improve abort handlerGerd Hoffmann1-2/+17
Two changes. First we check whenever the request is linked in the work list and if so take it out. Second check whenever the command is actually in flight before asking the device to cancel it via task management, and in case it isn't just zap the data urbs and finish it. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-11uas: add IS_IN_WORK_LIST flagGerd Hoffmann1-2/+8
Keep track whenever the request is linked into the work list or not. Needed for request abort. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-11uas: add UNLINK_DATA_URBS flagGerd Hoffmann1-3/+21
uas_unlink_data_urbs uses this to make sure the the scsi command is not released while looking at it. This will be needed when we start calling uas_unlink_data_urbs in the request cancel code paths. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-11uas: new function to cancel data urbsGerd Hoffmann1-10/+12
Add uas_unlink_data_urbs function to cancel in-flight data urbs. Moves existing code into a separate function. [ v2: also drop the locking, just call usb_unlink_urb no matter what, which is safe because the usb core guarantees the completion callback is called only once ] Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-12-13Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial branch from Jiri Kosina: "Usual stuff -- comment/printk typo fixes, documentation updates, dead code elimination." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits) HOWTO: fix double words typo x86 mtrr: fix comment typo in mtrr_bp_init propagate name change to comments in kernel source doc: Update the name of profiling based on sysfs treewide: Fix typos in various drivers treewide: Fix typos in various Kconfig wireless: mwifiex: Fix typo in wireless/mwifiex driver messages: i2o: Fix typo in messages/i2o scripts/kernel-doc: check that non-void fcts describe their return value Kernel-doc: Convention: Use a "Return" section to describe return values radeon: Fix typo and copy/paste error in comments doc: Remove unnecessary declarations from Documentation/accounting/getdelays.c various: Fix spelling of "asynchronous" in comments. Fix misspellings of "whether" in comments. eisa: Fix spelling of "asynchronous". various: Fix spelling of "registered" in comments. doc: fix quite a few typos within Documentation target: iscsi: fix comment typos in target/iscsi drivers treewide: fix typo of "suport" in various comments and Kconfig treewide: fix typo of "suppport" in various comments ...
2012-12-11Merge tag 'usb-3.8-rc1' of ↵Linus Torvalds3-3/+2
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB patches from Greg Kroah-Hartman: "Here's the big set of USB patches for 3.8-rc1. Lots of USB host driver cleanups in here, and a bit of a reorg of the EHCI driver to make it easier for the different EHCI platform drivers to all work together nicer, which was a reduction in overall code. We also deleted some unused firmware files, and got rid of the very old file_storage usb gadget driver that had been broken for a long time. This means we ended up removing way more code than added, always a nice thing to see: 310 files changed, 3028 insertions(+), 10754 deletions(-) Other than that, the usual set of new device ids, driver fixes, gadget driver and controller updates and the like. All of these have been in the linux-next tree for a number of weeks. Signed-off-by: Greg Kroah-Hartman <[email protected]>" * tag 'usb-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (228 commits) USB: mark uas driver as BROKEN xhci: Add Lynx Point LP to list of Intel switchable hosts uwb: fix uwb_dev_unlock() missed at an error path in uwb_rc_cmd_async() USB: ftdi_sio: Add support for Newport AGILIS motor drivers MAINTAINERS: remove drivers/block/ub.c USB: chipidea: fix use after free bug ezusb: add dependency to USB usb: ftdi_sio: fixup BeagleBone A5+ quirk USB: cp210x: add Virtenio Preon32 device id usb: storage: remove redundant memset() in usb_probe_stor1() USB: option: blacklist network interface on Huawei E173 USB: OHCI: workaround for hardware bug: retired TDs not added to the Done Queue USB: add new zte 3g-dongle's pid to option.c USB: opticon: switch to generic read implementation USB: opticon: refactor reab-urb processing USB: opticon: use usb-serial bulk-in urb USB: opticon: increase bulk-in size USB: opticon: use port as urb context USB: opticon: pass port to get_serial_info USB: opticon: make private data port specific ...
2012-11-28USB: mark uas driver as BROKENGreg KH1-1/+1
As reported https://bugzilla.kernel.org/show_bug.cgi?id=51031, the UAS driver causes problems and has been asked to be not built into any of the major distributions. To prevent users from running into problems with it, and for distros that were not notified, just mark the whole thing as broken. Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Acked-by: Sarah Sharp <[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-11-19Fix misspellings of "whether" in comments.Adam Buchbinder1-1/+1
"Whether" is misspelled in various comments across the tree; this fixes them. No code changes. Signed-off-by: Adam Buchbinder <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2012-11-13[SCSI] sd: Implement support for WRITE SAMEMartin K. Petersen1-0/+3
Implement support for WRITE SAME(10) and WRITE SAME(16) in the SCSI disk driver. - We set the default maximum to 0xFFFF because there are several devices out there that only support two-byte block counts even with WRITE SAME(16). We only enable transfers bigger than 0xFFFF if the device explicitly reports MAXIMUM WRITE SAME LENGTH in the BLOCK LIMITS VPD. - max_write_same_blocks can be overriden per-device basis in sysfs. - The UNMAP discovery heuristics remain unchanged but the discard limits are tweaked to match the "real" WRITE SAME commands. - In the error handling logic we now distinguish between WRITE SAME with and without UNMAP set. The discovery process heuristics are: - If the device reports a SCSI level of SPC-3 or greater we'll issue READ SUPPORTED OPERATION CODES to find out whether WRITE SAME(16) is supported. If that's the case we will use it. - If the device supports the block limits VPD and reports a MAXIMUM WRITE SAME LENGTH bigger than 0xFFFF we will use WRITE SAME(16). - Otherwise we will use WRITE SAME(10) unless the target LBA is beyond 0xFFFFFFFF or the block count exceeds 0xFFFF. - no_write_same is set for ATA, FireWire and USB. Signed-off-by: Martin K. Petersen <[email protected]> Reviewed-by: Mike Snitzer <[email protected]> Reviewed-by: Jeff Garzik <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-11-13[SCSI] Add a report opcode helperMartin K. Petersen1-0/+3
The REPORT SUPPORTED OPERATION CODES command can be used to query whether a given opcode is supported by a device. Add a helper function that allows us to look up commands. We only issue RSOC if the device reports compliance with SPC-3 or later. But to err on the side of caution we disable the command for ATA, FireWire and USB. Signed-off-by: Martin K. Petersen <[email protected]> Acked-by: Mike Snitzer <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-10-30USB: ums_realtek: fix build warningJingoo Han1-1/+1
When rts51x_read_status() returns USB_STOR_TRANSPORT_ERROR, an error happens. This patch fixes build warning as below: drivers/usb/storage/realtek_cr.c: In function 'init_realtek_cr': drivers/usb/storage/realtek_cr.c:476:33: warning: 'buf[15]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[15]' was declared here drivers/usb/storage/realtek_cr.c:475:33: warning: 'buf[14]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[14]' was declared here drivers/usb/storage/realtek_cr.c:474:50: warning: 'buf[13]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[13]' was declared here drivers/usb/storage/realtek_cr.c:472:30: warning: 'buf[12]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[12]' was declared here drivers/usb/storage/realtek_cr.c:471:31: warning: 'buf[11]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[11]' was declared here drivers/usb/storage/realtek_cr.c:470:31: warning: 'buf[10]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[10]' was declared here drivers/usb/storage/realtek_cr.c:469:30: warning: 'buf[9]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[9]' was declared here drivers/usb/storage/realtek_cr.c:468:27: warning: 'buf[8]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[8]' was declared here drivers/usb/storage/realtek_cr.c:468:43: warning: 'buf[7]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[7]' was declared here drivers/usb/storage/realtek_cr.c:467:30: warning: 'buf[6]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[6]' was declared here drivers/usb/storage/realtek_cr.c:466:30: warning: 'buf[5]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[5]' was declared here drivers/usb/storage/realtek_cr.c:465:28: warning: 'buf[4]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[4]' was declared here drivers/usb/storage/realtek_cr.c:464:24: warning: 'buf[3]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[3]' was declared here drivers/usb/storage/realtek_cr.c:464:40: warning: 'buf[2]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[2]' was declared here drivers/usb/storage/realtek_cr.c:463:24: warning: 'buf[1]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[1]' was declared here drivers/usb/storage/realtek_cr.c:463:40: warning: 'buf[0]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[0]' was declared here Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-10-24usb-storage: add unusual_devs entry for Casio EX-N1 digital cameraMichael Shigorin1-0/+6
This commit sets removable subclass for Casio EX-N1 digital camera. The patch has been tested within an ALT Linux kernel: http://git.altlinux.org/people/led/packages/?p=kernel-image-3.0.git;a=commitdiff;h=c0fd891836e89fe0c93a4d536a59216d90e4e3e7 See also https://bugzilla.kernel.org/show_bug.cgi?id=49221 Signed-off-by: Oleksandr Chumachenko <[email protected]> Signed-off-by: Michael Shigorin <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-26USB: uas: fix gcc warningGerd Hoffmann1-10/+8
Streamline control flow so it is easier for gcc to follow which paths can be taken and which can't. Fixes "warning: 'cmdinfo' may be used uninitialized in this function" Signed-off-by: Gerd Hoffmann <[email protected]> Reported-by: Fengguang Wu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-26USB: uas: fix lockingGerd Hoffmann1-0/+2
Forgot to unlock in the uas_eh_task_mgmt error paths. Signed-off-by: Gerd Hoffmann <[email protected]> Reported-by: Fengguang Wu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-25USB: uas: add lockingGerd Hoffmann1-7/+44
Add spinlock to protect uas data structures. [ v2: s/GFP_NOIO/GFP_ATOMIC/, better don't sleep when holding a spinlock ] Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-25USB: uas: fix abortGerd Hoffmann1-7/+4
Properly report aborted commands. Also don't access cmdinfo after kicking task management, it may not be valid any more once it returns. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-25USB: uas: remove aborted field, replace with status bit.Gerd Hoffmann1-6/+6
Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-25USB: uas: fix task managementGerd Hoffmann1-3/+3
Allocate one tag for task management functions and use it properly. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-25USB: uas: keep track of command urbsGerd Hoffmann1-1/+10
Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-21USB: sierra_ms: don't keep unused variableAlan Cox1-2/+1
We need to call scsi_get_host_dev(sh) but we never use the return nor do we have any reason to check it. Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-05usb: remove libusualSebastian Andrzej Siewior19-325/+41
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-08-20usb: convert USB_QUIRK_RESET_MORPHS to USB_QUIRK_RESETLan Tianyu1-1/+1
Since the attribute avoid_reset_quirk is work for all devices including those devices that can't morph, convert USB_QUIRK_RESET_MORPHS to USB_QUIRK_RESET. Signed-off-by: Lan Tianyu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-08-15USB: storage: ene_ub6250: Use macros for firmware namesTim Gardner1-8/+20
Advertise firmware files using MODULE_FIRMWARE macros. Fix a debug string: SD_RDWR_PATTERN --> SD_RW_PATTERN Signed-off-by: Tim Gardner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-16usb: storage: update usb devices for write cache quirk in quirk list.Namjae Jeon1-0/+12
Update information of Seagate Portable HDD and WD My Passport HDD in quirk list. 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]> Cc: James Bottomley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-16usb: storage: add support for write cache quirkNamjae Jeon2-1/+9
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]> Cc: James Bottomley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-05Merge 3.5-rc5 into usb-nextGreg Kroah-Hartman2-7/+6
This resolves a merge issue with the option.c USB serial driver. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-25uas: task mgmt & error handlingGerd Hoffmann1-29/+131
Add task management support, wind up in abort and device reset error handlers. Cancel all in-flight urbs in bus reset handler. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-25uas: track urbs, kill inflight urbs on disconnect.Gerd Hoffmann1-0/+9
Use separate anchors for data and sense urbs, which I think will be useful when implementing error handling. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-25uas: improve error handlingGerd Hoffmann1-1/+13
(1) Handle data pipe errors: When the data urb failed we didn't transfer anything, update scsi_cmnd accordingly. (2) Cancel data transfers when we got back an error on the status pipe. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-25uas: keep track of command state, finish scsi cmd when really done.Gerd Hoffmann1-15/+71
Set state bits after submitting data urbs & command urbs, so we know what is in flight. Clear data bits when the data urb is finished, clear command bit when we see the status urb for the command. Finish the scsi command after running both status and data completion handlers for the command. Add a cmd status logging function for debugging purposes. Hook it into the error handler, so we see in the log what status a command is in which the scsi layer wants cancel. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-25uas: fix sense urb handlingGerd Hoffmann1-21/+28
Stop reusing sense urbs, just allocate a fresh one each time and free it when done. Stop storing a sense urb pointer in the scsi request, all you can do with it is misusing. For example requeuing the sense urb, then f*ck it up by picking the wrong one in case tagged requests don't finish in the same order you've submitted them. Also note that (not-yet supported) task management ops don't have a scsi request in the first place. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-25Revert "usb/uas: one only one status URB/host on stream-less connection"Gerd Hoffmann1-60/+10
This reverts commit ceb3f91fd53c9fbd7b292fc2754ba4efffeeeedb. IMO the real bug is assigning status urbs to scsi requests. First there is no such link in the non-stream case. Also there isn't nessesarely a scsi request in the first place, for example when submitting task management requests. This patch just papers over the real bug and introduces different status urb handling in the stream/non-stream case for no good reason. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-25Revert "usb/uas: make sure data urb is gone if we receive status before that"Gerd Hoffmann1-75/+15
This reverts commit e4d8318a85779b25b880187b1b1c44e797bd7d4b. This patch makes uas.c call usb_unlink_urb on data urbs. The data urbs get freed in the completion callback. This is illegal according to the usb_unlink_urb documentation. This patch also makes the code expect the data completion callback being called before the status completion callback. This isn't guaranteed to be the case, even though the actual data transfer should be finished by the time the status is received. Background: The ehci irq handler for example only know that there are finished transfers, it then has go check the QHs & TDs to see which transfers did actually finish. It has no way to figure in which order the transfers did complete. The xhci driver can call the callbacks in completion order thanks to the event queue. This does nicely explain why the driver is solid on a (usb2) xhci port whereas it goes crazy on ehci in my testing. Signed-off-by: Gerd Hoffmann <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-22usb-storage: revert commit afff07e61a52 (Add 090c:1000 to unusal-devs)Alan Stern1-7/+0
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 <[email protected]> Acked-by: Hans de Goede <[email protected]> CC: Matthew Dharm <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-22SCSI & usb-storage: add try_rc_10_first flagAlan Stern1-0/+6
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 <[email protected]> Acked-by: Hans de Goede <[email protected]> CC: "James E.J. Bottomley" <[email protected]> CC: Matthew Dharm <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-20Merge 3.5-rc3 into usb-nextGreg Kroah-Hartman1-0/+7
This lets us catch the USB fixes that went into 3.5-rc3 into this branch, as we want them here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>