[PATCH 3/3] usb-storage: use NO_WP_DETECT for three devices

From: Paul Bolle
Date: Tue May 08 2012 - 06:22:06 EST


Three USB memory sticks will generate two errors when inserted
[...] No Caching mode page present
[...] Assuming drive cache: write through

These errors are generated by the SCSI stack (and printed thrice). The
first error can be avoided by adding the NO_WP_DETECT quirk for 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@xxxxxxxxxx>
---
Note: I used the coding style of this file, which checkpatch doesn't
like.

drivers/usb/storage/unusual_devs.h | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 2a7b87f..b581c31 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -673,12 +673,18 @@ UNUSUAL_DEV( 0x057b, 0x0022, 0x0000, 0x9999,
"Silicon Media R/W",
USB_SC_DEVICE, USB_PR_DEVICE, NULL, 0),

+UNUSUAL_DEV( 0x058f, 0x6387, 0x0103, 0x0103,
+ "Generic",
+ "Flash Disk",
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+ US_FL_NO_WP_DETECT ),
+
/* Reported by RTE <raszilki@xxxxxxxxx> */
UNUSUAL_DEV( 0x058f, 0x6387, 0x0141, 0x0141,
"JetFlash",
"TS1GJF2A/120",
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
- US_FL_MAX_SECTORS_64 ),
+ US_FL_NO_WP_DETECT | US_FL_MAX_SECTORS_64 ),

/* Fabrizio Fellini <fello@xxxxxxxxx> */
UNUSUAL_DEV( 0x0595, 0x4343, 0x0000, 0x2210,
@@ -1860,6 +1866,12 @@ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x0110,
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_IGNORE_RESIDUE ),

+UNUSUAL_DEV( 0x13fe, 0x1f00, 0x0110, 0x0110,
+ "Walletex",
+ "WalletFlash",
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+ US_FL_NO_WP_DETECT ),
+
/* Reported by Qinglin Ye <yestyle@xxxxxxxxx> */
UNUSUAL_DEV( 0x13fe, 0x3600, 0x0100, 0x0100,
"Kingston",
--
1.7.7.6



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/