All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Aviv Bakal" <avivb@amazon.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 1/3] PCI/PM: Honor PCI_DEV_FLAGS_NO_D3 in pci_bridge_d3_possible()
Date: Sun, 15 Nov 2026 17:39:24 +0000	[thread overview]
Message-ID: <sashiko-outbox-215685@kernel.org> (raw)
In-Reply-To: <20261115171831.1498006-2-avivb@amazon.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] PCI/PM: pci_bridge_d3_possible() checks NO_D3 before final
  quirks
--

commit 5fefa5fbcbd02246d38adb690d51a8862ddc1cd4
Author: Aviv Bakal <avivb@amazon.com>

PCI/PM: Honor PCI_DEV_FLAGS_NO_D3 in pci_bridge_d3_possible()

This commit returns false from pci_bridge_d3_possible() when
PCI_DEV_FLAGS_NO_D3 is set on the bridge.

> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 7c6f2aba81443..1a23be4b6a073 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -3055,6 +3055,10 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
>  		if (pci_bridge_d3_disable)
>  			return false;
>  
> +		/* The port is known not to work correctly in D3 */
> +		if (bridge->dev_flags & PCI_DEV_FLAGS_NO_D3)
> +			return false;

[Severity: Medium]
Can this leave bridge->bridge_d3 stuck at true when PCI_DEV_FLAGS_NO_D3 is
set by a DECLARE_PCI_FIXUP_FINAL quirk?

During enumeration, pci_device_add() -> pci_init_capabilities() ->
pci_pm_init() initializes dev->bridge_d3 = pci_bridge_d3_possible(dev)
before final quirks run in pci_bus_add_device() or pci_apply_final_quirks().
When a final quirk such as quirk_plx_pex_no_d3() or quirk_tuxeo_rp_d3()
later sets PCI_DEV_FLAGS_NO_D3 on a port, pci_bridge_d3_possible() flips
from true to false, causing pci_bridge_d3_update() on child devices to return
early without ever clearing bridge->bridge_d3:

drivers/pci/pci.c:pci_bridge_d3_update() {
	bridge = pci_upstream_bridge(dev);
	if (!bridge || !pci_bridge_d3_possible(bridge))
		return;
    ...
}

In addition, when a child device's final quirk (like quirk_tuxeo_rp_d3())
sets PCI_DEV_FLAGS_NO_D3 on its parent Root Port after pcie_portdrv_probe()
has already bound to the port, pci_bridge_d3_possible() returns true during
probe and false during pcie_portdrv_remove() and pcie_portdrv_shutdown(),
leaving runtime PM enabled and skipping the matching pm_runtime_forbid() and
pm_runtime_get_noresume() calls on removal.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115171831.1498006-1-avivb@amazon.com?part=1

  reply	other threads:[~2026-11-15 17:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 17:18 [PATCH 0/3] PCI/PM: Keep hotplug ports that can't wake from D3hot out of D3 Aviv Bakal
2026-11-15 17:18 ` [PATCH 1/3] PCI/PM: Honor PCI_DEV_FLAGS_NO_D3 in pci_bridge_d3_possible() Aviv Bakal
2026-11-15 17:39   ` sashiko-bot [this message]
2026-11-15 17:18 ` [PATCH 2/3] PCI: Avoid runtime D3 on Amazon PCIe switch ports Aviv Bakal
2026-11-15 17:27   ` sashiko-bot
2026-11-15 17:18 ` [PATCH 3/3] PCI/PM: Keep hotplug ports out of D3 if they can't signal PME from D3hot Aviv Bakal
2026-11-15 17:41   ` sashiko-bot
2026-11-15 17:22 ` [PATCH 0/3] PCI/PM: Keep hotplug ports that can't wake from D3hot out of D3 Lukas Wunner
2026-11-16 16:55   ` Aviv Bakal
2026-11-16 17:03     ` Lukas Wunner

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=sashiko-outbox-215685@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=avivb@amazon.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.