Re: Issues with LaCie USB3 drive and UAS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Montag, den 09.11.2020, 15:21 +0000 schrieb David C. Partridge:
> Update: I found out how to do it! 
> 
> Created /etc/modprobe.d/blacklist_uas.conf containing text:
> 
> options usb-storage quirks=059f:105f:u
> 
> followed by: update-initramfs -u
> and rebooted.
> 
> Now the device works fine and mkfs.ext4 finishes in seconds rather than hours.

Hi,

this is good for now. Could you test the attached patch and replace the
"u" in your module options for usb-storage with a "k" (for the new
quirk)?

	Regards
		Oliver

From 53a5cacbf61ce6a4935723849ad602f38d8f9a52 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@xxxxxxxx>
Date: Wed, 11 Nov 2020 12:37:15 +0100
Subject: [PATCH] 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.

Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx>
---
 drivers/usb/storage/uas.c | 3 +++
 drivers/usb/storage/usb.c | 3 +++
 include/linux/usb_usual.h | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index c8a577309e8f..1e1daa3da4b5 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -874,6 +874,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.
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index c2ef367cf257..08b469511043 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -541,6 +541,9 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)
 		case 'j':
 			f |= US_FL_NO_REPORT_LUNS;
 			break;
+		case 'k':
+			f |= US_FL_NO_SAME;
+			break;
 		case 'l':
 			f |= US_FL_NOT_LOCKABLE;
 			break;
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 4a19ac3f24d0..6b03fdd69d27 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -84,6 +84,8 @@
 		/* Cannot handle REPORT_LUNS */			\
 	US_FLAG(ALWAYS_SYNC, 0x20000000)			\
 		/* lies about caching, so always sync */	\
+	US_FLAG(NO_SAME, 0x40000000)				\
+		/* Cannot handle WRITE_SAME */			\
 
 #define US_FLAG(name, value)	US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
-- 
2.26.2


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux