usb-storage: Not Ready: Medium not present after scsi eject command

Bug #1082920 reported by Endre Kollár
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linux
New
Undecided
Unassigned
linux (Ubuntu)
Incomplete
Medium
Unassigned
udisks (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Reproduced this bug on "Daily Build" live cd:
http://cdimage.ubuntu.com/precise/daily/current/

and with the:
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.7-rc6-raring/

kernel.

Plug in the USB stick: (DMESG)
[ 354.732093] usb 2-1: new high-speed USB device number 3 using ehci_hcd
[ 354.907701] Initializing USB Mass Storage driver...
[ 354.907892] scsi6 : usb-storage 2-1:1.0
[ 354.908037] usbcore: registered new interface driver usb-storage
[ 354.908040] USB Mass Storage support registered.
[ 354.909714] usbcore: registered new interface driver uas
[ 355.929718] scsi 6:0:0:0: Direct-Access Kingston DataTraveler 108 PMAP PQ: 0 ANSI: 0 CCS
[ 355.930970] sd 6:0:0:0: Attached scsi generic sg2 type 0
[ 356.706843] sd 6:0:0:0: [sdb] 15646720 512-byte logical blocks: (8.01 GB/7.46 GiB)
[ 356.708571] sd 6:0:0:0: [sdb] Write Protect is off
[ 356.708577] sd 6:0:0:0: [sdb] Mode Sense: 03 41 00 00
[ 356.710320] sd 6:0:0:0: [sdb] No Caching mode page present
[ 356.710326] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 356.716318] sd 6:0:0:0: [sdb] No Caching mode page present
[ 356.716325] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 356.733983] sdb: sdb1
[ 356.739312] sd 6:0:0:0: [sdb] No Caching mode page present
[ 356.739317] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 356.739321] sd 6:0:0:0: [sdb] Attached SCSI removable disk

(System created sdb,sdb1 files, and mounted sdb1 filesystem correctly)

ubuntu@ubuntu:~$ sudo eject /dev/sdb

Unexcepted message(DMESG):
[ 606.780774] sdb: detected capacity change from 8011120640 to 0

Try:
ubuntu@ubuntu:~$ ls /dev/sdb*
/dev/sdb

"sdb1" is missing! Usb stick is useless until plug it in again.

In the later attached eject.log shown(kern.log when eject the device):
[ 651.526383] usb-storage: Command TEST_UNIT_READY (6 bytes)
[ 651.526384] usb-storage: 00 00 00 00 00 00
[ 651.526390] usb-storage: Bulk Command S 0x43425355 T 0x2dd L 0 F 0 Trg 0 LUN 0 CL 6
[ 651.526392] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
[ 651.526468] usb-storage: Status code 0; transferred 31/31
[ 651.526470] usb-storage: -- transfer complete
[ 651.526472] usb-storage: Bulk command transfer result=0
[ 651.526473] usb-storage: Attempting to get CSW...
[ 651.526475] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
[ 651.526589] usb-storage: Status code 0; transferred 13/13
[ 651.526591] usb-storage: -- transfer complete
[ 651.526592] usb-storage: Bulk status result = 0
[ 651.526594] usb-storage: Bulk Status S 0x53425355 T 0x2dd R 0 Stat 0x1
[ 651.526596] usb-storage: -- transport indicates command failure
[ 651.526598] usb-storage: Issuing auto-REQUEST_SENSE
[ 651.526602] usb-storage: Bulk Command S 0x43425355 T 0x2de L 18 F 128 Trg 0 LUN 0 CL 6
[ 651.526604] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
[ 651.526713] usb-storage: Status code 0; transferred 31/31
[ 651.526714] usb-storage: -- transfer complete
[ 651.526716] usb-storage: Bulk command transfer result=0
[ 651.526718] usb-storage: usb_stor_bulk_transfer_sglist: xfer 18 bytes, 1 entries
[ 651.527088] usb-storage: Status code 0; transferred 18/18
[ 651.527091] usb-storage: -- transfer complete
[ 651.527092] usb-storage: Bulk data transfer result 0x0
[ 651.527094] usb-storage: Attempting to get CSW...
[ 651.527096] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
[ 651.527224] usb-storage: Status code 0; transferred 13/13
[ 651.527226] usb-storage: -- transfer complete
[ 651.527228] usb-storage: Bulk status result = 0
[ 651.527230] usb-storage: Bulk Status S 0x53425355 T 0x2de R 0 Stat 0x0
[ 651.527233] usb-storage: -- Result from auto-sense is 0
[ 651.527235] usb-storage: -- code: 0x70, key: 0x2, ASC: 0x3a, ASCQ: 0x0
[ 651.527240] usb-storage: Not Ready: Medium not present
[ 651.527243] usb-storage: scsi cmd done, result=0x2

