Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:35 +0100
commitcd0a52d5ffa04da0365f2b31eda5d59ea9a635a5 (patch)
tree11759a1bd4ee23dd961038c905da4a0b49807f06
parent682a902c485523f788696123ade67c88f4345dc6 (diff)
USB: storage: don't insert sane sense for SPC3+ when bad sense
specified (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-024-USB-storage-don-t-insert-sane-sense-for-SPC3-w.patch50
-rw-r--r--series.conf1
2 files changed, 51 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-024-USB-storage-don-t-insert-sane-sense-for-SPC3-w.patch b/patches.kernel.org/4.20.3-024-USB-storage-don-t-insert-sane-sense-for-SPC3-w.patch
new file mode 100644
index 0000000000..80b9efd4af
--- /dev/null
+++ b/patches.kernel.org/4.20.3-024-USB-storage-don-t-insert-sane-sense-for-SPC3-w.patch
@@ -0,0 +1,50 @@
+From: Icenowy Zheng <icenowy@aosc.io>
+Date: Thu, 3 Jan 2019 11:26:17 +0800
+Subject: [PATCH] USB: storage: don't insert sane sense for SPC3+ when bad
+ sense specified
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: c5603d2fdb424849360fe7e3f8c1befc97571b8c
+
+commit c5603d2fdb424849360fe7e3f8c1befc97571b8c upstream.
+
+Currently the code will set US_FL_SANE_SENSE flag unconditionally if
+device claims SPC3+, however we should allow US_FL_BAD_SENSE flag to
+prevent this behavior, because SMI SM3350 UFS-USB bridge controller,
+which claims SPC4, will show strange behavior with 96-byte sense
+(put the chip into a wrong state that cannot read/write anything).
+
+Check the presence of US_FL_BAD_SENSE when assuming US_FL_SANE_SENSE on
+SPC4+ devices.
+
+Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
+Cc: stable <stable@vger.kernel.org>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/usb/storage/scsiglue.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
+index e227bb5b794f..101ebac43c87 100644
+--- a/drivers/usb/storage/scsiglue.c
++++ b/drivers/usb/storage/scsiglue.c
+@@ -235,8 +235,12 @@ static int slave_configure(struct scsi_device *sdev)
+ if (!(us->fflags & US_FL_NEEDS_CAP16))
+ sdev->try_rc_10_first = 1;
+
+- /* assume SPC3 or latter devices support sense size > 18 */
+- if (sdev->scsi_level > SCSI_SPC_2)
++ /*
++ * assume SPC3 or latter devices support sense size > 18
++ * unless US_FL_BAD_SENSE quirk is specified.
++ */
++ if (sdev->scsi_level > SCSI_SPC_2 &&
++ !(us->fflags & US_FL_BAD_SENSE))
+ us->fflags |= US_FL_SANE_SENSE;
+
+ /*
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index bbba5d8f74..0ff39583eb 100644
--- a/series.conf
+++ b/series.conf
@@ -261,6 +261,7 @@
patches.kernel.org/4.20.3-021-ARM-davinci-dm644x-evm-fix-label-names-in-GPIO.patch
patches.kernel.org/4.20.3-022-ARM-davinci-da830-evm-fix-label-names-in-GPIO-.patch
patches.kernel.org/4.20.3-023-usb-cdc-acm-send-ZLP-for-Telit-3G-Intel-based-.patch
+ patches.kernel.org/4.20.3-024-USB-storage-don-t-insert-sane-sense-for-SPC3-w.patch
########################################################
# Build fixes that apply to the vanilla kernel too.