[BUG] USB mass storage device incomplete read command sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Usually the kernel reads the pendrive like this:

TEST UNIT READY
READ(10)
...
READ(10)
TEST UNIT READY

But under some conditions, the last TEST UNIT READY is not being sent
and because of that, on this device: Kingston DT 101 G2, the drive's
activity light keeps on blinking even though nothing is being done (no
read/writes/inquiries).

When that happens, manually sending a TEST UNIT READY stops the blinking
and turns off the light.

# sg_turs /dev/sdc

For example this works alright (light blinks for a moment and then it's
off):

# dd if=/dev/sdc of=/dev/null bs=512 count=96

But this doesn't (the light keeps on blinking forever)

# dd if=/dev/sdb of=/dev/null bs=512 count=97

I checked with usbmon and I noticed the lack of the final TEST UNIT
READY in the cases where the light keeps on blinking.

For the tests the drive was unmounted. As soon as I mount it and start
working on it, the light will blink non-stop.

I also tested this with a Raspberry (Linux frambo 4.1.17+ #838 Tue Feb 9
12:57:10 GMT 2016 armv6l GNU/Linux), and the device behaves normally,
that is, blinking stops as soon as traffic stops.


Find attached the pcap file for both cases and part of the kernel dmesg.
This is the kernel with the problem: Linux arbo 4.9.0-4-amd64 #1 SMP
Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 GNU/Linux

Eduardo.

Attachment: dd-512x96.pcapng.gz
Description: application/gzip

Attachment: dd-512x97.pcapng.gz
Description: application/gzip

[10507.724040] usb 6-2: new high-speed USB device number 11 using ehci-pci
[10507.874862] usb 6-2: New USB device found, idVendor=0951, idProduct=1642
[10507.874869] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[10507.874874] usb 6-2: Product: DT 101 G2
[10507.874878] usb 6-2: Manufacturer: Kingston
[10507.874883] usb 6-2: SerialNumber: 001CC0EC3509FBA0E5FA2390
[10507.875478] usb-storage 6-2:1.0: USB Mass Storage device detected
[10507.877087] scsi host5: usb-storage 6-2:1.0
[10508.984943] scsi 5:0:0:0: Direct-Access     Kingston DT 101 G2        1.00 PQ: 0 ANSI: 0 CCS
[10508.985800] sd 5:0:0:0: Attached scsi generic sg2 type 0
[10508.986390] sd 5:0:0:0: [sdb] 15644912 512-byte logical blocks: (8.01 GB/7.46 GiB)
[10508.987281] sd 5:0:0:0: [sdb] Write Protect is off
[10508.987286] sd 5:0:0:0: [sdb] Mode Sense: 0b 00 00 08
[10508.988003] sd 5:0:0:0: [sdb] No Caching mode page found
[10508.988017] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[10508.993180]  sdb: sdb1
[10508.997264] sd 5:0:0:0: [sdb] Attached SCSI removable disk


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux