From cac1620e9b9fe03af9735767c48f983a3e71c4c4 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Apr 16 2024 08:57:48 +0000 Subject: PCI/PM: Power up all devices during runtime resume (git-fixes). --- diff --git a/patches.suse/PCI-PM-Power-up-all-devices-during-runtime-resume.patch b/patches.suse/PCI-PM-Power-up-all-devices-during-runtime-resume.patch new file mode 100644 index 0000000..884b14a --- /dev/null +++ b/patches.suse/PCI-PM-Power-up-all-devices-during-runtime-resume.patch @@ -0,0 +1,44 @@ +From: "Rafael J. Wysocki" +Date: Fri, 8 Apr 2022 20:29:01 +0200 +Subject: PCI/PM: Power up all devices during runtime resume +Git-commit: 9a6058312ea941bac3b0ba8c963d7543fc42a288 +Patch-mainline: 5.19-rc1 +References: git-fixes + +Currently, endpoint devices may not be powered up entirely during runtime +resume that follows a D3hot -> D0 transition of the parent bridge. + +Namely, even if the power state of an endpoint device, as indicated by its +PCI_PM_CTRL register, is D0 after powering up its parent bridge, it may be +still necessary to bring its ACPI companion into D0 and that should be done +before accessing it. However, the current code assumes that reading the +PCI_PM_CTRL register is sufficient to establish the endpoint device's power +state, which may lead to problems. + +Address that by forcing a power-up of all PCI devices, including the +platform firmware part of it, during runtime resume. + +Link: https://lore.kernel.org/linux-pm/11967527.O9o76ZdvQC@kreacher +Fixes: 5775b843a619 ("PCI: Restore config space on runtime resume despite being unbound") +Link: https://lore.kernel.org/r/2652115.mvXUDI8C0e@kreacher +Reported-by: Abhishek Sahu +Tested-by: Abhishek Sahu +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Bjorn Helgaas +Reviewed-by: Mika Westerberg +Signed-off-by: Jiri Slaby +--- + drivers/pci/pci-driver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pci/pci-driver.c ++++ b/drivers/pci/pci-driver.c +@@ -1354,7 +1354,7 @@ static int pci_pm_runtime_resume(struct + * to a driver because although we left it in D0, it may have gone to + * D3cold when the bridge above it runtime suspended. + */ +- pci_restore_standard_config(pci_dev); ++ pci_pm_default_resume_early(pci_dev); + + if (!pci_dev->driver) + return 0; diff --git a/series.conf b/series.conf index 7aec0a0..192fd47 100644 --- a/series.conf +++ b/series.conf @@ -63420,6 +63420,7 @@ patches.suse/ocfs2-dlmfs-fix-error-handling-of-user_dlm_destroy_l.patch patches.suse/PCI-AER-Clear-MULTI_ERR_COR-UNCOR_RCV-bits.patch patches.suse/PCI-ACPI-Allow-D3-only-if-Root-Port-can-signal-and-w.patch + patches.suse/PCI-PM-Power-up-all-devices-during-runtime-resume.patch patches.suse/PCI-qcom-Fix-runtime-PM-imbalance-on-probe-errors.patch patches.suse/nvdimm-Allow-overwrite-in-the-presence-of-disabled-d-bb7b.patch patches.suse/x86-mce-relocate-set-clear-_mce_nospec-functions.patch