[ASRock H87 Pro4] My computer reboots instead of shutdown

Bug #1579542 reported by Peter Maciejko
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

I go to drop-down system menu and choose "Shut down..." my computer goes poweroff but after two, maybe three seconds it starts booting process automatically.

WORKAROUND: In the BIOS set Keyboard Power On to True, Mouse Power On to True, or set both to True.

WORKAROUND: In the BIOS set USB 3.0 Controller option in UEFI to DISABLE. This option impacts performance.

WOKRAROUND: (Note this stopped working after an unknown event) Execute via a terminal to shutdown:
echo -n "0000:00:14.0" > /sys/bus/pci/drivers/xhci_hcd/unbind && poweroff

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-4.4.0-22-generic 4.4.0-22.39
ProcVersionSignature: Ubuntu 4.4.0-22.39-generic 4.4.8
Uname: Linux 4.4.0-22-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC2: corsseir 1818 F.... pulseaudio
 /dev/snd/pcmC0D0p: corsseir 1818 F...m pulseaudio
 /dev/snd/controlC0: corsseir 1818 F.... pulseaudio
 /dev/snd/controlC1: corsseir 1818 F.... pulseaudio
CurrentDesktop: Unity
Date: Sun May 8 18:41:01 2016
InstallationDate: Installed on 2016-04-21 (16 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
IwConfig:
 enp0s25 no wireless extensions.

 lo no wireless extensions.
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
ProcFB: 0 EFI VGA
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-22-generic.efi.signed root=UUID=ddb69d9b-bdbe-46a8-9071-81c3762158c2 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-4.4.0-22-generic N/A
 linux-backports-modules-4.4.0-22-generic N/A
 linux-firmware 1.157
RfKill:

SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/03/2015
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P2.20
dmi.board.name: H87 Pro4
dmi.board.vendor: ASRock
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP2.20:bd08/03/2015:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnH87Pro4:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.

Revision history for this message
Peter Maciejko (corsseir) 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
Joseph Salisbury (jsalisbury) wrote : Re: My computer reboots instead of shutdown

Did this issue start happening after an update/upgrade? Was there a prior kernel version where you were not having this particular problem?

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.6 kernel[0].

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'.

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/v4.6-rc7-wily/

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
tags: added: kernel-bug-exists-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Peter Maciejko (corsseir) wrote :

Done. Thanks for instructions. Unfortunately, upstream kernel doesnt help.

I have this bug since I switched to a new computer (Ubuntu 14.04). I have already tested Ubuntu 15.10 and Fedora 23. Everywhere the same issue. I reported this bug, because it started to be frustrating. Every time when I want to shutdown my computer, I have to use power button. Besides, if I disable USB 3.0 controller in UEFI settings, issue disappears. Of course, it is not a solution for me, because I need USB 3.0. I believe it is some xhci bug.

Revision history for this message
penalvch (penalvch) wrote :

Peter Maciejko:
1) To clarify https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1579542/comments/4 you tested the upstream kernel with the same computer you originally reported with (not the new one)?
2) Did this problem not occur in a release prior to Xenial?
3) Could you please add the following kernel boot parameter, attempt to shutdown again, and then provide the results untarred/uncompressed:
debug=y

tags: added: kernel-bug-exists-upstream-4.6-rc7 latest-bios-2.20
removed: linux reboot shutdown
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Peter Maciejko (corsseir) wrote :

ad 1) Thats right.
ad 2) This problem occurs since i have bought a new PC - 2 years ago (since Ubuntu 14.04).
ad 3) Attachment.

penalvch (penalvch)
tags: added: trusty
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
dino99 (9d9) wrote :

One of my bios has a 'power' part where i can set some options, like 'reboot' or 'nothing' about poweroff status. Maybe yours is set to 'reboot' in such case.

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

I have set RESTORE ON AC/POWER LOSS option to POWER OFF so nop, but I have noticed something. When I set USB 3.0 Controller option in UEFI to DISABLE, everything is fine - computer goes power off as it should be, but I need this option ENABLE 'cause of performance.

This command:

$echo -n "0000:00:14.0" > /sys/bus/pci/drivers/xhci_hcd/unbind && poweroff

works as well.

My USB tree in attachment as well as lspci.

I think this upstream XHCI bug.

Revision history for this message
Peter Maciejko (corsseir) wrote :

EDIT

I think this bug should has status high 'cause it is really frustrating when you cant just shut down your computer, dont you think so?

Revision history for this message
penalvch (penalvch) wrote :

Peter Maciejko, given you now have two different WORKAROUNDs, it would typically be classified as Low as defined in https://wiki.ubuntu.com/Bugs/Importance .

Despite this, in order for this to be defined as an upstream issue, the latest mainline kernel (4.7-rc4) would need to be tested. Could you please advise?

Revision history for this message
luvr (luc-vanrompaey) wrote :

Running Ubuntu 16.04.
Just tested with v4.8-rc2 mainline build, and the problem remains.

In my case, there are no devices in /sys/bus/pci/drivers/xhci_hcd, so there's nothing to unbind there.
Instead, unbinding the ehci-pci devices made the shutdown work:

