summaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/uas.c
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2020-12-09 16:26:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-09 20:00:26 +0100
commit8010622c86ca5bb44bc98492f5968726fc7c7a21 (patch)
treeb623c73856ab6609f3e6c81fa33702cad33a16f1 /drivers/usb/storage/uas.c
parente5548b05631ec3e6bfdaef1cad28c799545b791b (diff)
downloadlinux-stable-8010622c86ca5bb44bc98492f5968726fc7c7a21.tar.gz
linux-stable-8010622c86ca5bb44bc98492f5968726fc7c7a21.tar.bz2
linux-stable-8010622c86ca5bb44bc98492f5968726fc7c7a21.zip
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>
Diffstat (limited to 'drivers/usb/storage/uas.c')
-rw-r--r--drivers/usb/storage/uas.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 56422c4b4ff3..bef89c6bd1d7 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -868,6 +868,9 @@ static int uas_slave_configure(struct scsi_device *sdev)
if (devinfo->flags & US_FL_NO_READ_CAPACITY_16)
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
* to READ CAPACITY rather than the highest block number.