Bug 1278944

Summary: udisksctl power-off not working with all disks
Product: [Fedora] Fedora Reporter: Jean-Christophe Baptiste <jc>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: extras-orphan, gansalmon, itamar, james, jc, jonathan, kernel-maint, labbott, madhu.chinakonda, majzoube, mchehab, wbreyha, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-24 16:02:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jean-Christophe Baptiste 2015-11-06 19:43:10 UTC
Description of problem:

When ejecting a drive, from the GUI (Gnome, XFCE, ...) or using udiskctl, I believe udev is responsible of spinning it down.

Some disks spins down but spins up again immediately, forcing the user to do a hot unplug.

How reproducible:

Steps to Reproduce:
1. Plug in an external USB disk
2. Then eject it or do type udisksctl power-off -b /dev/sdx

Actual results:

Some disk models would spin back up, while others will properly shutdown. 

Expected results:

All disks should spin down.

Additional info:

All my disks are USB 3.
I have 2 Toshiba external hard drive (500 Mo and 1 To) that do spin down correctly.
I have 1 Seagate Slim hard drive of 500 Mo that also shuts down correctly.

But, another Seagate Slim drive of 1To does spin back up.

Also, strangely, all of these disks do spin back up when they are plugged and ejected from behind an USB 3 hub.

Comment 1 Jean-Christophe Baptiste 2016-01-17 07:22:02 UTC
A lot of reports on the Ubuntu side for a similar issue: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/792085

The culprit has not been identified yet, apparently.

Comment 2 Zbigniew Jędrzejewski-Szmek 2016-01-21 14:16:03 UTC
Based on the comments it appears to be drive/chipset specific and maybe some driver issue. Reassigning to the kernel.

Comment 3 James 2016-02-16 20:16:21 UTC
I find this on my enclosures with Asmedia and Norelsys bridges. The JMicron one seems to power down properly.

Comment 4 Jean-Christophe Baptiste 2016-03-28 08:15:43 UTC
James, how did you get this info? lsusb,lshw et hdparm do not seem to provide it.

Comment 5 Jean-Christophe Baptiste 2016-07-23 20:14:48 UTC
Version: 23 → 24

Comment 6 James 2016-07-24 10:03:17 UTC
(In reply to Jean-Christophe Baptiste from comment #4)
> James, how did you get this info? lsusb,lshw et hdparm do not seem to
> provide it.

Sorry for the very late reply. Sometimes the info identifying the bridge chip is in dmesg. Otherwise I look up the USB numeric IDs on Google. This is for generic enclosures only. In my experience, the bridge on the 'complete' big-brand drives have their firmwares and device IDs modified for hide the chip's origin.

Comment 7 Wolfgang Breyha 2016-08-09 09:24:31 UTC
I see this behaviour as well on fully patched Fedora 24 with
kernel-4.6.4-301.fc24.x86_64

I have a LaCie 9223 1TB with USB ID 059f:1070. According to a google search this device uses a ASMedia 1053. 
According to smartctl the HDD is a 
Device Model:     ST1000LM035-1RK172

If connected to USB 3 port on a 
Gigabyte B85M-HD3 with 
00:14.0 8086:8c31 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
or a 
ASUS Z170-P D3 onboard USB port

the drive powers down using "safely remove drive"...
Aug  9 10:56:16 pcwb ntfs-3g[11727]: Unmounting /dev/sdb1 (LaCie-1TB)
Aug  9 10:56:16 pcwb udisksd[1491]: Unmounted /dev/sdb1 on behalf of uid 1000
Aug  9 10:56:16 pcwb udisksd[1491]: Successfully sent SCSI command SYNCHRONIZE CACHE to /dev/sdb
Aug  9 10:56:17 pcwb udisksd[1491]: Successfully sent SCSI command START STOP UNIT to /dev/sdb
Aug  9 10:56:17 pcwb systemd-udevd: inotify_add_watch(9, /dev/sdb1, 10) failed: No such file or directory
Aug  9 10:56:17 pcwb kernel: sd 6:0:0:0: [sdb] Synchronizing SCSI cache
Aug  9 10:56:17 pcwb kernel: sd 6:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
Aug  9 10:56:17 pcwb udisksd[1491]: Powered off /dev/sdb - successfully wrote to sysfs path /sys/devices/pci0000:00/0000:00:14.0/usb4/4
-1/remove
Aug  9 10:56:17 pcwb kernel: usb 4-1: USB disconnect, device number 21

and immediately reappears...
Aug  9 10:56:17 pcwb kernel: usb 4-1: new SuperSpeed USB device number 22 using xhci_hcd
Aug  9 10:56:17 pcwb kernel: usb 4-1: New USB device found, idVendor=059f, idProduct=1070
Aug  9 10:56:17 pcwb kernel: usb 4-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
Aug  9 10:56:17 pcwb kernel: usb 4-1: Product: Porsche Mobile for Mac
Aug  9 10:56:17 pcwb kernel: usb 4-1: Manufacturer: LaCie

Comment 8 Laura Abbott 2016-09-23 19:13:37 UTC
*********** MASS BUG UPDATE **************
 
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 24 kernel bugs.
 
Fedora 24 has now been rebased to 4.7.4-200.fc24.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
 
If you have moved on to Fedora 25, and are still experiencing this issue, please change the version to Fedora 25.
 
If you experience different issues, please open a new bug report for those.

Comment 9 Jean-Christophe Baptiste 2016-10-03 22:45:56 UTC
The bug is still here with latest kernel version.

Comment 10 James 2016-10-04 07:10:33 UTC
(In reply to Jean-Christophe Baptiste from comment #9)
> The bug is still here with latest kernel version.

Confirmed.

Comment 11 Jean-Christophe Baptiste 2016-11-27 17:50:52 UTC
Still in Fedora 25.

Comment 12 Laura Abbott 2017-01-17 01:21:08 UTC
*********** MASS BUG UPDATE **************
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 25 kernel bugs.
 
Fedora 25 has now been rebased to 4.9.3-200.fc25.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
 
If you have moved on to Fedora 26, and are still experiencing this issue, please change the version to Fedora 26.
 
If you experience different issues, please open a new bug report for those.

Comment 13 Wolfgang Breyha 2017-01-23 20:17:00 UTC
Just tested it again with my
LaCie 9223 1TB with USB ID 059f:1070 on USB3 xhci ports of an ASUS Z-170 board and a HP EliteBook 820 G1.

It works now as expected on:
F24: 4.8.16-200.fc24.x86_64
F25: 4.9.3-200.fc25.x86_64

Drive shuts down and disconnects from USB port after selecting "safely remove drive" on MATE desktop and it does not spin up again.

I also tested an older LaCie USB 2.0 drive and it still works as well.

Comment 14 Laura Abbott 2017-01-24 16:02:35 UTC
Thank you for letting us know. I'm going to close this bug. If the problem shows up again, please reopen.

Comment 15 Eric M 2017-05-14 18:43:18 UTC
Same issue on fedora 25 on XPS 15 9560. Running kernel 4.8.6-300.fc25.x86_64

Disk: seagate 1TEAPF-500 (4TB drive)

Other usb drives spin down as expected.

Comment 16 Eric M 2017-05-25 02:48:23 UTC
(In reply to Eric M from comment #15)
> Same issue on fedora 25 on XPS 15 9560. Running kernel 4.8.6-300.fc25.x86_64
> 
> Disk: seagate 1TEAPF-500 (4TB drive)
> 
> Other usb drives spin down as expected.

kernel 4.10.x resolves the issue for me.