Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: bhelgaas@google.com,
	"Mario Limonciello (AMD)" <superm1@kernel.org>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: pciehp: Disable link and turn off slot power while removing
Date: Wed, 6 May 2026 14:16:10 -0500	[thread overview]
Message-ID: <9cfc10f8-de54-4af9-8436-35ebeef4faf6@amd.com> (raw)
In-Reply-To: <afuAjeWepSkzO12O@wunner.de>



On 5/6/26 12:55, Lukas Wunner wrote:
> On Wed, May 06, 2026 at 11:43:50AM -0500, Mario Limonciello wrote:
>> When a hotplug slot is removed, pciehp still leaves both the slot and link
>> active. If a device is still physically connected, platform firmware
>> may continue to poll the link. On some systems with Thunderbolt 3 devices
>> connected this prevents the system from shutting down until the device is
>> disconnected.
> 
> "On some systems" is a little vague.  Which ones?  What is platform firmware
> doing there exactly, is this something in AML?

In this case it was a Strix Halo OEM design that I don't have visiblity 
a layer lower.

But issue is specific to Thunderbolt 3 devices, doesn't happen with USB4 
devices with an active PCIe tunnel for some reason.

This doesn't reproduce on the reference designs we tried.

I /might/ be able to get some traces though from a USB4 analyzer with 
OEM design.

> 
>> To fix this add code to pciehp_power_off_slot() to reverse the init
>> sequence from pciehp_power_on_slot() (power on, then enable link becomes
>> disable link, then power off).
> 
> Unfortunately it's not as easy as that.  You're essentially reverting
> commit b1811d2455f3 ("PCI: pciehp: Don't disable the link permanently
> during removal"), so you'll regress those products for which the commit
> deliberately removed link disablement on slot poweroff.

Thanks for that pointer.  Unfortuantely the Link: tag for the discussion 
is HTTP 403.

> 
> Moreover there are products where Presence Detect is hardwired to zero,
> see commit 80696f991424 ("PCI: pciehp: Tolerate Presence Detect hardwired
> to zero").  So we have to rely on a link change to detect that a new device
> has been plugged in after slot poweroff.  That won't work if the link is
> disabled.
> 

How would you feel about turning off link detect somewhere specific to 
the shutdown path?

  reply	other threads:[~2026-05-06 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 16:43 [PATCH] PCI: pciehp: Disable link and turn off slot power while removing Mario Limonciello
2026-05-06 17:55 ` Lukas Wunner
2026-05-06 19:16   ` Mario Limonciello [this message]
2026-05-07  4:26     ` Lukas Wunner
2026-05-07  5:03       ` Mario Limonciello
2026-05-06 20:58 ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9cfc10f8-de54-4af9-8436-35ebeef4faf6@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=superm1@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox