mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: usb-storage@lists.one-eyed-alien.net, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] usb-storage: use NO_WP_DETECT for two devices
Date: Tue, 08 May 2012 12:21:16 +0200	[thread overview]
Message-ID: <1336472476.1933.55.camel@x61.thuisdomein> (raw)

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





                 reply	other threads:[~2012-05-08 10:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336472476.1933.55.camel@x61.thuisdomein \
    --to=pebolle@tiscali.nl \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mdharm-usb@one-eyed-alien.net \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®