From: Mario Limonciello <superm1@kernel.org>
To: mario.limonciello@amd.com, bhelgaas@google.com,
rafael.j.wysocki@intel.com, huang.ying.caritas@gmail.com,
stern@rowland.harvard.edu
Cc: linux-pci@vger.kernel.org
Subject: [PATCH] PCI: Explicitly put devices into D0 when initializing
Date: Tue, 22 Apr 2025 08:38:09 -0500 [thread overview]
Message-ID: <20250422133944.1940679-1-superm1@kernel.org> (raw)
From: Mario Limonciello <mario.limonciello@amd.com>
AMD BIOS team has root caused an issue that NVME storage failed to come
back from suspend to a lack of a call to _REG when NVME device was probed.
commit 112a7f9c8edbf ("PCI/ACPI: Call _REG when transitioning D-states")
added support for calling _REG when transitioning D-states, but this only
works if the device actually "transitions" D-states.
commit 967577b062417 ("PCI/PM: Keep runtime PM enabled for unbound PCI
devices") added support for runtime PM on PCI devices, but never actually
'explicitly' sets the device to D0.
To make sure that devices are in D0 and that platform methods such as
_REG are called, explicitly set all devices into D0 during initialization.
Fixes: 967577b062417 ("PCI/PM: Keep runtime PM enabled for unbound PCI devices")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
Note: an earlier internal version of this attempted to do this in local_pci_probe()
but this doesn't affect PCI root ports and we need _REG called on the root ports too.
drivers/pci/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 53a070394739a..cd87c8370dede 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3266,6 +3266,7 @@ void pci_pm_init(struct pci_dev *dev)
pci_read_config_word(dev, PCI_STATUS, &status);
if (status & PCI_STATUS_IMM_READY)
dev->imm_ready = 1;
+ pci_set_power_state(dev, PCI_D0);
}
static unsigned long pci_ea_flags(struct pci_dev *dev, u8 prop)
--
2.43.0
next reply other threads:[~2025-04-22 13:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-22 13:38 Mario Limonciello [this message]
2025-04-23 19:12 ` [PATCH] PCI: Explicitly put devices into D0 when initializing Wysocki, Rafael J
2025-04-23 19:30 ` Rafael J. Wysocki
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=20250422133944.1940679-1-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=bhelgaas@google.com \
--cc=huang.ying.caritas@gmail.com \
--cc=linux-pci@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=rafael.j.wysocki@intel.com \
--cc=stern@rowland.harvard.edu \
/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.