lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231213182656.6165-2-mario.limonciello@amd.com>
Date:   Wed, 13 Dec 2023 12:26:55 -0600
From:   Mario Limonciello <mario.limonciello@....com>
To:     Bjorn Helgaas <bhelgaas@...gle.com>,
        "Rafael J . Wysocki" <rjw@...ysocki.net>
CC:     <linux-pci@...r.kernel.org>, <linux-acpi@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        Mario Limonciello <mario.limonciello@....com>,
        <mpearson-lenovo@...ebb.ca>
Subject: [PATCH 1/2] PCI: Avoid runtime resuming devices if system is shutting down

When the system is going to S5 resuming devices is unnecessary at
best and may cause problems for power consumption at S5 at worst.

Check the target `system_state` in the pci driver shutdown() callback
and skip the runtime resume step if the system is being powered off.

Cc: mpearson-lenovo@...ebb.ca
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
 drivers/pci/pci-driver.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 51ec9e7e784f..5a6f7a786952 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -507,7 +507,9 @@ static void pci_device_shutdown(struct device *dev)
 	struct pci_dev *pci_dev = to_pci_dev(dev);
 	struct pci_driver *drv = pci_dev->driver;
 
-	pm_runtime_resume(dev);
+	/* If system will go to S5, don't wake up PCI devices for shutdown */
+	if (system_state != SYSTEM_POWER_OFF)
+		pm_runtime_resume(dev);
 
 	if (drv && drv->shutdown)
 		drv->shutdown(pci_dev);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