Bug 2558

Summary: usb storage does not detect hardware ro mode
Product: Drivers Reporter: Albeiro (albeiro)
Component: USBAssignee: Matthew Dharm (mdharm-usb)
Status: REJECTED INSUFFICIENT_DATA    
Severity: normal CC: greg
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6 Subsystem:
Regression: --- Bisected commit-id:
Attachments: Patch for usb-storage write-protection detect
Test patch

Description Albeiro 2004-04-21 14:24:27 UTC
Distribution:Gentoo Linux
Hardware Environment:kingston usb dongle with ro switch
Software Environment:
Problem Description:i have nice kingston usb dongle. it has write protected
switch. in 2.4 kernel usb storage could detect that dongle is write protected,
printk it and return error on writing request. but 2.6 does not detect it, so it
does not know about ro switch. it allows to write, what ends with many `lost
page` errors and call trace. it is ugly. ro switch should be detected like it was
in 2.4 and futher writing should be disalowed.

Steps to reproduce: trying to write to some hardware write protected usb dongle
will resulyt in this error
Comment 1 Matthew Dharm 2004-04-21 14:42:34 UTC
rebuild your 2.6 kernel with USB Mass Storage Verbose Debugging enabled and send
the logs that it generates showing the r/o detection for analysis.
Comment 2 Alan Stern 2004-04-26 11:58:09 UTC
Created attachment 2726 [details]
Patch for usb-storage write-protection detect

Please try this patch, intended for 2.6.6-rc2 or later.  It enables MODE SENSE
with page=0x3f on USB mass storage devices.  That's what the SCSI disk driver
uses to determine whether the device is write-protected.
Comment 3 Matthew Dharm 2004-05-20 16:16:00 UTC
Created attachment 2932 [details]
Test patch

Here is an updated patch -- please try this.
Comment 4 Matthew Dharm 2004-06-26 18:09:41 UTC
four weeks without response.  closing.