diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2016-05-17 21:12:50 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2016-05-17 21:12:50 -0400 |
commit | e7ca7f9fa2cda220ba807620c992ce77c33a32ea (patch) | |
tree | fb8a6c1abc638c5a79645f4b9f44ece7c67187b4 /drivers/usb/storage | |
parent | 5f0dfb7a9bcc8139958f59ecb9bbd7e738ae702d (diff) | |
parent | d65c8fff867a6450c58ce31572e883148a445ddf (diff) |
Merge branch 'fixes' into misc
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/uas.c | 21 | ||||
-rw-r--r-- | drivers/usb/storage/unusual_uas.h | 7 | ||||
-rw-r--r-- | drivers/usb/storage/usb.c | 5 |
3 files changed, 30 insertions, 3 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 13e4cc31bc79..16bc679dc2fc 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * USB Attached SCSI | 2 | * USB Attached SCSI |
3 | * Note that this is not the same as the USB Mass Storage driver | 3 | * Note that this is not the same as the USB Mass Storage driver |
4 | * | 4 | * |
5 | * Copyright Hans de Goede <hdegoede@redhat.com> for Red Hat, Inc. 2013 - 2014 | 5 | * Copyright Hans de Goede <hdegoede@redhat.com> for Red Hat, Inc. 2013 - 2016 |
6 | * Copyright Matthew Wilcox for Intel Corp, 2010 | 6 | * Copyright Matthew Wilcox for Intel Corp, 2010 |
7 | * Copyright Sarah Sharp for Intel Corp, 2010 | 7 | * Copyright Sarah Sharp for Intel Corp, 2010 |
8 | * | 8 | * |
@@ -781,6 +781,17 @@ static int uas_eh_bus_reset_handler(struct scsi_cmnd *cmnd) | |||
781 | return SUCCESS; | 781 | return SUCCESS; |
782 | } | 782 | } |
783 | 783 | ||
784 | static int uas_target_alloc(struct scsi_target *starget) | ||
785 | { | ||
786 | struct uas_dev_info *devinfo = (struct uas_dev_info *) | ||
787 | dev_to_shost(starget->dev.parent)->hostdata; | ||
788 | |||
789 | if (devinfo->flags & US_FL_NO_REPORT_LUNS) | ||
790 | starget->no_report_luns = 1; | ||
791 | |||
792 | return 0; | ||
793 | } | ||
794 | |||
784 | static int uas_slave_alloc(struct scsi_device *sdev) | 795 | static int uas_slave_alloc(struct scsi_device *sdev) |
785 | { | 796 | { |
786 | struct uas_dev_info *devinfo = | 797 | struct uas_dev_info *devinfo = |
@@ -824,7 +835,6 @@ static int uas_slave_configure(struct scsi_device *sdev) | |||
824 | if (devinfo->flags & US_FL_BROKEN_FUA) | 835 | if (devinfo->flags & US_FL_BROKEN_FUA) |
825 | sdev->broken_fua = 1; | 836 | sdev->broken_fua = 1; |
826 | 837 | ||
827 | scsi_change_queue_depth(sdev, devinfo->qdepth - 2); | ||
828 | return 0; | 838 | return 0; |
829 | } | 839 | } |
830 | 840 | ||
@@ -832,6 +842,7 @@ static struct scsi_host_template uas_host_template = { | |||
832 | .module = THIS_MODULE, | 842 | .module = THIS_MODULE, |
833 | .name = "uas", | 843 | .name = "uas", |
834 | .queuecommand = uas_queuecommand, | 844 | .queuecommand = uas_queuecommand, |
845 | .target_alloc = uas_target_alloc, | ||
835 | .slave_alloc = uas_slave_alloc, | 846 | .slave_alloc = uas_slave_alloc, |
836 | .slave_configure = uas_slave_configure, | 847 | .slave_configure = uas_slave_configure, |
837 | .eh_abort_handler = uas_eh_abort_handler, | 848 | .eh_abort_handler = uas_eh_abort_handler, |
@@ -956,6 +967,12 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
956 | if (result) | 967 | if (result) |
957 | goto set_alt0; | 968 | goto set_alt0; |
958 | 969 | ||
970 | /* | ||
971 | * 1 tag is reserved for untagged commands + | ||
972 | * 1 tag to avoid off by one errors in some bridge firmwares | ||
973 | */ | ||
974 | shost->can_queue = devinfo->qdepth - 2; | ||
975 | |||
959 | usb_set_intfdata(intf, shost); | 976 | usb_set_intfdata(intf, shost); |
960 | result = scsi_add_host(shost, &intf->dev); | 977 | result = scsi_add_host(shost, &intf->dev); |
961 | if (result) | 978 | if (result) |
diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h index ccc113e83d88..53341a77d89f 100644 --- a/drivers/usb/storage/unusual_uas.h +++ b/drivers/usb/storage/unusual_uas.h | |||
@@ -64,6 +64,13 @@ UNUSUAL_DEV(0x0bc2, 0x3312, 0x0000, 0x9999, | |||
64 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 64 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
65 | US_FL_NO_ATA_1X), | 65 | US_FL_NO_ATA_1X), |
66 | 66 | ||
67 | /* Reported-by: David Webb <djw@noc.ac.uk> */ | ||
68 | UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999, | ||
69 | "Seagate", | ||
70 | "Expansion Desk", | ||
71 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
72 | US_FL_NO_REPORT_LUNS), | ||
73 | |||
67 | /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ | 74 | /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ |
68 | UNUSUAL_DEV(0x0bc2, 0x3320, 0x0000, 0x9999, | 75 | UNUSUAL_DEV(0x0bc2, 0x3320, 0x0000, 0x9999, |
69 | "Seagate", | 76 | "Seagate", |
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 43576ed31ccd..9de988a0f856 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -482,7 +482,7 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags) | |||
482 | US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 | | 482 | US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 | |
483 | US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE | | 483 | US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE | |
484 | US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES | | 484 | US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES | |
485 | US_FL_MAX_SECTORS_240); | 485 | US_FL_MAX_SECTORS_240 | US_FL_NO_REPORT_LUNS); |
486 | 486 | ||
487 | p = quirks; | 487 | p = quirks; |
488 | while (*p) { | 488 | while (*p) { |
@@ -532,6 +532,9 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags) | |||
532 | case 'i': | 532 | case 'i': |
533 | f |= US_FL_IGNORE_DEVICE; | 533 | f |= US_FL_IGNORE_DEVICE; |
534 | break; | 534 | break; |
535 | case 'j': | ||
536 | f |= US_FL_NO_REPORT_LUNS; | ||
537 | break; | ||
535 | case 'l': | 538 | case 'l': |
536 | f |= US_FL_NOT_LOCKABLE; | 539 | f |= US_FL_NOT_LOCKABLE; |
537 | break; | 540 | break; |