Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Mario Limonciello <mario.limonciello@amd.com>
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 19:55:25 +0200	[thread overview]
Message-ID: <afuAjeWepSkzO12O@wunner.de> (raw)
In-Reply-To: <20260506164353.1278571-1-mario.limonciello@amd.com>

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?

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

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.

Thanks,

Lukas

  reply	other threads:[~2026-05-06 17:55 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 [this message]
2026-05-06 19:16   ` Mario Limonciello
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=afuAjeWepSkzO12O@wunner.de \
    --to=lukas@wunner.de \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --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