diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-01 20:06:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-01 20:06:09 -0400 |
commit | 3e75c6de1ac33fe3500f44573d9212dc82c99f59 (patch) | |
tree | ef10932e204ba8a9885051b06d4524d284207d61 /drivers/usb/storage/usb.c | |
parent | cb1595563880a81dab6eab9a5ecb4520d2e76077 (diff) | |
parent | 940ab8f1ef9369da5b58a1bec6820bfd4a7b9042 (diff) |
Merge tag 'usb-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB patches from Greg KH:
"Here's the big USB pull request for 3.15-rc1.
The normal set of patches, lots of controller driver updates, and a
smattering of individual USB driver updates as well.
All have been in linux-next for a while"
* tag 'usb-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (249 commits)
xhci: Transition maintainership to Mathias Nyman.
USB: disable reset-resume when USB_QUIRK_RESET is set
USB: unbind all interfaces before rebinding any
usb: phy: Add ulpi IDs for SMSC USB3320 and TI TUSB1210
usb: gadget: tcm_usb_gadget: stop format strings
usb: gadget: f_fs: add missing spinlock and mutex unlock
usb: gadget: composite: switch over to ERR_CAST()
usb: gadget: inode: switch over to memdup_user()
usb: gadget: f_subset: switch over to PTR_RET
usb: gadget: lpc32xx_udc: fix wrong clk_put() sequence
USB: keyspan: remove dead debugging code
USB: serial: add missing newlines to dev_<level> messages.
USB: serial: add missing braces
USB: serial: continue to write on errors
USB: serial: continue to read on errors
USB: serial: make bulk_out_size a lower limit
USB: cypress_m8: fix potential scheduling while atomic
devicetree: bindings: document lsi,zevio-usb
usb: chipidea: add support for USB OTG controller on LSI Zevio SoCs
usb: chipidea: imx: Use dev_name() for ci_hdrc name to distinguish USBs
...
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r-- | drivers/usb/storage/usb.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 1c0b89f2a138..f1c96261a501 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -72,6 +72,10 @@ | |||
72 | #include "sierra_ms.h" | 72 | #include "sierra_ms.h" |
73 | #include "option_ms.h" | 73 | #include "option_ms.h" |
74 | 74 | ||
75 | #if IS_ENABLED(CONFIG_USB_UAS) | ||
76 | #include "uas-detect.h" | ||
77 | #endif | ||
78 | |||
75 | /* Some informational data */ | 79 | /* Some informational data */ |
76 | MODULE_AUTHOR("Matthew Dharm <mdharm-usb@one-eyed-alien.net>"); | 80 | MODULE_AUTHOR("Matthew Dharm <mdharm-usb@one-eyed-alien.net>"); |
77 | MODULE_DESCRIPTION("USB Mass Storage driver for Linux"); | 81 | MODULE_DESCRIPTION("USB Mass Storage driver for Linux"); |
@@ -459,14 +463,14 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf) | |||
459 | #define TOLOWER(x) ((x) | 0x20) | 463 | #define TOLOWER(x) ((x) | 0x20) |
460 | 464 | ||
461 | /* Adjust device flags based on the "quirks=" module parameter */ | 465 | /* Adjust device flags based on the "quirks=" module parameter */ |
462 | static void adjust_quirks(struct us_data *us) | 466 | void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags) |
463 | { | 467 | { |
464 | char *p; | 468 | char *p; |
465 | u16 vid = le16_to_cpu(us->pusb_dev->descriptor.idVendor); | 469 | u16 vid = le16_to_cpu(udev->descriptor.idVendor); |
466 | u16 pid = le16_to_cpu(us->pusb_dev->descriptor.idProduct); | 470 | u16 pid = le16_to_cpu(udev->descriptor.idProduct); |
467 | unsigned f = 0; | 471 | unsigned f = 0; |
468 | unsigned int mask = (US_FL_SANE_SENSE | US_FL_BAD_SENSE | | 472 | unsigned int mask = (US_FL_SANE_SENSE | US_FL_BAD_SENSE | |
469 | US_FL_FIX_CAPACITY | | 473 | US_FL_FIX_CAPACITY | US_FL_IGNORE_UAS | |
470 | US_FL_CAPACITY_HEURISTICS | US_FL_IGNORE_DEVICE | | 474 | US_FL_CAPACITY_HEURISTICS | US_FL_IGNORE_DEVICE | |
471 | US_FL_NOT_LOCKABLE | US_FL_MAX_SECTORS_64 | | 475 | US_FL_NOT_LOCKABLE | US_FL_MAX_SECTORS_64 | |
472 | US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE | | 476 | US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE | |
@@ -537,14 +541,18 @@ static void adjust_quirks(struct us_data *us) | |||
537 | case 's': | 541 | case 's': |
538 | f |= US_FL_SINGLE_LUN; | 542 | f |= US_FL_SINGLE_LUN; |
539 | break; | 543 | break; |
544 | case 'u': | ||
545 | f |= US_FL_IGNORE_UAS; | ||
546 | break; | ||
540 | case 'w': | 547 | case 'w': |
541 | f |= US_FL_NO_WP_DETECT; | 548 | f |= US_FL_NO_WP_DETECT; |
542 | break; | 549 | break; |
543 | /* Ignore unrecognized flag characters */ | 550 | /* Ignore unrecognized flag characters */ |
544 | } | 551 | } |
545 | } | 552 | } |
546 | us->fflags = (us->fflags & ~mask) | f; | 553 | *fflags = (*fflags & ~mask) | f; |
547 | } | 554 | } |
555 | EXPORT_SYMBOL_GPL(usb_stor_adjust_quirks); | ||
548 | 556 | ||
549 | /* Get the unusual_devs entries and the string descriptors */ | 557 | /* Get the unusual_devs entries and the string descriptors */ |
550 | static int get_device_info(struct us_data *us, const struct usb_device_id *id, | 558 | static int get_device_info(struct us_data *us, const struct usb_device_id *id, |
@@ -564,7 +572,7 @@ static int get_device_info(struct us_data *us, const struct usb_device_id *id, | |||
564 | idesc->bInterfaceProtocol : | 572 | idesc->bInterfaceProtocol : |
565 | unusual_dev->useTransport; | 573 | unusual_dev->useTransport; |
566 | us->fflags = id->driver_info; | 574 | us->fflags = id->driver_info; |
567 | adjust_quirks(us); | 575 | usb_stor_adjust_quirks(us->pusb_dev, &us->fflags); |
568 | 576 | ||
569 | if (us->fflags & US_FL_IGNORE_DEVICE) { | 577 | if (us->fflags & US_FL_IGNORE_DEVICE) { |
570 | dev_info(pdev, "device ignored\n"); | 578 | dev_info(pdev, "device ignored\n"); |
@@ -1035,6 +1043,12 @@ static int storage_probe(struct usb_interface *intf, | |||
1035 | int result; | 1043 | int result; |
1036 | int size; | 1044 | int size; |
1037 | 1045 | ||
1046 | /* If uas is enabled and this device can do uas then ignore it. */ | ||
1047 | #if IS_ENABLED(CONFIG_USB_UAS) | ||
1048 | if (uas_use_uas_driver(intf, id)) | ||
1049 | return -ENXIO; | ||
1050 | #endif | ||
1051 | |||
1038 | /* | 1052 | /* |
1039 | * If the device isn't standard (is handled by a subdriver | 1053 | * If the device isn't standard (is handled by a subdriver |
1040 | * module) then don't accept it. | 1054 | * module) then don't accept it. |