Home Home > GIT Browse > openSUSE-42.3
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-09-16 14:12:02 +0200
committerTakashi Iwai <tiwai@suse.de>2016-09-16 14:12:02 +0200
commit58d110f84f5724d6d1a76e6b161971436a11af16 (patch)
tree81756c4696b0b43556f4d3dd298f953c8956e462
parent2bdb5b82545c66acb9d8bfaac176411ee035b1a4 (diff)
parent73fffead03dfaf2ede6f43916a9b37ded871bc84 (diff)
Merge branch 'users/oneukum/SLE12-SP2/for-next' into SLE12-SP2rpm-4.4.21-63
Fix usb storage fix from Oliver Neukum (bsc#979231).
-rw-r--r--patches.drivers/0001-scsi-introduce-a-quirk-for-false-cache-reporting.patch105
-rw-r--r--series.conf1
2 files changed, 106 insertions, 0 deletions
diff --git a/patches.drivers/0001-scsi-introduce-a-quirk-for-false-cache-reporting.patch b/patches.drivers/0001-scsi-introduce-a-quirk-for-false-cache-reporting.patch
new file mode 100644
index 0000000000..ea72d58472
--- /dev/null
+++ b/patches.drivers/0001-scsi-introduce-a-quirk-for-false-cache-reporting.patch
@@ -0,0 +1,105 @@
+From 050bc4e846af24e77af82d0fa5f718e0919d15a4 Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oneukum@suse.com>
+Date: Mon, 12 Sep 2016 15:19:41 +0200
+Subject: [PATCH] scsi: introduce a quirk for false cache reporting
+References: bsc#979231
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
+Patch-Mainline: Queued
+Git-Commit: 050bc4e846af24e77af82d0fa5f718e0919d15a4
+
+Some SATA to USB bridges fail to cooperate with some
+drives resulting in no cache being present being reported
+to the host. That causes the host to skip sending
+a command to synchronize caches. That causes data loss
+when the drive is powered down.
+
+Signed-off-by: Oliver Neukum <oneukum@suse.com>
+Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Oliver Neukum <oneukum@suse.com>
+---
+ Documentation/kernel-parameters.txt | 2 ++
+ drivers/usb/storage/scsiglue.c | 8 ++++++++
+ drivers/usb/storage/unusual_devs.h | 7 +++++++
+ drivers/usb/storage/usb.c | 6 +++++-
+ include/linux/usb_usual.h | 2 ++
+ 5 files changed, 24 insertions(+), 1 deletion(-)
+
+--- a/Documentation/kernel-parameters.txt
++++ b/Documentation/kernel-parameters.txt
+@@ -4003,6 +4003,8 @@ bytes respectively. Such letter suffixes
+ u = IGNORE_UAS (don't bind to the uas driver);
+ w = NO_WP_DETECT (don't test whether the
+ medium is write-protected).
++ y = ALWAYS_SYNC (issue a SYNCHRONIZE_CACHE
++ even if the device claims no cache)
+ Example: quirks=0419:aaf5:rl,0421:0433:rc
+
+ user_debug= [KNL,ARM]
+--- a/drivers/usb/storage/scsiglue.c
++++ b/drivers/usb/storage/scsiglue.c
+@@ -260,6 +260,14 @@ static int slave_configure(struct scsi_d
+ if (us->fflags & US_FL_BROKEN_FUA)
+ sdev->broken_fua = 1;
+
++ /* Some even totally fail to indicate a cache */
++ if (us->fflags & US_FL_ALWAYS_SYNC) {
++ /* don't read caching information */
++ sdev->skip_ms_page_8 = 1;
++ sdev->skip_ms_page_3f = 1;
++ /* assume sync is needed */
++ sdev->wce_default_on = 1;
++ }
+ } else {
+
+ /* Non-disk-type devices don't need to blacklist any pages
+--- a/drivers/usb/storage/unusual_devs.h
++++ b/drivers/usb/storage/unusual_devs.h
+@@ -322,6 +322,13 @@ UNUSUAL_DEV( 0x046b, 0xff40, 0x0100, 0x
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+ US_FL_NO_WP_DETECT),
+
++/* Reported by Egbert Eich <eich@suse.com> */
++UNUSUAL_DEV( 0x0480, 0xd010, 0x0100, 0x9999,
++ "Toshiba",
++ "External USB 3.0",
++ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
++ US_FL_ALWAYS_SYNC),
++
+ /* Patch submitted by Philipp Friedrich <philipp@void.at> */
+ UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100,
+ "Kyocera",
+--- a/drivers/usb/storage/usb.c
++++ b/drivers/usb/storage/usb.c
+@@ -482,7 +482,8 @@ void usb_stor_adjust_quirks(struct usb_d
+ US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 |
+ US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE |
+ US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES |
+- US_FL_MAX_SECTORS_240 | US_FL_NO_REPORT_LUNS);
++ US_FL_MAX_SECTORS_240 | US_FL_NO_REPORT_LUNS |
++ US_FL_ALWAYS_SYNC);
+
+ p = quirks;
+ while (*p) {
+@@ -565,6 +566,9 @@ void usb_stor_adjust_quirks(struct usb_d
+ case 'w':
+ f |= US_FL_NO_WP_DETECT;
+ break;
++ case 'y':
++ f |= US_FL_ALWAYS_SYNC;
++ break;
+ /* Ignore unrecognized flag characters */
+ }
+ }
+--- a/include/linux/usb_usual.h
++++ b/include/linux/usb_usual.h
+@@ -81,6 +81,8 @@
+ /* Sets max_sectors to 240 */ \
+ US_FLAG(NO_REPORT_LUNS, 0x10000000) \
+ /* Cannot handle REPORT_LUNS */ \
++ US_FLAG(ALWAYS_SYNC, 0x20000000) \
++ /* lies about caching, so always sync */ \
+
+ #define US_FLAG(name, value) US_FL_##name = value ,
+ enum { US_DO_ALL_FLAGS };
diff --git a/series.conf b/series.conf
index 851a9cfcb7..9e8182d1ed 100644
--- a/series.conf
+++ b/series.conf
@@ -4683,6 +4683,7 @@
patches.drivers/0001-usb-devio-do-not-warn-when-allocation-fails.patch
patches.drivers/0001-kaweth-fix-firmware-download.patch
patches.drivers/0002-kaweth-fix-oops-upon-failed-memory-allocation.patch
+ patches.drivers/0001-scsi-introduce-a-quirk-for-false-cache-reporting.patch
# XEN PVUSB Frontend
patches.drivers/0001-usb-Add-Xen-pvUSB-protocol-description.patch