* [PATCH 2/3] usb-storage: use NO_WP_DETECT for two devices
@ 2012-05-08 10:21 Paul Bolle
0 siblings, 0 replies; only message in thread
From: Paul Bolle @ 2012-05-08 10:21 UTC (permalink / raw)
To: Matthew Dharm, Greg Kroah-Hartman; +Cc: usb-storage, linux-usb, linux-kernel
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@tiscali.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@bigfoot.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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-05-08 10:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-08 10:21 [PATCH 2/3] usb-storage: use NO_WP_DETECT for two devices Paul Bolle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®