[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1336472476.1933.55.camel@x61.thuisdomein>
Date: Tue, 08 May 2012 12:21:16 +0200
From: Paul Bolle <pebolle@...cali.nl>
To: Matthew Dharm <mdharm-usb@...-eyed-alien.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: usb-storage@...ts.one-eyed-alien.net, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] usb-storage: use NO_WP_DETECT for two devices
Two USB memory sticks will generate two errors when inserted
[...] Asking for cache data failed
[...] Assuming drive cache: write through
These errors are generated by the SCSI stack (and printed thrice).
Adding some printk()s to drivers/scsi/sd.c revealed the header of the
MODE SENSE response was shorter than three bytes. That triggers the
bad_sense error path, which for these two devices prints the "Asking for
cache data failed" error. That error can be avoided by adding the
NO_WP_DETECT quirk to these devices: it will set the skip_ms_page_3f
flag which will make the SCSI code skip MODE SENSE with page=0x3f (and
assume these devices are write enabled)
(The second error can be avoided by downgrading it to a notice, which is
done in a separate commit.)
Signed-off-by: Paul Bolle <pebolle@...cali.nl>
---
Note: I used the coding style of this file, which checkpatch doesn't
like.
drivers/usb/storage/unusual_devs.h | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 856ad92..2a7b87f 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -261,7 +261,7 @@ UNUSUAL_DEV( 0x0457, 0x0151, 0x0100, 0x0100,
"USB 2.0",
"Flash Disk",
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
- US_FL_NOT_LOCKABLE ),
+ US_FL_NOT_LOCKABLE | US_FL_NO_WP_DETECT ),
/* Reported by Tamas Kerecsen <kerecsen@...foot.com>
* Obviously the PROM has not been customized by the VAR;
@@ -1840,6 +1840,12 @@ UNUSUAL_DEV( 0x12d1, 0x143F, 0x0000, 0x0000,
USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
0),
+UNUSUAL_DEV( 0x1307, 0x0163, 0x0100, 0x0100,
+ "P Technology",
+ "USB Mass Storage Device",
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+ US_FL_NO_WP_DETECT ),
+
/* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
UNUSUAL_DEV( 0x132b, 0x000b, 0x0001, 0x0001,
"Minolta",
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists