USB 3.0 storage safely remove issue: re-detect (re-plug-in) the device(that I have removed already) soon

Bug #1441104 reported by 陈伟琪
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

I have a USB 3.0 Hard Disk, a USB 3.0 Flash storage, and a 4GB micro SD with USB 2.0 SD card. When I unmount devices, they still show up when I execute the command. For example, when I plug in my USB 3.0 flash storage to my PC's USB 3.0 port:
$ df -h
...
/dev/sdc1 30G 17G 13G 57% /media/chen/MyFlash

I ummount it and safely remove it, and run df -h, you will see it:
$ sudo umount /dev/sdc1
...
$ sudo udisks --detach /dev/sdc
$ df -h
...
/dev/sdc1 30G 17G 13G 57% /media/chen/MyFlash

(4)Oops, The issue is an nightmare!! :( Please see the log )
$ sudo lspci -vnvn > lspci-vnvn.usbstorage_usb3.0.log

========================================================
The behavior of my USB 3.0 Hard disk is same.

(1) I plug in my USB 3.0 Hard disk to my pc's USB 3.0 port( the same port ).
(2) My computer detect my storage soon and automatically mount it.
$ df -h
...
/dev/sdc1 932G 205M 932G 1% /media/chen/陈家胜

(3) I ummount it and safely remove it, and run df -h, you will see it:
$ sudo umount /dev/sdc1
[sudo] password for chen:
...
$ sudo udisks --detach /dev/sdc
$ df -h
...
/dev/sdc1 932G 205M 932G 1% /media/chen/陈家胜

(4) :( Please see the log:
$ sudo lspci -vnvn > lspci-vnvn.usbharddisk_usb3.0.log

(5)And I just realize lspci have no information usb storage, so:
$ lsusb > lsusb3.0harddisk.log

(6)I unplug my HD and plug in my storage.
$ lsusb > lsusb3.0storage.log

=====================================================================================
And Have a try that plug in my micro sd card with card reader to USB 3.0 port( the same port ):

(1) plug in my micro sd card , and :
$ df -h
...
/dev/sdd4 3.7G 38M 3.7G 2% /media/chen/DiskGenius
(2) lsusb:
$ lsusb
( because i plug in my USB Storage to another usb 3.0 port, so my sd card is /dev/sdd4 )
( Why i plug in my USB Storage is that i want get string of "Teclast CoolFlash USB3.0" )
( from gnome-disks And I forgot unplug it...)
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 013: ID 13fe:5500 Kingston Technology Company Inc.
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 8087:07dc Intel Corp.
Bus 003 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 003 Device 002: ID 24ae:2000
Bus 003 Device 008: ID 05e3:0723 Genesys Logic, Inc. GL827L SD/MMC/MS Flash Card Reader
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

(3)And then unmount and safely remove my sd card and ... :
chen@chen-Server:~/bug$ df -h
文件系统 容量 已用 可用 已用% 挂载点
...
/dev/sdd4 3.7G 38M 3.7G 2% /media/chen/DiskGenius

chen@chen-Server:~/bug$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 013: ID 13fe:5500 Kingston Technology Company Inc.
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 8087:07dc Intel Corp.
Bus 003 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 003 Device 002: ID 24ae:2000
Bus 003 Device 008: ID 05e3:0723 Genesys Logic, Inc. GL827L SD/MMC/MS Flash Card Reader
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
chen@chen-Server:~/bug$ sudo umount /dev/sdd4
[sudo] password for chen:
chen@chen-Server:~/bug$ sudo udisks --detach /dev/sdc
chen@chen-Server:~/bug$ sudo udisks --detach /dev/sdd
chen@chen-Server:~/bug$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 014: ID 13fe:5500 Kingston Technology Company Inc.
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 8087:07dc Intel Corp.
Bus 003 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 003 Device 002: ID 24ae:2000
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
(You can see I did a mistake, I udisks --detach /dev/sdc ... I hopt that not distract you ...)
(And the led of card reader if off )

===================================================================================================
let's see what happen when I plug in my USB3.0 Flash Storage into USB 2.0 port:

(1)Plug in USB 3.0 Flash storage into USB 2.0 port
chen@chen-Server:~/bug$ df -h
文件系统 容量 已用 可用 已用% 挂载点
...
/dev/sdc1 30G 17G 13G 57% /media/chen/MyFlash
chen@chen-Server:~/bug$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 009: ID 8087:07dc Intel Corp.
Bus 003 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 003 Device 002: ID 24ae:2000
Bus 003 Device 010: ID 13fe:5500 Kingston Technology Company Inc.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
(2)And unmount and safely remove it:
chen@chen-Server:~/bug$ sudo umount /dev/sdc1
chen@chen-Server:~/bug$ sudo udisks --detach /dev/sdc
chen@chen-Server:~/bug$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 009: ID 8087:07dc Intel Corp.
Bus 003 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 003 Device 002: ID 24ae:2000
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
chen@chen-Server:~/bug$
(The led of FLASH storage is off)

=================================================
I have a try again:
I push in USB 3.0 Flash storage into USB 3.0 Port. I unmount and safely remove it.
The led of Flash Storage ==> on ==> off =(after 0.7 second)=> on.
This operation , I won't do it on my Hard Disk......
and it seem some problems with my hard disk [ASMedia Technology Inc. ASMedia 2105 SATA bridge] between usb 2.0 driver ;)

WORKAROUND: In BIOS > Settings > Advanced > USB Configuration change "XHCI Hand-off" to [Disabled].

---
ApportVersion: 2.14.1-0ubuntu3.8
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: chen 1921 F.... pulseaudio
 /dev/snd/controlC0: chen 1921 F.... pulseaudio
CurrentDesktop: Unity
DistroRelease: Ubuntu 14.04
InstallationDate: Installed on 2014-12-18 (109 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
MachineType: MSI MS-7851
Package: linux (not installed)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.13.0-48-generic root=UUID=12124a3b-f21c-46ab-a265-b1f37918e964 ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 3.13.0-48.80-generic 3.13.11-ckt16
RelatedPackageVersions:
 linux-restricted-modules-3.13.0-48-generic N/A
 linux-backports-modules-3.13.0-48-generic N/A
 linux-firmware 1.127.11
Tags: trusty
Uname: Linux 3.13.0-48-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 07/17/2014
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: V3.6
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: B85I (MS-7851)
dmi.board.vendor: MSI
dmi.board.version: 1.0
dmi.chassis.asset.tag: To be filled by O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: MSI
dmi.chassis.version: 1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrV3.6:bd07/17/2014:svnMSI:pnMS-7851:pvr1.0:rvnMSI:rnB85I(MS-7851):rvr1.0:cvnMSI:ct3:cvr1.0:
dmi.product.name: MS-7851
dmi.product.version: 1.0
dmi.sys.vendor: MSI

Revision history for this message
陈伟琪 (gameboy709494) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1441104

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: trusty
Revision history for this message
陈伟琪 (gameboy709494) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
陈伟琪 (gameboy709494) wrote : BootDmesg.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : CRDA.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : CurrentDmesg.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : IwConfig.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : Lspci.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : Lsusb.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : ProcEnviron.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : ProcInterrupts.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : ProcModules.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : Re: USB 3.0 storage safely remove issue: re-detect the device(that I have removed already) soon
Revision history for this message
陈伟琪 (gameboy709494) wrote : PulseList.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : RfKill.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : UdevDb.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : UdevLog.txt

apport information

Revision history for this message
陈伟琪 (gameboy709494) wrote : WifiSyslog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote : Re: USB 3.0 storage safely remove issue: re-detect the device(that I have removed already) soon

陈伟琪, thank you for reporting this and helping make Ubuntu better. Could you please test the latest upstream kernel available from the very top line at the top of the page (the release names are irrelevant for testing, and please do not test the daily folder) following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue.

If the test did not allow you to test to the issue (ex. you couldn't boot into the OS) please make a comment in your report about this, and continue to test the next most recent kernel version until you can test to the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags by clicking on the yellow circle with a black pencil icon, next to the word Tags, located at the bottom of the report description:
kernel-fixed-upstream
kernel-fixed-upstream-3.XY-rcZ

Where XY and Z are numbers corresponding to the kernel version.

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-3.XY-rcZ

Once testing of the upstream kernel is complete, please mark this bug's Status as Confirmed. Please let us know your results.

Thank you for your understanding.

description: updated
tags: added: latest-bios-3.6
Changed in linux (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
陈伟琪 (gameboy709494) wrote :

Bad news.

I installed 3.14.1-031401-generic, which does not fix this issue.

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.14.1-trusty/

Revision history for this message
陈伟琪 (gameboy709494) wrote :

chen@chen-Server:~/bug$ ls *.deb
linux-headers-3.14.1-031401_3.14.1-031401.201404141220_all.deb
linux-headers-3.14.1-031401-generic_3.14.1-031401.201404141220_amd64.deb
linux-image-3.14.1-031401-generic_3.14.1-031401.201404141220_amd64.deb

tags: added: kernel-bug-exists-upstream kernel-bug-exists-upstream-3.14.1-trusty
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

陈伟琪, the latest mainline kernel is 4.0-rc7 (not 3.x).

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
no longer affects: udisks (Ubuntu)
Revision history for this message
陈伟琪 (gameboy709494) wrote :

Ooo.
I thought I may need to install the mainline kernel of the same series of ubuntu.

Revision history for this message
陈伟琪 (gameboy709494) wrote :

Bad news again:

I installed 4.0.0-040000rc7-generic, which does not fix this issue.

tags: added: kernel-bug-exists-upstream-4.0.0-rc7-generic
removed: kernel-bug-exists-upstream-3.14.1-trusty
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

陈伟琪, did this problem not occur in either an earlier kernel, or Ubuntu release?

tags: added: kernel-bug-exists-upstream-4.0-rc7
removed: kernel-bug-exists-upstream-4.0.0-rc7-generic
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
陈伟琪 (gameboy709494-d) wrote :

Yes, Your are right!

This problem not occur in an earlier kernel (I only have ubuntu distribution ).
But I don't remember which version that the problem not occur.

Because I had not use my USB 3.0 device for a long time ...

Revision history for this message
陈伟琪 (gameboy709494-d) wrote :

By the way, What I referring is my USB 3.0 Flash storage, not my USB 3.0 Hard Disk.
That HD I just bought.

I hope I clearly expressed.
OK.

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

陈伟琪, just to clarify, which release was this earlier kernel regarding, 14.04?

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
陈伟琪 (gameboy709494) wrote :

Yes, this earlier kernel (that this issue not occur) is belong to 14.04 release.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
陈伟琪 (gameboy709494) wrote :

As a supplement, I have no idea about the behavior of this issue on other ubuntu release.
Because I have not installed other version of ubuntu into my PC.

Revision history for this message
penalvch (penalvch) wrote :

陈伟琪, the next step is to fully commit bisect from kernel 3.13.0-24 to 3.13.0-48 in order to identify the last good kernel commit, followed immediately by the first bad one. This will allow for a more expedited analysis of the root cause of your issue. Could you please do this following https://wiki.ubuntu.com/Kernel/KernelBisection ?

Please note, finding adjacent kernel versions is not fully commit bisecting.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

tags: added: needs-bisect regression-update
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
陈伟琪 (gameboy709494) wrote :

OK, I think I may need time to learn about kernel bisection.
I will update my status and result here when I make something helpful or useful.

Revision history for this message
陈伟琪 (gameboy709494) wrote :

I clone git:
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-trusty.git
and I build my kernel :

git checkout -b mybisect remote/master
and
git reset --hard 8bb495e3f0240
(I build before ,so i have to reset --hard and run git git clean -f -d )

commit 8bb495e3f02401ee6f76d1b1d77f3ac9f079e376
Author: Linus Torvalds <email address hidden>
Date: Sun Jun 30 15:13:29 2013 -0700

    Linux 3.10

and following https://wiki.ubuntu.com/KernelTeam/GitKernelBuild build my kernel

chen@chen-Server:~/Files/kernel/ubuntu-trusty$ ls ../
linux-firmware-image_3.10.0-custom-1_amd64.deb
linux-headers-3.10.0-custom_3.10.0-custom-1_amd64.deb
linux-image-3.10.0-custom_3.10.0-custom-1_amd64.deb
linux-libc-dev_3.10.0-custom-1_amd64.deb
old
ubuntu-trusty

And This bug still here.
I ran uname -a
Linux chen-Server 3.10.0-custom #1 SMP Tue Apr 14 21:46:54 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
Look, I boot the right kernel.
I must missing something...

I keep looking into it, by booting the live-cd ubuntu, another ways...

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
陈伟琪 (gameboy709494) wrote :

I boot into ubuntu 14.04 LTS live-cd ,and I reproduced this issue successfully.
I am sorry, I probably confuse that the usb 3.0 work normally with ubuntu before, but actually , with windows.

Revision history for this message
陈伟琪 (gameboy709494) wrote :

Now I do-release-upgrade to Ubuntu 14.10 ang do again :
This bug occur on Ubuntu 15.04.

penalvch (penalvch)
tags: added: vivid
Revision history for this message
陈伟琪 (gameboy709494-d) wrote :

It's very odd that other USB 3.0 device does not have this problem. My roommate USB 3.0 hard disk works well on my computer.

But why My USB 3.0 flash storage and USB 3.0 hard disk cause this issue.
troller
Is this issue only happen with some specific hardware : specific USB 3.0 controller chip or USB 3.0 device that suppots USB Attached SCSI Protocol(UASP)

Because My Hard disk is "ASMedia 2105" chip.

But Why My USB 3.0 flash occurs this problem too, I have no ieda...

Revision history for this message
陈伟琪 (gameboy709494-d) wrote :

This bug still "work" for my USB 3.0 devices (storage/hard disk) with USB 3.0 port.

$ uname -a
Linux B85I-Ubuntu 4.2.0-19-generic #23-Ubuntu SMP Wed Nov 11 11:39:30 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/issue
Ubuntu 15.10 \n \l

summary: - USB 3.0 storage safely remove issue: re-detect the device(that I have
- removed already) soon
+ USB 3.0 storage safely remove issue: re-detect (re-plug-in) the
+ device(that I have removed already) soon
penalvch (penalvch)
description: updated
tags: added: bios-outdated-3.7
removed: latest-bios-3.6
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
陈伟琪 (gameboy709494-d) wrote :

$ sudo dmidecode -s bios-version && sudo dmidecode -s bios-release-date
V3.7
03/30/2015

I upgraded the BIOS to v3.7 for a lone time ago。

And The bug still work.

---------------------------------------------------------------------------------
And When i created the bug report, I did not known there is another bug report. I searched "USB 3.0" and I can't find any bug report about the usb 3.0 issue.

I quoted this report in other bug report. Because i found the other bug report from google search days ago...

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
penalvch (penalvch)
tags: added: latest-bios-3.7
removed: bios-outdated-3.7
Changed in linux (Ubuntu):
importance: Low → Medium
status: Confirmed → Incomplete
Revision history for this message
陈伟琪 (gameboy709494-d) wrote :

This bug still "work".

------------------------------------

http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4-rc6-wily/

linux-headers-4.4.0-040400rc6-generic_4.4.0-040400rc6.201512202030_amd64.deb
linux-image-4.4.0-040400rc6-generic_4.4.0-040400rc6.201512202030_amd64.deb
linux-headers-4.4.0-040400rc6_4.4.0-040400rc6.201512202030_all.deb

$ uname -a
Linux B85I-Ubuntu 4.4.0-040400rc6-generic #201512202030 SMP Mon Dec 21 01:32:09 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

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

陈伟琪, this is now pending the results of https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1441104/comments/32 .

tags: added: kernel-bug-exists-upstream-4.4-rc6
removed: kernel-bug-exists-upstream-4.0-rc7
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Hairong Zhu (hrzhu) wrote :

This is probably not related to the kernel. It's rather a bug in udisks that have existed for almost 3 years.
https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/1194608

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
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.