All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mario Limonciello" <mario.limonciello@amd.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v3 3/3] PCI: Put PCIe bridges with downstream devices into D3 at hibernate
Date: Mon, 31 Aug 2026 22:20:05 +0000	[thread overview]
Message-ID: <20260831222005.E01051F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260831205533.2325747-4-mario.limonciello@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Hibernation restore skips mandatory PCIe bridge link retraining delays due to snapshot state mismatch, leading to fatal PCIe errors when downstream devices are accessed.
--

commit daecc28d1bb864ce78fb9c9df2c8ecd53a30fb12
Author: Mario Limonciello (AMD) <superm1@kernel.org>

PCI: Put PCIe bridges with downstream devices into D3 at hibernate

This commit aligns the hibernation path with the S3 suspend path by making
pci_pm_poweroff_noirq() use pci_pm_suspend_noirq_common(). This allows PCIe
bridges with downstream devices to enter low-power states like D3cold during
hibernation.

> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index d15b3eb55ec53..a6fb731378d9c 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c

[ ... ]

> @@ -1278,8 +1281,9 @@ static int pci_pm_poweroff_noirq(struct device *dev)
>  			return error;
>  	}
>  
> -	if (!pci_dev->state_saved && !pci_has_subordinate(pci_dev))
> -		pci_prepare_to_sleep(pci_dev);
> +	pci_pm_suspend_noirq_common(pci_dev, &skip_bus_pm);
> +	if (skip_bus_pm)
> +		goto Fixup;

[Severity: High]
Does this cause mandatory PCIe bridge link retraining delays to be skipped on
resume from hibernation?

During hibernation, pci_pm_freeze_noirq() sets the device state to PCI_UNKNOWN
via pci_pm_set_unknown_state() just before the memory snapshot is taken. The
snapshot therefore records the state as PCI_UNKNOWN.

Later in the hibernation process, pci_pm_suspend_noirq_common() powers the
bridge down to D3cold.

On system resume, the boot kernel loads the memory snapshot, reverting the
in-memory state back to PCI_UNKNOWN.

When pci_pm_restore_noirq() executes, it skips the bridge power up actions
because the restored state doesn't match PCI_D3cold:

    if (!skip_bus_pm && prev_state == PCI_D3cold)
        pci_pm_bridge_power_up_actions(pci_dev);

Can this state mismatch lead to downstream device accesses failing with fatal
PCIe errors on resume?

>  
>  	/*
>  	 * The reason for doing this here is the same as for the analogous code

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260831205533.2325747-1-mario.limonciello@amd.com?part=3

  reply	other threads:[~2026-08-31 22:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 20:55 [PATCH v3 0/3] Unfiy PCI suspend and hibernate paths Mario Limonciello
2026-08-31 20:55 ` [PATCH v3 1/3] PCI/PM: Split out code from pci_pm_suspend_noirq() into helper Mario Limonciello
2026-08-31 21:49   ` sashiko-bot
2026-09-04 13:03   ` Rafael J. Wysocki (Intel)
2026-08-31 20:55 ` [PATCH v3 2/3] PCI/PM: Run bridge power up actions as part of restore phase Mario Limonciello
2026-08-31 22:06   ` sashiko-bot
2026-08-31 23:51     ` Mario Limonciello
2026-09-04 13:09   ` Rafael J. Wysocki (Intel)
2026-09-04 13:11     ` Rafael J. Wysocki (Intel)
2026-08-31 20:55 ` [PATCH v3 3/3] PCI: Put PCIe bridges with downstream devices into D3 at hibernate Mario Limonciello
2026-08-31 22:20   ` sashiko-bot [this message]
2026-09-01  0:07     ` Mario Limonciello

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=20260831222005.E01051F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --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.