Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] USB SDHC Card Reader works, but only if mounted first in WinXP virtual machine
Date: Wed, 28 Jul 2010 14:38:00
Message-Id: AANLkTinn7a0wh4jE3T5fKOyxAVTZhXPtQ2FFF4A1rE9G@mail.gmail.com
1 Hi,
2
3 I have a USB SDHC card reader whose partition table is not read, and
4 device node not created, when plugged into my Gentoo Linux computer. I
5 posted about this a year or two ago but was never able to get it
6 working, until I recently made an accidental discovery:
7
8 If I let a VMWare WinXP take control of the USB device, on the same
9 physical linux machine as above, the card reader mounts normally in
10 the virtual WinXP. Then, if I release the USB device from VMware,
11 Linux takes control of the device back and can read the partition
12 table and creates the device node normally. After that everything
13 works fine, I can copy files to/from etc. and everything seems normal.
14
15 I hope some usb/udev/something guru here can give me a pointer on
16 where to begin tracking down the cause of this. Thanks. :)
17
18 When I plug in the card reader, dmesg tells me this:
19
20 [1637793.709415] usb 2-4: new high speed USB device using ehci_hcd and
21 address 22
22 [1637793.826139] usb 2-4: New USB device found, idVendor=090c, idProduct=6000
23 [1637793.826142] usb 2-4: New USB device strings: Mfr=1, Product=2,
24 SerialNumber=3
25 [1637793.826145] usb 2-4: Product: SM331AB CARD-READER
26 [1637793.826146] usb 2-4: Manufacturer: Silicon Motion,Inc.
27 [1637793.826148] usb 2-4: SerialNumber: 12345678901234567890
28 [1637793.826356] scsi38 : usb-storage 2-4:1.0
29 [1637799.870068] scsi 38:0:0:0: Direct-Access
30 6000 PQ: 0 ANSI: 0 CCS
31 [1637799.870187] sd 38:0:0:0: Attached scsi generic sg8 type 0
32 [1637799.871735] sd 38:0:0:0: [sdg] 62748672 512-byte logical blocks:
33 (32.1 GB/29.9 GiB)
34 [1637799.872307] sd 38:0:0:0: [sdg] Write Protect is off
35 [1637799.872309] sd 38:0:0:0: [sdg] Mode Sense: 4b 00 00 08
36 [1637799.872310] sd 38:0:0:0: [sdg] Assuming drive cache: write through
37 [1637799.874301] sd 38:0:0:0: [sdg] Assuming drive cache: write through
38 [1637799.874303] sdg:
39 [1637800.005993] sd 38:0:0:0: [sdg] Result: hostbyte=0x00 driverbyte=0x08
40 [1637800.005996] sd 38:0:0:0: [sdg] Sense Key : 0x5 [current]
41 [1637800.005998] sd 38:0:0:0: [sdg] ASC=0x21 ASCQ=0x0
42 [1637800.006000] sd 38:0:0:0: [sdg] CDB: cdb[0]=0x28: 28 00 00 00 00
43 00 00 00 08 00
44 [1637800.006004] end_request: I/O error, dev sdg, sector 0
45 [1637800.006006] Buffer I/O error on device sdg, logical block 0
46 [1637800.006881] ldm_validate_partition_table(): Disk read failed.
47 [1637800.006883] unable to read partition table
48 [1637800.008115] sd 38:0:0:0: [sdg] Assuming drive cache: write through
49 [1637800.008117] sd 38:0:0:0: [sdg] Attached SCSI removable disk
50
51
52 Despite dmesg saying unable to read partition table, fdisk -l /dev/sdg
53 shows me the partition anyway:
54
55 Disk /dev/sdg: 32.1 GB, 32127320064 bytes
56 236 heads, 42 sectors/track, 6330 cylinders, total 62748672 sectors
57 Units = sectors of 1 * 512 = 512 bytes
58 Sector size (logical/physical): 512 bytes / 512 bytes
59 I/O size (minimum/optimal): 512 bytes / 512 bytes
60 Disk identifier: 0x00000000
61
62 Device Boot Start End Blocks Id System
63 /dev/sdg1 8192 62748671 31370240 c W95 FAT32 (LBA)
64
65
66 When I let VMware Workstation virtual WinXP session claim the USB
67 device, it shows me this in dmesg when I plug it in:
68 [1639461.856033] usb 2-4: new high speed USB device using ehci_hcd and
69 address 23
70 [1639461.972673] usb 2-4: New USB device found, idVendor=090c, idProduct=6000
71 [1639461.972676] usb 2-4: New USB device strings: Mfr=1, Product=2,
72 SerialNumber=3
73 [1639461.972679] usb 2-4: Product: SM331AB CARD-READER
74 [1639461.972680] usb 2-4: Manufacturer: Silicon Motion,Inc.
75 [1639461.972682] usb 2-4: SerialNumber: 12345678901234567890
76 [1639461.972956] scsi39 : usb-storage 2-4:1.0
77 [1639462.343346] usb 2-4: reset high speed USB device using ehci_hcd
78 and address 23
79 [1639462.459687] scsi40 : usb-storage 2-4:1.0
80 [1639462.607973] usb 2-4: reset high speed USB device using ehci_hcd
81 and address 23
82 [1639462.826673] usb 2-4: usbfs: interface 0 claimed by usb-storage
83 while 'vmware-vmx' sets config #1
84 [1639462.826721] usb 2-4: usbfs: interface 0 claimed by usb-storage
85 while 'vmware-vmx' sets config #1
86
87
88 And when I release the USB device from VMWare back to Linux, dmesg shows this:
89 [1639859.353550] scsi41 : usb-storage 2-4:1.0
90 [1639864.347499] scsi 41:0:0:0: Direct-Access
91 6000 PQ: 0 ANSI: 0 CCS
92 [1639864.347616] sd 41:0:0:0: Attached scsi generic sg8 type 0
93 [1639864.348239] sd 41:0:0:0: [sdg] 62748672 512-byte logical blocks:
94 (32.1 GB/29.9 GiB)
95 [1639864.348757] sd 41:0:0:0: [sdg] Write Protect is off
96 [1639864.348759] sd 41:0:0:0: [sdg] Mode Sense: 4b 00 00 08
97 [1639864.348761] sd 41:0:0:0: [sdg] Assuming drive cache: write through
98 [1639864.350737] sd 41:0:0:0: [sdg] Assuming drive cache: write through
99 [1639864.350740] sdg: sdg1
100 [1639864.354864] sd 41:0:0:0: [sdg] Assuming drive cache: write through
101 [1639864.354866] sd 41:0:0:0: [sdg] Attached SCSI removable disk
102
103
104 From this point the card reader works normally in Linux until I unplug
105 it. Every time I plug it in I must use the above stated virtual WinXP
106 workaround in order to use it.
107
108
109 The lsusb -v of this device:
110
111 Bus 002 Device 023: ID 090c:6000 Feiya Technology Corp.
112 Device Descriptor:
113 bLength 18
114 bDescriptorType 1
115 bcdUSB 2.00
116 bDeviceClass 0 (Defined at Interface level)
117 bDeviceSubClass 0
118 bDeviceProtocol 0
119 bMaxPacketSize0 64
120 idVendor 0x090c Feiya Technology Corp.
121 idProduct 0x6000
122 bcdDevice 1.00
123 iManufacturer 1
124 iProduct 2
125 iSerial 3
126 bNumConfigurations 1
127 Configuration Descriptor:
128 bLength 9
129 bDescriptorType 2
130 wTotalLength 32
131 bNumInterfaces 1
132 bConfigurationValue 1
133 iConfiguration 0
134 bmAttributes 0x80
135 (Bus Powered)
136 MaxPower 500mA
137 Interface Descriptor:
138 bLength 9
139 bDescriptorType 4
140 bInterfaceNumber 0
141 bAlternateSetting 0
142 bNumEndpoints 2
143 bInterfaceClass 8 Mass Storage
144 bInterfaceSubClass 6 SCSI
145 bInterfaceProtocol 80 Bulk (Zip)
146 iInterface 0
147 Endpoint Descriptor:
148 bLength 7
149 bDescriptorType 5
150 bEndpointAddress 0x81 EP 1 IN
151 bmAttributes 2
152 Transfer Type Bulk
153 Synch Type None
154 Usage Type Data
155 wMaxPacketSize 0x0200 1x 512 bytes
156 bInterval 255
157 Endpoint Descriptor:
158 bLength 7
159 bDescriptorType 5
160 bEndpointAddress 0x02 EP 2 OUT
161 bmAttributes 2
162 Transfer Type Bulk
163 Synch Type None
164 Usage Type Data
165 wMaxPacketSize 0x0200 1x 512 bytes
166 bInterval 255
167
168
169 From /proc/bus/usb/devices:
170 T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 23 Spd=480 MxCh= 0
171 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
172 P: Vendor=090c ProdID=6000 Rev= 1.00
173 S: Manufacturer=Silicon Motion,Inc.
174 S: Product=SM331AB CARD-READER
175 S: SerialNumber=12345678901234567890
176 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
177 I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
178 E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
179 E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=31875us

Replies