Bug 76291 - xhci-spurious-reboot: system doesn't power off, just reboots
Summary: xhci-spurious-reboot: system doesn't power off, just reboots
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-15 17:09 UTC by Wulf
Modified: 2024-01-24 15:04 UTC (History)
12 users (show)

See Also:
Kernel Version: since 3.14.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments
system-info-files (155.52 KB, application/octet-stream)
2014-05-15 17:09 UTC, Wulf
Details
dmidecode.out (9.60 KB, application/octet-stream)
2014-05-17 23:33 UTC, Wulf
Details
asrock z87 extreme 6 lspci log (11.99 KB, text/plain)
2014-08-03 08:51 UTC, gdl
Details

Description Wulf 2014-05-15 17:09:44 UTC
Created attachment 136231 [details]
system-info-files

issue appers since Kernel 3.14.3, also with Kernel 3.14.4,
issue doesn't appear with Kernel 3.14.2

maybe similar to Bug 66171

issue doesn't appear with disabled USB3.0 in Bios

Mainboard ASRock H87M Pro 4, UEFI-Mode, Arch Linux x84_64

lspci -vvv:
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05) (prog-if 30 [XHCI])
        Subsystem: ASRock Incorporation Device 8c31
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 42
        Region 0: Memory at f0520000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: [70] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+
                Address: 00000000fee00298  Data: 0000
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_hcd

some system information files attached