(This is the first "TEST_UNIT_READY" command fail, Nov 26 16:29:14)

Why affects linux?
Transmit "eject command" to the device.

Why affects udisks?
Set can_eject not correctly.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: linux-image-3.2.0-34-generic 3.2.0-34.53
ProcVersionSignature: Ubuntu 3.2.0-34.53-generic 3.2.33
Uname: Linux 3.2.0-34-generic x86_64
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
AplayDevices:
 **** List of PLAYBACK Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: ALC270 Analog [ALC270 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
ApportVersion: 2.0.1-0ubuntu15
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: ALC270 Analog [ALC270 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: ubuntu 3195 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xd4500000 irq 45'
   Mixer name : 'Realtek ALC270'
   Components : 'HDA:10ec0270,103c1605,00100100'
   Controls : 18
   Simple ctrls : 10
CasperVersion: 1.315
Date: Sun Nov 25 16:28:21 2012
LiveMediaBuild: Ubuntu 12.04.2 LTS "Precise Pangolin" - Release amd64 (20121125)
MachineType: Hewlett-Packard Presario CQ56 Notebook PC
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=(loop)/casper/vmlinuz iso-scan/filename=/precise-desktop-amd64.iso root=(hd0,2) boot=casper quiet splash
RelatedPackageVersions:
 linux-restricted-modules-3.2.0-34-generic N/A
 linux-backports-modules-3.2.0-34-generic N/A
 linux-firmware 1.79.1
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/07/2011
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: F.15
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: 1605
dmi.board.vendor: Hewlett-Packard
dmi.board.version: 90.17
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnHewlett-Packard:bvrF.15:bd04/07/2011:svnHewlett-Packard:pnPresarioCQ56NotebookPC:pvr059D110000002810010000000:rvnHewlett-Packard:rn1605:rvr90.17:cvnHewlett-Packard:ct10:cvrN/A:
dmi.product.name: Presario CQ56 Notebook PC
dmi.product.version: 059D110000002810010000000
dmi.sys.vendor: Hewlett-Packard

Revision history for this message
Endre Kollár (taxy443) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Endre Kollár (taxy443) wrote : Re: Unexpected USB stick capacity change to 0

Compiled the kernel with DEBUG mode.

Revision history for this message
Endre Kollár (taxy443) wrote :
Revision history for this message
Endre Kollár (taxy443) wrote :
Endre Kollár (taxy443)
description: updated
Endre Kollár (taxy443)
summary: - Unexpected USB stick capacity change to 0
+ usb-storage: Not Ready: Medium not present
Revision history for this message
Joseph Salisbury (jsalisbury) wrote : Re: usb-storage: Not Ready: Medium not present

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v3.7 kernel[0] (Not a kernel in the daily directory) and install both the linux-image and linux-image-extra .deb packages.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.7-rc6-raring/

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Endre Kollár (taxy443)
tags: added: kernel-bug-exists-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Endre Kollár (taxy443) wrote :
Revision history for this message
Endre Kollár (taxy443) wrote :
Revision history for this message
Endre Kollár (taxy443) wrote :
Revision history for this message
Endre Kollár (taxy443) wrote :

Theory:
Shown in attachment https://launchpadlibrarian.net/124034268/eject.log the command:
[ 651.526159] usb-storage: Command START_STOP (6 bytes)
[ 651.526160] usb-storage: 1b 00 00 00 02 00

Here the problems begin.
The Load Eject (LoEj) bit is one. "A LoEj bit of one, with the Start bit cleared to zero, instructs the device to eject the media." The device shuts down, but does not stop the "USB storage" infrastructure.

Endre Kollár (taxy443)
description: updated
Endre Kollár (taxy443)
description: updated
Endre Kollár (taxy443)
summary: - usb-storage: Not Ready: Medium not present
+ usb-storage: Not Ready: Medium not present after scsi eject command
Endre Kollár (taxy443)
affects: udisks → udisks (Ubuntu)
Endre Kollár (taxy443)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in udisks (Ubuntu):
status: New → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

Endre Kollár, could you please provide the full computer model as noted on the sticker?

tags: added: needs-full-computer-model needs-upstream-testing regression-potential
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.