From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753996Ab2EHKXn (ORCPT ); Tue, 8 May 2012 06:23:43 -0400 Received: from cpsmtpb-ews10.kpnxchange.com ([213.75.39.15]:2380 "EHLO cpsmtpb-ews10.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751509Ab2EHKXm (ORCPT ); Tue, 8 May 2012 06:23:42 -0400 Message-ID: <1336472476.1933.55.camel@x61.thuisdomein> Subject: [PATCH 2/3] usb-storage: use NO_WP_DETECT for two devices From: Paul Bolle To: Matthew Dharm , Greg Kroah-Hartman Cc: usb-storage@lists.one-eyed-alien.net, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 08 May 2012 12:21:16 +0200 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3 (3.2.3-3.fc16) Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-OriginalArrivalTime: 08 May 2012 10:21:16.0352 (UTC) FILETIME=[4D4B6C00:01CD2D04] X-RcptDomain: vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 * 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