Bug 216171

Summary: Hibernation not working because of xhci_hcd
Product: Drivers Reporter: Przemyslaw Kopa (prz.kopa)
Component: USBAssignee: Default virtual assignee for Drivers/USB (drivers_usb)
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.18.6-arch1-1 Subsystem:
Regression: No Bisected commit-id:
Attachments: Dmesg log with failed hibernation attempt
Dmesg with dynamic debug enabled

Description Przemyslaw Kopa 2022-06-25 17:19:46 UTC
Created attachment 301268 [details]
Dmesg log with failed hibernation attempt

Starting from 5.18.4 my notebook (Dell Latitude 3340) won't hibernate - hibernation fails with dmesg errors related to xhci_hcd. I'm attaching dmesg log with failed hibernation attempt. Problem goes away after reverting commit 63acaa8e9c65dc34dc249440216f8e977f5d2748 (USB: hcd-pci: Fully suspend across freeze/thaw cycle). After reverting this commit on linux 5.18.6 my system can again successfully hibernate.
Comment 1 Mathias Nyman 2022-06-27 11:18:41 UTC
On 25.6.2022 20.19, bugzilla-daemon@kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=216171
> 
>              Bug ID: 216171
>             Summary: Hibernation not working because of xhci_hcd
>             Product: Drivers
>             Version: 2.5
>      Kernel Version: 5.18.6-arch1-1
>            Hardware: All
>                  OS: Linux
>                Tree: Mainline
>              Status: NEW
>            Severity: normal
>            Priority: P1
>           Component: USB
>            Assignee: drivers_usb@kernel-bugs.kernel.org
>            Reporter: prz.kopa@gmail.com
>          Regression: No
> 
> Created attachment 301268 [details]
>    --> https://bugzilla.kernel.org/attachment.cgi?id=301268&action=edit
> Dmesg log with failed hibernation attempt
> 
> Starting from 5.18.4 my notebook (Dell Latitude 3340) won't hibernate -
> hibernation fails with dmesg errors related to xhci_hcd. I'm attaching dmesg
> log with failed hibernation attempt. Problem goes away after reverting commit
> 63acaa8e9c65dc34dc249440216f8e977f5d2748 (USB: hcd-pci: Fully suspend across
> freeze/thaw cycle). After reverting this commit on linux 5.18.6 my system can
> again successfully hibernate.
> 

Looks like there is a pending wakeup:

[   30.475168] xhci_hcd 0000:00:14.0: PM: pci_pm_freeze(): hcd_pci_suspend+0x0/0x30 returns -16

Guessing suspend_common() in hcd-pci.c retruns -EBUSY because HCD_WAKEUP_PENDING(hcd) flag is set.

Does xhci dynamic debug show some port event before this?

mount -t debugfs none /sys/kernel/debug
echo 'module xhci_hcd =p' >/sys/kernel/debug/dynamic_debug/control
echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control

Thanks
-Mathias
Comment 2 Przemyslaw Kopa 2022-06-27 12:56:13 UTC
Created attachment 301288 [details]
Dmesg with dynamic debug enabled
Comment 3 Przemyslaw Kopa 2022-06-27 12:57:48 UTC
(In reply to Mathias Nyman from comment #1)

> Guessing suspend_common() in hcd-pci.c retruns -EBUSY because
> HCD_WAKEUP_PENDING(hcd) flag is set.
> 
> Does xhci dynamic debug show some port event before this?

There are a few "Port change events", I attached dmesg log with dynamic debug enabled.