aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/storage
AgeCommit message (Collapse)AuthorFilesLines
2014-03-04uas: Not being able to alloc streams when connected through usb-3 is an errorHans de Goede1-7/+17
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Verify endpoint descriptors from uas_use_uas_driver()Hans de Goede1-1/+11
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Drop fixed endpoint config handlingHans de Goede1-25/+11
The fixed endpoint config code was only necessary to deal with an early uas prototype which has never been released, so lets drop it and enforce proper uas endpoint descriptors. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Move uas_find_endpoints to uas-detect.hHans de Goede2-27/+27
No changes, just the move. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Fix bounds check in uas_find_endpointsHans de Goede1-1/+1
The loop uses up to 3 bytes of the endpoint extra data. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Add uas_find_endpoints() helper functionHans de Goede1-11/+23
This is a preparation patch for adding better descriptor validation. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Honor no-uas quirk set in usb-storage's quirks module parameterHans de Goede2-1/+5
Falling back from uas to usb-storage requires coordination between uas and usb-storage, so use usb-storage's quirks module parameter, rather then requiring the user to pass a param to 2 different modules. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04usb-storage: Modify and export adjust_quirks so that it can be used by uasHans de Goede2-6/+13
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 Goede2-0/+15
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-03-04uas: Add the posibilty to blacklist uas devices from using the uas driverHans de Goede3-4/+76
Once we start supporting uas hardware, and as more and more uas devices become available, we will likely start seeing broken devices. This patch prepares for the inevitable need for blacklisting those devices from using the uas driver (they will use usb-storage instead). Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Move uas detect code to uas-detect.hHans de Goede2-38/+42
This is a preparation patch for teaching usb-storage to not bind to uas devices. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Add a uas_find_uas_alt_setting helper functionHans de Goede1-5/+16
This is a preparation patch for teaching usb-storage to not bind to uas devices. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Use all available stream idsHans de Goede1-3/+3
If we get ie 16 streams we can use stream-id 1-16, not 1-15. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: s/response_ui/response_iu/Hans de Goede1-1/+1
Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Fix reset handling for externally triggered resetHans de Goede1-5/+31
Handle usb-device resets not triggered from uas_eh_bus_reset_handler(), when this happens, disable cmd queuing during the reset, and wait for existing requests to finish in pre_reset. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Fix reset lockingHans de Goede1-0/+9
Fix the uas_eh_bus_reset_handler not properly taking the usbdev lock before calling usb_device_reset, the usb-core expects this lock to be taken when usb_device_reset is called. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Fix uas not working when plugged into an ehci portHans de Goede1-4/+4
I thought it would be a good idea to also test uas with usb-2, and it turns out it was, as it did not work. The problem is that the uas driver was passing the bEndpointAddress' direction bit to usb_rcvbulkpipe, the xhci code seems to not care about this, but with the ehci code this causes usb_submit_urb failure. With this fixed the uas code works nicely with an uas device plugged into an ehci port. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: uas_alloc_cmd_urb: drop unused stream_id parameterHans de Goede1-3/+2
The cmd endpoint never has streams, so the stream_id parameter is unused. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Avoid unnecessary unlock / lock calls around unlink_data_urbsHans de Goede1-13/+7
All callers of unlink_data_urbs drop devinfo->lock before calling it, and then immediately take it again after the call. And the first thing unlink_data_urbs does is take the lock again, and the last thing it does is drop it. This commit removes all the unnecessary lock dropping and taking. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Properly set interface to altsetting 0 on probe failureHans de Goede1-9/+9
- Rename labels to properly reflect this - Don't skip free-ing the streams when scsi_init_shared_tag_map fails Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: Urbs must be anchored before submitting themHans de Goede1-8/+12
Otherwise they may complete before they get anchored and thus never get unanchored (as the unanchoring is done by the usb core on completion). This commit also remove the usb_get_urb / usb_put_urb around cmd submission + anchoring, since if done in the proper order this is not necessary. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-03-04uas: replace BUG_ON() + WARN_ON() with WARN_ON_ONCE()Gerd Hoffmann1-9/+10
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: add dead request listGerd Hoffmann1-8/+42
This patch adds a new list where all requests which are canceled are added to, so we don't loose them. Then, after killing all inflight urbs on bus reset (and disconnect) we'll walk over the list and clean them up. Without this we can end up with aborted requests lingering around in case of status pipe transfer errors. 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 work list per-deviceGerd Hoffmann1-62/+44
Simplifies locking, we'll protect the list with the device spin lock. Also plugs races which can happen when two devices operate on the global list. While being at it rename the list head from "list" to "work", preparing for the addition of a second list. 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: properly reinitialize in uas_eh_bus_reset_handlerGerd Hoffmann1-0/+5
Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2014-02-04usb-storage: enable multi-LUN scanning when neededAlan Stern2-1/+9
People sometimes create their own custom-configured kernels and forget to enable CONFIG_SCSI_MULTI_LUN. This causes problems when they plug in a USB storage device (such as a card reader) with more than one LUN. Fortunately, we can tell fairly easily when a storage device claims to have more than one LUN. When that happens, this patch asks the SCSI layer to probe all the LUNs automatically, regardless of the config setting. The patch also updates the Kconfig help text for usb-storage, explaining that CONFIG_SCSI_MULTI_LUN may be necessary. Signed-off-by: Alan Stern <[email protected]> Reported-by: Thomas Raschbacher <[email protected]> CC: Matthew Dharm <[email protected]> CC: James Bottomley <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-02-04usb-storage: add unusual-devs entry for BlackBerry 9000Alan Stern1-0/+7
This patch adds an unusual-devs entry for the BlackBerry 9000. This fixes Bugzilla #22442. Signed-off-by: Alan Stern <[email protected]> Reported-by: Moritz Moeller-Herrmann <[email protected]> Tested-by: Moritz Moeller-Herrmann <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-02-04usb-storage: restrict bcdDevice range for Super Top in Cypress ATACBAlan Stern1-1/+1
The Cypress ATACB unusual-devs entry for the Super Top SATA bridge causes problems. Although it was originally reported only for bcdDevice = 0x160, its range was much larger. This resulted in a bug report for bcdDevice 0x220, so the range was capped at 0x219. Now Milan reports errors with bcdDevice 0x150. Therefore this patch restricts the range to just 0x160. Signed-off-by: Alan Stern <[email protected]> Reported-and-tested-by: Milan Svoboda <[email protected]> CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-01-08usb: delete non-required instances of include <linux/init.h>Paul Gortmaker2-2/+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]>
2014-01-03USB: Nokia 502 is an unusual deviceMikhail Zolotaryov1-0/+7
The USB storage operation of Nokia Asha 502 Dual SIM smartphone running Asha Platform 1.1.1 is unreliable in respect of data consistency (i.e. transfered files are corrupted). A similar issue is described here: http://discussions.nokia.com/t5/Asha-and-other-Nokia-Series-30/Nokia-301-USB-transfers-and-corrupted-files/td-p/1974170 The workaround is (MAX_SECTORS_64): rmmod usb_storage && modprobe usb_storage quirks=0421:06aa:m The patch adds the tested device to the unusual list permanently. Signed-off-by: Mikhail Zolotaryov <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-12-09USB: storage: fix compile warningMing Lei1-1/+2
This patch should fix the below compile warning: drivers/usb/storage/protocol.c: In function 'usb_stor_access_xfer_buf': drivers/usb/storage/protocol.c:155:22: warning: comparison of distinct pointer types lacks a cast [enabled by default] Reported-by: kbuild test robot <[email protected]> Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-12-08USB: storage: use sg_miter_* APIs to access scsi bufferMing Lei1-54/+26
We have sg_miter_* APIs for accessing scsi sg buffer, so use them to make code clean and bug free. Cc: Matthew Dharm <[email protected]> Cc: Alan Stern <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16usb-storage: add quirk for mandatory READ_CAPACITY_16Oliver Neukum2-1/+11
Some USB drive enclosures do not correctly report an overflow condition if they hold a drive with a capacity over 2TB and are confronted with a READ_CAPACITY_10. They answer with their capacity modulo 2TB. The generic layer cannot cope with that. It must be told to use READ_CAPACITY_16 from the beginning. Signed-off-by: Oliver Neukum <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-27USB storage: audit sysfs attribute permissionsGreg Kroah-Hartman1-9/+7
Convert the usbsorage sysfs attribute to use the _RW macro to make it easier to determine the permissions for the file. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-22USB: storage: Add MicroVault Flash Drive to unusual_devsRen Bigcren1-0/+7
The device report an error capacity when read_capacity_16(). Using read_capacity_10() can get the correct capacity. Signed-off-by: Ren Bigcren <[email protected]> Cc: Matthew Dharm <[email protected]> Signed-off-by: Oskar Andero <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-05-27Merge 3.10-rc3 into usb-nextGreg Kroah-Hartman1-4/+4
We want these fixes. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-05-16usb: storage: alauda: initialize variables directlyEmilio López1-5/+1
Clean up the code a bit to initialize the variables directly when defining them. Signed-off-by: Emilio López <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-05-16usb: storage: sddr09: initialize variables directlyEmilio López1-5/+1
Clean up the code a bit to initialize the variables directly when defining them. Signed-off-by: Emilio López <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-05-16USB: usb-stor: realtek_cr: Fix compile errorWei WANG1-4/+4
To fix the compile error when CONFIG_PM_RUNTIME is not enabled, move the declaration of us out of CONFIG_REALTEK_AUTOPM macro in rts51x_chip. drivers/usb/storage/realtek_cr.c: In function 'realtek_cr_destructor': drivers/usb/storage/realtek_cr.c:942:11: error: 'struct rts51x_chip' has no member named 'us' Signed-off-by: Wei WANG <[email protected]> Reported-by: Randy Dunlap <[email protected]> Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-05-01Merge branch 'for-linus' of ↵Linus Torvalds1-28/+14
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
2013-04-30drivers/usb/storage/realtek_cr.c: fix buildAndrew Morton1-4/+1
Remove unused local `us', which broke the build. Also nuke an unneeded cast. Repairs commit 191648d03d20 ("usb: storage: Convert US_DEBUGP to usb_stor_dbg"). Cc: Joe Perches <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-04-23usb-storage: CY7C68300A chips do not support Cypress ATACBTormod Volden1-2/+14
Many cards based on CY7C68300A/B/C use the USB ID 04b4:6830 but only the B and C variants (EZ-USB AT2LP) support the ATA Command Block functionality, according to the data sheets. The A variant (EZ-USB AT2) locks up if ATACB is attempted, until a typical 30 seconds timeout runs out and a USB reset is performed. https://bugs.launchpad.net/bugs/428469 It seems that one way to spot a CY7C68300A (at least where the card manufacturer left Cypress' EEPROM default vaules, against Cypress' recommendations) is to look at the USB string descriptor indices. A http://media.digikey.com/pdf/Data%20Sheets/Cypress%20PDFs/CY7C68300A.pdf B http://www.farnell.com/datasheets/43456.pdf C http://www.cypress.com/?rID=14189 Note that a CY7C68300B/C chip appears as CY7C68300A if it is running in Backward Compatibility Mode, and if ATACB would be supported in this case there is anyway no way to tell which chip it really is. For 5 years my external USB drive has been locking up for half a minute when plugged in and ata_id is run by udev, or anytime hdparm or similar is run on it. Finally looking at the /correct/ datasheet I think I found the reason. I am aware the quirk in this patch is a bit hacky, but the hardware manufacturers haven't made it easy for us. Signed-off-by: Tormod Volden <[email protected]> Cc: stable <[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 Perches20-834/+753
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-04-18usb: storage: Fix link errorJoe Perches1-0/+2
Fix allmodconfig link error introduced by commit 75b9130e8a ("usb: storage: Add usb_stor_dbg, reduce object size") Export the symbol usb_stor_dbg. Add export.h Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-04-17usb: storage: Add usb_stor_dbg, reduce object sizeJoe Perches3-12/+34
Reduce the size of the objects by consolidating the duplicated USB_STORAGE into a single function. Add function usb_stor_dbg to emit debugging messages. Always validate the format and arguments. Reduce the number of uses of CONFIG_USB_STORAGE_DEBUG. Reduces size of objects ~7KB when CONFIG_USB_STORAGE_DEBUG is set. $ size drivers/usb/storage/built-in.o* text data bss dec hex filename 140133 55296 70312 265741 40e0d drivers/usb/storage/built-in.o.new 147494 55248 70296 273038 42a8e drivers/usb/storage/built-in.o.old Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-04-09USB: regroup all depends on USB within an if USB blockFlorian Fainelli1-4/+3
This patch removes the depends on USB from all config symbols in drivers/usb/host/Kconfig and replace that with an if USB / endif block as suggested by Alan Stern. Some source ... Kconfig lines have been shuffled around to permit a better regroupment of the Kconfig files depending on "config USB" item. No functionnal change is introduced. Acked-by: Alan Stern <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-04-09usb-storage: switch to ->show_info()Al Viro1-28/+14
Signed-off-by: Al Viro <[email protected]>
2013-03-20Merge branch 'usb-linus' into usb-nextGreg Kroah-Hartman3-78/+346
This is to pick up the fixes in that branch, and let Alan fix the merge error in drivers/usb/host/ehci-timer.c better than I just did (as I know I messed it up...) Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-03-15usb-storage: add unusual_devs entry for Samsung YP-Z3 mp3 playerDmitry Artamonow1-0/+7
Device stucks on filesystem writes, unless following quirk is passed: echo 04e8:5136:m > /sys/module/usb_storage/parameters/quirks Add corresponding entry to unusual_devs.h Signed-off-by: Dmitry Artamonow <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>