From: "Rogério Brito" <rbrito@ime.usp.br>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Robert Hancock <hancockrwd@gmail.com>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: [PATCH] usb-storage: include USB drive in unusual_devs list
Date: Mon, 25 May 2009 12:13:14 -0300 [thread overview]
Message-ID: <20090525151313.GA2246@ime.usp.br> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0905242226570.15195-100000@netrider.rowland.org>
Hi again, Alan.
And thank you very much for your valuable (and always enlightening) comments.
On May 24 2009, Alan Stern wrote:
> I see the problem. It's a bug in the Prolific drive. The drive says
> that it has removable media, which is not true. Then when the computer
> tells the drive to lock the media in place, the drive reports an error.
> And it doesn't use the proper error code, so the computer doesn't
> know what went wrong.
Hummm, that's bad. :-(
> You can test this by setting a "quirks" option for usb-storage, to tell
> it that the Prolific drive does not understand the "Lock" command:
>
> modprobe usb-storage quirks=67b:2316:L
Well, I did that, but it, unfortunately, didn't seem to work:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
chagas:~# dmesg | tail -n 45; cat /sys/module/usb_storage/parameters/quirks; lsusb
[ 2703.243277] Driver 'sd' needs updating - please use bus_type methods
[ 2703.243433] PM: Adding info for No Bus:0:0:0:0
[ 2703.249091] sd 0:0:0:0: [sda] 256000 512-byte hardware sectors: (131 MB/125 MiB)
[ 2703.252061] sd 0:0:0:0: [sda] Write Protect is off
[ 2703.252067] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[ 2703.252071] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 2703.252123] PM: Adding info for No Bus:sda
[ 2703.259056] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2703.259061] : Sense Key : 0x0 [current]
[ 2703.259067] : ASC=0x0 ASCQ=0x0
[ 2703.267025] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 2703.267032] sda: sda1
[ 2703.273099] PM: Adding info for No Bus:sda1
[ 2703.278056] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2703.278061] : Sense Key : 0x0 [current]
[ 2703.278067] : ASC=0x0 ASCQ=0x0
[ 2703.278171] PM: Adding info for No Bus:8:0
[ 2703.278195] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 2703.300019] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2703.300026] : Sense Key : 0x0 [current]
[ 2703.300033] : ASC=0x0 ASCQ=0x0
[ 2703.603961] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2703.603968] : Sense Key : 0x0 [current]
[ 2703.603974] : ASC=0x0 ASCQ=0x0
[ 2703.671981] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2703.671988] : Sense Key : 0x0 [current]
[ 2703.671994] : ASC=0x0 ASCQ=0x0
[ 2703.693975] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2703.693981] : Sense Key : 0x0 [current]
[ 2703.693987] : ASC=0x0 ASCQ=0x0
[ 2703.703974] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2703.703981] : Sense Key : 0x0 [current]
[ 2703.703987] : ASC=0x0 ASCQ=0x0
[ 2704.006895] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2704.006902] : Sense Key : 0x0 [current]
[ 2704.006908] : ASC=0x0 ASCQ=0x0
[ 2704.016920] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2704.016927] : Sense Key : 0x0 [current]
[ 2704.016933] : ASC=0x0 ASCQ=0x0
[ 2704.318865] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2704.318871] : Sense Key : 0x0 [current]
[ 2704.318878] : ASC=0x0 ASCQ=0x0
[ 2704.366850] sd 0:0:0:0: ioctl_internal_command return code = 8000002
[ 2704.366857] : Sense Key : 0x0 [current]
[ 2704.366863] : ASC=0x0 ASCQ=0x0
67b:2316:L
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 004: ID 067b:2316 Prolific Technology, Inc. Flash Disk Security Device
Bus 004 Device 003: ID 067b:2317 Prolific Technology, Inc. Mass Storage Device
Bus 004 Device 002: ID 067b:2315 Prolific Technology, Inc. Flash Disk Embedded Hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
chagas:~#
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> If that eliminates the errors, we can add a permanent quirk entry for
> this device.
I can test whatever you want me to, so that this can be fixed. The above
lsusb log shows that, perhaps, the quirks option should be set for the
device 067b:2317, instead of 067b:2316, as you told me to?
(I'm going to verify it right now).
Yes, that works. Using 67b:2317:L as a quirk eliminates the messages.
And I do get the
[ 3454.054150] usb-storage 4-2.1:1.0: Quirks match for vid 067b pid 2317: 80
message. Therefore, a proposal:
This patch adds a quirk entry for the Leading Driver UD-11
usb flash drive.
As Alan Stern told me, the device doesn't deal correctly with
the locking media feature of the device, and this patch
incorporates it.
Compiled, tested, working.
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
---
The US_PR_DEVICE macro could be changed to US_PR_CBI, from what
I saw in the udevadm info tree.
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -838,6 +838,19 @@ UNUSUAL_DEV( 0x066f, 0x8000, 0x0001, 0x0
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_FIX_CAPACITY ),
+/* Reported by Rogério Brito <rbrito@ime.usp.br> */
+/* 'lsusb' tells:
+ * "Prolific Technology, Inc. Mass Storage Device"
+ * but 'udevadm info' says:
+ * ATTR{manufacturer}=="Leading Driver Co.,LTD."
+ * ATTR{product}=="USB Mass Storage Device"
+ */
+UNUSUAL_DEV( 0x067b, 0x2317, 0x0001, 0x001,
+ "Prolific Technology, Inc.",
+ "Mass Storage Device",
+ US_SC_DEVICE, US_PR_DEVICE, NULL,
+ US_FL_NOT_LOCKABLE ),
+
/* Reported by Richard -=[]=- <micro_flyer@hotmail.com> */
/* Change to bcdDeviceMin (0x0100 to 0x0001) reported by
* Thomas Bartosik <tbartdev@gmx-topmail.de> */
Actually, I just ventured myself and created a patch, attached (sorry, I
know that people don't like attached patches, but I don't want to mix
Thank you so much as always, Rogério Brito.
--
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org
next prev parent reply other threads:[~2009-05-25 15:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-21 11:10 [2.6.30-rc2] usb reset during big file transfer and ext3 error Rogério Brito
2009-04-22 0:34 ` Robert Hancock
2009-04-22 22:06 ` Rogério Brito
2009-04-23 2:53 ` Alan Stern
2009-05-01 9:15 ` Rogério Brito
2009-05-01 19:16 ` Alan Stern
2009-05-24 7:16 ` Rogério Brito
2009-05-24 14:40 ` Alan Stern
2009-05-24 15:32 ` ioctl_internal_command messages (was: Re: [2.6.30-rc2] usb reset during big file transfer and ext3 error) Rogério Brito
2009-05-24 16:11 ` [2.6.30-rc2] usb reset during big file transfer and ext3 error Rogério Brito
2009-05-25 2:34 ` Alan Stern
2009-05-25 15:13 ` Rogério Brito [this message]
2009-05-25 21:03 ` [PATCH] usb-storage: include USB drive in unusual_devs list Alan Stern
2009-05-25 21:41 ` Rogério Brito
2009-08-01 18:30 ` Rogério Brito
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=20090525151313.GA2246@ime.usp.br \
--to=rbrito@ime.usp.br \
--cc=hancockrwd@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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