Bug 216243 - Shutdown successful but machine does not power off
Summary: Shutdown successful but machine does not power off
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Default virtual assignee for Drivers/USB
URL: http://bbs.archlinux.org/viewtopic.ph...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-12 20:56 UTC by bminaker
Modified: 2022-07-20 17:37 UTC (History)
2 users (show)

See Also:
Kernel Version: 5.18.8, 5.18.9, 5.18.10
Subsystem:
Regression: No
Bisected commit-id:


Attachments
journalctl -b -1 --no-pager > log.txt (151.80 KB, text/plain)
2022-07-12 20:56 UTC, bminaker
Details
attachment-13597-0.html (2.30 KB, text/html)
2022-07-20 15:55 UTC, bminaker
Details
dynamic debug on, journalctl -b -1 --no-pager > log.txt (358.59 KB, text/plain)
2022-07-20 17:29 UTC, bminaker
Details

Description bminaker 2022-07-12 20:56:31 UTC
Created attachment 301404 [details]
journalctl -b -1 --no-pager > log.txt

Laptop will not power off with kernel 5.18.8 and above.

Kernel 5.18.10 with 9245c6c1f0095d1e9d7862253680cb1e53e65e76 reverted works as expected.

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

$ git bisect good
9245c6c1f0095d1e9d7862253680cb1e53e65e76 is the first bad commit
commit 9245c6c1f0095d1e9d7862253680cb1e53e65e76
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date:   Thu Jun 23 14:19:43 2022 +0300

    xhci: turn off port power in shutdown
    
    commit 83810f84ecf11dfc5a9414a8b762c3501b328185 upstream.
    
    If ports are not turned off in shutdown then runtime suspended
    self-powered USB devices may survive in U3 link state over S5.
    
    During subsequent boot, if firmware sends an IPC command to program
    the port in DISCONNECT state, it will time out, causing significant
    delay in the boot time.
    
    Turning off roothub port power is also recommended in xhci
    specification 4.19.4 "Port Power" in the additional note.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Link: https://lore.kernel.org/r/20220623111945.1557702-3-mathias.nyman@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 drivers/usb/host/xhci-hub.c |  2 +-
 drivers/usb/host/xhci.c     | 15 +++++++++++++--
 drivers/usb/host/xhci.h     |  2 ++
 3 files changed, 16 insertions(+), 3 deletions(-)
$ git bisect log
git bisect start
# bad: [2437f53721bcd154d50224acee23e7dbb8d8c62b] Linux 5.18.8
git bisect bad 2437f53721bcd154d50224acee23e7dbb8d8c62b
# good: [7afbac05cb1c95e286ce97a40ee1c9f1791446c7] Linux 5.18.7
git bisect good 7afbac05cb1c95e286ce97a40ee1c9f1791446c7
# good: [296692f5fe5965ee8e2f3690abe18815ee8c0d48] regmap-irq: Fix offset/index mismatch in read_sub_irq_data()
git bisect good 296692f5fe5965ee8e2f3690abe18815ee8c0d48
# bad: [d0368d4b1e294dd7ed7e1e678e8c95c906dab338] iio: accel: mma8452: ignore the return value of reset operation
git bisect bad d0368d4b1e294dd7ed7e1e678e8c95c906dab338
# good: [27702e63d2baa759e07084cccac60a00818b5848] s390/crash: add missing iterator advance in copy_oldmem_page()
git bisect good 27702e63d2baa759e07084cccac60a00818b5848
# bad: [d5c672ce67b450889ce7721ebfe7b62905d36a06] btrfs: fix race between reflinking and ordered extent completion
git bisect bad d5c672ce67b450889ce7721ebfe7b62905d36a06
# bad: [d95ac8b920de1d39525fadc408ce675697626ca6] usb: gadget: uvc: fix list double add in uvcg_video_pump
git bisect bad d95ac8b920de1d39525fadc408ce675697626ca6
# bad: [9245c6c1f0095d1e9d7862253680cb1e53e65e76] xhci: turn off port power in shutdown
git bisect bad 9245c6c1f0095d1e9d7862253680cb1e53e65e76
# good: [0e72cea60cb8b6791a194e04cf0abdd57780cd13] s390/crash: make copy_oldmem_page() return number of bytes copied
git bisect good 0e72cea60cb8b6791a194e04cf0abdd57780cd13
# first bad commit: [9245c6c1f0095d1e9d7862253680cb1e53e65e76] xhci: turn off port power in shutdown
Comment 1 joey.corleone 2022-07-20 08:24:45 UTC
Would you mind sharing a new log with xhci dynamic debug enabled as is described here [1]?

Enable the debug output first, then try to reproduce the issue, and finally collect the log file. 

[1] https://lore.kernel.org/linux-usb/9d54d0e4-d2db-3896-301e-9d9048599092@linux.intel.com/T/#m011e17c6eedcf0e8fafbedf60caed1c2e8c7579f
Comment 2 bminaker 2022-07-20 15:55:49 UTC
Created attachment 301463 [details]
attachment-13597-0.html

Sure, I will try, but one question first: once dynamic debug is enabled, and I get the log, how do I disable it? Is it reset at reboot?
________________________________
From: bugzilla-daemon@kernel.org <bugzilla-daemon@kernel.org>
Sent: Wednesday, July 20, 2022 4:24:45 AM
To: Bruce Minaker <bminaker@uwindsor.ca>
Subject: [Bug 216243] Shutdown successful but machine does not power off

https://bugzilla.kernel.org/show_bug.cgi?id=216243

joey.corleone@mail.ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joey.corleone@mail.ru

--- Comment #1 from joey.corleone@mail.ru ---
Would you mind sharing a new log with xhci dynamic debug enabled as is
described here [1]?

Enable the debug output first, then try to reproduce the issue, and finally
collect the log file.

[1]
https://lore.kernel.org/linux-usb/9d54d0e4-d2db-3896-301e-9d9048599092@linux.intel.com/T/#m011e17c6eedcf0e8fafbedf60caed1c2e8c7579f

--
You may reply to this email to add a comment.

You are receiving this mail because:
You reported the bug.
Comment 3 bminaker 2022-07-20 17:29:21 UTC
Created attachment 301464 [details]
dynamic debug on, journalctl -b -1 --no-pager > log.txt

update to latest kernel 5.18.12-arch1-1

echo 'module xhci_hcd =p' >  /sys/kernel/debug/dynamic_debug/control
reboot (machine fails to power off)

journalctl -b -1 --no-pager > log.txt
Comment 4 joey.corleone 2022-07-20 17:37:41 UTC
(In reply to bminaker from comment #2)
> Sure, I will try, but one question first: once dynamic debug is enabled, and
> I get the log, how do I disable it? Is it reset at reboot?

Yes, rebooting will turn off dynamic debug output.

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