mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 18:21:24 +02:00
USB: UAS: introduce a quirk to set no_write_same
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 <david.partridge@perdrix.co.uk> Signed-off-by: Oliver Neukum <oneukum@suse.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201209152639.9195-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e5548b0563
commit
8010622c86
|
|
@ -5663,6 +5663,7 @@
|
||||||
device);
|
device);
|
||||||
j = NO_REPORT_LUNS (don't use report luns
|
j = NO_REPORT_LUNS (don't use report luns
|
||||||
command, uas only);
|
command, uas only);
|
||||||
|
k = NO_SAME (do not use WRITE_SAME, uas only)
|
||||||
l = NOT_LOCKABLE (don't try to lock and
|
l = NOT_LOCKABLE (don't try to lock and
|
||||||
unlock ejectable media, not on uas);
|
unlock ejectable media, not on uas);
|
||||||
m = MAX_SECTORS_64 (don't transfer more
|
m = MAX_SECTORS_64 (don't transfer more
|
||||||
|
|
|
||||||
|
|
@ -868,6 +868,9 @@ static int uas_slave_configure(struct scsi_device *sdev)
|
||||||
if (devinfo->flags & US_FL_NO_READ_CAPACITY_16)
|
if (devinfo->flags & US_FL_NO_READ_CAPACITY_16)
|
||||||
sdev->no_read_capacity_16 = 1;
|
sdev->no_read_capacity_16 = 1;
|
||||||
|
|
||||||
|
/* Some disks cannot handle WRITE_SAME */
|
||||||
|
if (devinfo->flags & US_FL_NO_SAME)
|
||||||
|
sdev->no_write_same = 1;
|
||||||
/*
|
/*
|
||||||
* Some disks return the total number of blocks in response
|
* Some disks return the total number of blocks in response
|
||||||
* to READ CAPACITY rather than the highest block number.
|
* to READ CAPACITY rather than the highest block number.
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,15 @@ UNUSUAL_DEV(0x054c, 0x087d, 0x0000, 0x9999,
|
||||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||||
US_FL_NO_REPORT_OPCODES),
|
US_FL_NO_REPORT_OPCODES),
|
||||||
|
|
||||||
/* Reported-by: Julian Groß <julian.g@posteo.de> */
|
/*
|
||||||
|
* Initially Reported-by: Julian Groß <julian.g@posteo.de>
|
||||||
|
* Further reports David C. Partridge <david.partridge@perdrix.co.uk>
|
||||||
|
*/
|
||||||
UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999,
|
UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999,
|
||||||
"LaCie",
|
"LaCie",
|
||||||
"2Big Quadra USB3",
|
"2Big Quadra USB3",
|
||||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||||
US_FL_NO_REPORT_OPCODES),
|
US_FL_NO_REPORT_OPCODES | US_FL_NO_SAME),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
|
* Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
|
||||||
|
|
|
||||||
|
|
@ -541,6 +541,9 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)
|
||||||
case 'j':
|
case 'j':
|
||||||
f |= US_FL_NO_REPORT_LUNS;
|
f |= US_FL_NO_REPORT_LUNS;
|
||||||
break;
|
break;
|
||||||
|
case 'k':
|
||||||
|
f |= US_FL_NO_SAME;
|
||||||
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
f |= US_FL_NOT_LOCKABLE;
|
f |= US_FL_NOT_LOCKABLE;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,8 @@
|
||||||
/* Cannot handle REPORT_LUNS */ \
|
/* Cannot handle REPORT_LUNS */ \
|
||||||
US_FLAG(ALWAYS_SYNC, 0x20000000) \
|
US_FLAG(ALWAYS_SYNC, 0x20000000) \
|
||||||
/* lies about caching, so always sync */ \
|
/* lies about caching, so always sync */ \
|
||||||
|
US_FLAG(NO_SAME, 0x40000000) \
|
||||||
|
/* Cannot handle WRITE_SAME */ \
|
||||||
|
|
||||||
#define US_FLAG(name, value) US_FL_##name = value ,
|
#define US_FLAG(name, value) US_FL_##name = value ,
|
||||||
enum { US_DO_ALL_FLAGS };
|
enum { US_DO_ALL_FLAGS };
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user