echo '0000:00:12.2
0000:00:13.2' > /sys/bus/pci/drivers/ehci-pci/unbind

I'll try and create a system halt script to do this automatically upon each shutdown/ halt.

Revision history for this message
luvr (luc-vanrompaey) wrote :

To make the shutdown work, I created a systemd service that will run whenever the halt.target or the shutdown.target is to be reached. Since I need to unbind the EHCI drivers, I named the service, naturally, 'unbind-ehci-drivers'.

First, I created the '/usr/local/sbin/unbind-ehci-drivers' script, which the service must execute:

-----</usr/local/sbin/unbind-ehci-drivers>-----
#!/bin/sh

DRIVER_DIRECTORY='/sys/bus/pci/drivers/ehci-pci'

cd "${DRIVER_DIRECTORY}"
find -mindepth 1 -maxdepth 1 -name '*:*:*.*' -type l -printf '%f\0' | xargs -I '{}' --null echo '{}' > unbind
-----<srevird-iche-dnibnu/nibs/lacol/rsu/>-----

Next, the '/etc/systemd/system/unbind-ehci-drivers.service' systemd service file:

-----</etc/systemd/system/unbind-ehci-drivers.service>-----
[Unit]
Description=Unbind EHCI drivers upon system shutdown
DefaultDependencies=no
Before=shutdown.target halt.target

[Service]
Type=oneshot
ExecStart=/usr/local/sbin/unbind-ehci-drivers

[Install]
WantedBy=halt.target shutdown.target
-----<ecivres.srevird-iche-dnibnu/metsys/dmetsys/cte/>-----

With these files in place, the following command will enable the service:

root@localhost# systemctl enable unbind-ehci-drivers

Optionally, verify if the service is now enabled:

root@localhost# systemctl is-enabled unbind-ehci-drivers

Two other commands that will show more details about the service:

root@localhost# systemctl --all list-units unbind-ehci-drivers.service
root@localhost# systemctl list-unit-files unbind-ehci-drivers.service

Shutdown works now.
Ref.: 'http://askubuntu.com/questions/416299/execute-command-before-shutdown-reboot', entry "How to Do it with Systemd (it's easier)".

Revision history for this message
luvr (luc-vanrompaey) wrote :

Update:
In file '/etc/systemd/system/unbind-ehci-drivers.service', only the 'halt.target' appears to be required on the 'Before' line:

-----<cut>-----
Before=halt.target
-----<tuc>-----

Also, on the 'WantedBy' line, just 'shutdown.target' is sufficient:

-----<cut>-----
WantedBy=shutdown.target
-----<tuc>-----

Revision history for this message
penalvch (penalvch) wrote :

luvr (luc-vanrompaey), it will help immensely if you filed a new report with the Ubuntu repository kernel (not mainline/upstream) via a terminal:
ubuntu-bug linux

Please feel free to subscribe me to it.

For more on why this is helpful, please see https://wiki.ubuntu.com/ReportingBugs.

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
Revision history for this message
Peter Maciejko (corsseir) wrote :

Bug still persist. Ive tried Ubuntu 16.04 with kernels 4.4.45 and 4.8.6.

xhci_hcd.quirks=262144 and unbind xhci stop working. My computer just keeps rebooting instead of poweroff. I have to switch to Windows. This bug persist since 2013-11-29: https://bugzilla.kernel.org/show_bug.cgi?id=66171. Its a shame for Linux community but this is not my problem anymore. I was waiting 2.5 years, but you dont give a shit about your users.

Revision history for this message
Robert Clark (parminides) wrote :

I have had this problem for awhile. It got worse when I upgraded from 14.04 to 16.04. I haven't tried all the workarounds above yet.

Revision history for this message
penalvch (penalvch) wrote :

Peter Maciejko (corsseir), to keep this relevant to upstream, one would want to periodically check for, and test the latest mainline kernel (now 4.10-rc1) as it is released.

Could you please advise?

tags: added: needs-upstream-testing
removed: kernel-bug-exists-upstream
description: updated
Revision history for this message
penalvch (penalvch) wrote :

Robert Clark (parminides), it will help immensely if you filed a new report with Ubuntu, using the default repository kernel (not mainline/upstream/3rd party) via a terminal:
ubuntu-bug linux

Please feel free to subscribe me to it.

For more on why this is helpful, please see https://wiki.ubuntu.com/ReportingBugs.

Revision history for this message
Peter Maciejko (corsseir) wrote :

I can test 4.10 in Monday 02.01.2017. I don't have much time before this date.

Revision history for this message
Peter Maciejko (corsseir) wrote :

BTW

The first workaround doesnt work anymore, but there is also third workaround. If anyone has the same issue then just go to your BIOS/UEFI settings and set Keyboard Power On or Mouse Power On or both to True, after that poweroff works perfectly. Of course, these options work as they should - computer goes on if you press keyboard key or mouse button.

penalvch (penalvch)
summary: - My computer reboots instead of shutdown
+ [ASRock H87 Pro4] My computer reboots instead of shutdown
penalvch (penalvch)
description: updated
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.