unloading module xhci_hcd before shut down doesn't fix the problem
Comment 1 Wulf 2014-05-16 22:46:01 UTC
issue appears also with Kernel 3.15.0rc5 :-(
Comment 2 Wulf 2014-05-17 18:50:43 UTC
Arch devs (https://bugs.archlinux.org/task/40382) asked me to bisect kernel, but I'm very unfamiliar with kernel, hardware, Compiling, ... and I didn't know which repository exactly to clone.

Thus I used:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-stable
git bisect bad v3.14.3
git bisect good v3.14.2

My result:

Before last step:
[root@dixi-arch linux-stable]# git bisect bad
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[e7573909b5b8df35591a66146d8629f7aa41675e] xhci: Prevent runtime pm from autosuspending during initialization

After last step:
[root@dixi-arch linux-stable]# git bisect good
5092b2b3c54eeb1a41329661d14289f59f81bdcb is the first bad commit
commit 5092b2b3c54eeb1a41329661d14289f59f81bdcb
Author: Denis Turischev <denis.turischev@compulab.co.il>
Date:   Fri Apr 25 19:20:14 2014 +0300

    xhci: Switch Intel Lynx Point ports to EHCI on shutdown.

    commit c09ec25d3684cad74d851c0f028a495999591279 upstream.

    The same issue like with Panther Point chipsets. If the USB ports are
    switched to xHCI on shutdown, the xHCI host will send a spurious interrupt,
    which will wake the system. Some BIOS have work around for this, but not all.
    One example is Compulab's mini-desktop, the Intense-PC2.

    The bug can be avoided if the USB ports are switched back to EHCI on
    shutdown.

    This patch should be backported to stable kernels as old as 3.12,
    that contain the commit 638298dc66ea36623dbc2757a24fc2c4ab41b016
    "xhci: Fix spurious wakeups after S5 on Haswell"

    Signed-off-by: Denis Turischev <denis@compulab.co.il>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

:040000 040000 e178b761c73619963c1c130805e3722a9ccbdd7d 56b0434140c234293b1a34fb2e1f04fa2fd13d16 M      drivers


I hope this helps
Comment 3 Wulf 2014-05-17 19:00:36 UTC
addendum:

for the .config I used
zcat /proc/config.gz > .config
make localmodconfig

If there were input questions I just presses "enter"
Comment 4 Greg Kroah-Hartman 2014-05-17 19:21:55 UTC
Can you send this to the linux-usb@vger.kernel.org mailing list?
Comment 5 Wulf 2014-05-17 19:40:35 UTC
of course I can - done
Comment 6 Wulf 2014-05-17 23:33:58 UTC
Created attachment 136551 [details]
dmidecode.out

more information
Comment 7 Wulf 2014-05-18 11:59:52 UTC
final comment:

I build a customized Kernel with Arch Stock as basis; with only ONE change:

I deleted

	xhci->quirks |= XHCI_SPURIOUS_REBOOT;

in drivers/usb/host/xhci-pci.c.

and issue disappears -> everything works fine now
Comment 8 Wulf 2014-05-18 12:09:00 UTC
in Line 138, not in Line 121
Comment 9 Elliott Sales de Andrade 2014-05-19 07:20:23 UTC
I'm seeing a similar thing in Fedora with a Gigabyte Z87-D3HP (same series, but different chipset). Doing the change indicated in comment 7 fixes it for me as well.
Comment 10 Wulf 2014-05-21 19:42:53 UTC
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1320282?comments=all

Hmm, is this a Lynx Point or a Lynx Point LP chipset ?

This user needs the "xhci->quirks |= XHCI_SPURIOUS_REBOOT;"-Patch
00:14.0 USB controller [0c03]: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI [8086:8c31] (rev 05) (prog-if 30 [XHCI])
	Subsystem: Lenovo Device [17aa:3097]
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 45
	Region 0: Memory at f7d20000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: <access denied>
	Kernel driver in use: xhci_hcd
Comment 11 kielogl 2014-07-10 05:47:25 UTC
I have same issue with 3.15.3-200.fc20.x86_64 on Asus M5A88-M motherboard, USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller

Any further details needed as input to resolution of this issue?
Comment 12 Wulf 2014-07-10 06:57:08 UTC
I think, it will be fixed in Kernel 3.16
Comment 13 gdl 2014-08-03 08:50:14 UTC
Asrock Z87 Extreme6 - Latest uefi 2.30
Intel Haswell i5 4440s
Arch Linux 3.15.7-1

I have the same problem.

Disabling the USB 3.0 controller, I can shutdown.

Hope it will be fixed in 3.16.
Comment 14 gdl 2014-08-03 08:51:28 UTC
Created attachment 144921 [details]
asrock z87 extreme 6 lspci log
Comment 15 Wulf 2014-08-13 07:22:59 UTC
Today Arch published Kernel 3.16.0 and this problem is fixed (at least for me)
Comment 16 gdl 2014-08-13 10:38:51 UTC
Yes, it's fixed now :)
Comment 17 kielogl 2014-10-17 05:01:23 UTC
The problem is not resolved for me with 3.16.4-200.fc20.x86_64 installed.

With USB 3.0 controller enabled in BIOS, system will not shutdown. It restarts immediately.

With USB 3.0 controller disabled, shutdown works.
Comment 18 matrs 2015-03-11 11:24:30 UTC
I have the same problem , using an Asrock Z87E-ITX, my system is unable to shut down, instead it reboots.

Linux arch-itx 3.18.6-1-ARCH #1 SMP PREEMPT Sat Feb 7 08:44:05 CET 2015 x86_64
Comment 19 sbaragnaus 2015-03-17 18:00:35 UTC
Hi, any news about this bug?

Thanks
Comment 20 matrs 2015-04-02 05:45:41 UTC
Hey, look here


https://bugzilla.kernel.org/show_bug.cgi?id=76291
Comment 21 pci 2015-07-04 21:13:19 UTC
Hi,
I have the same problem with kernel:
 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64
and card:
02:00.0 USB controller: Fresco Logic Device 1100 (prog-if 30 [XHCI])
        Subsystem: Fresco Logic Device 1100
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 16
        Region 0: Memory at fe8f0000 (64-bit, non-prefetchable) [size=64K]
        Region 2: Memory at fe8ef000 (64-bit, non-prefetchable) [size=4K]
        Region 4: Memory at fe8ee000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: [40] Power Management version 3
                Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0+,D1+,D2-,D3hot+,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
                Address: 0000000000000000  Data: 0000
        Capabilities: [70] Express (v2) Endpoint, MSI 00
                DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr- TransPend-
                LnkCap: Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 unlimited
                        ClockPM- Surprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, OBFF Not Supported
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
                LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
                         EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
        Capabilities: [b0] MSI-X: Enable+ Count=8 Masked-
                Vector table: BAR=2 offset=00000000
                PBA: BAR=4 offset=00000000
        Capabilities: [100 v1] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
                AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
        Kernel driver in use: xhci_hcd

regards.
Comment 22 pci 2015-07-04 21:15:36 UTC
I read the file /usr/src/linux-3.18.16/drivers/usb/host/xhci-pci.c and it seems the 3.18.16 won't work may be i'm wrong. I will give it a try.
Comment 23 pci 2015-07-04 21:23:37 UTC
02:00.0 0c03: 1b73:1100 (prog-if 30 [XHCI])
        Subsystem: 1b73:1100
Comment 24 Peter Maciejko 2016-03-08 23:23:01 UTC
Fedora 23, kernel 4.4.3-300. The bug still persists.
Comment 25 Peter Maciejko 2016-03-08 23:28:34 UTC
lspci: http://pastebin.com/phz6if1U
lsusb: http://pastebin.com/uhGAnCLU
lsusb -t: http://pastebin.com/iY1HZrER

Same strange behaviour:
USB 3.0 Controller -> enabled, reboot after shutdown
USB 3.0 Controller -> disabled, works fine

Please, fix it fast, it's very annoying.
Comment 26 Hasan Mahmood 2016-07-22 23:47:06 UTC
Seeing this with Ubuntu 16.04, kernel 4.4.0-31.

Same as above, which XHCI enabled in bios, system reboots after shutdown; shutdown if XHCI is disabled.

Bug status says there is a patch available; has this been resolved?
Comment 27 francois.cid 2016-08-31 14:08:26 UTC
Same as above:

Hardware: Dell Optiplex 9020 with latest bios (A16)
OS: Ubuntu 16.04 & 16.04.1

With USB 3.0 enabled on bios, restart after shutdown
With USB 3.0 disabled on bios, shutdown without restart

Where is the patch ?
Comment 28 AleixMT 2024-01-24 15:04:13 UTC
Hello, I also have spurius reboots in my pc after enabling WoL. I tried quirks but they do not work. I am using Asus ROG X Formula and Ubuntu 22.04

I know this is a bug of the kernel and not of my hardware because I have a dual boot and this does not happen when I am in Windows. 

I would be happy to propose a patch, but it seems that this is a bug that was already solved so before doing anything I would like to understand why this is happening to me and also know if someone can help me fixing it. 

Does anybody have this problem too or similar in 2024?

Thank you everyone.

Also I would like to understand better why this bug can be related with xhci and USB 3.0. In my computer, when I turn off USB 3.0, the error still happens.

Note You need to log in before you can comment on or make changes to this bug.