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] [day] [month] [year] [list]
Message-Id: <20250605065814.41298-3-zhoushengqing@ttyinfo.com>
Date: Thu,  5 Jun 2025 06:58:14 +0000
From: Zhou Shengqing <zhoushengqing@...info.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Len Brown <lenb@...nel.org>,
	linux-acpi@...r.kernel.org,
	linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	zhoushengqing@...info.com
Subject: [PATCH v6 2/2] PCI/ACPI: Add acpi_check_dsm() for PCI _DSM definitions

Add acpi_check_dsm() for DSM_PCI_POWER_ON_RESET_DELAY and
DSM_PCI_DEVICE_READINESS_DURATIONS.

Signed-off-by: Zhou Shengqing <zhoushengqing@...info.com>
---
 drivers/pci/pci-acpi.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index c49abd03daf0..e3680448b6a1 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -1240,6 +1240,7 @@ bool acpi_pci_need_resume(struct pci_dev *dev)
 
 void acpi_pci_add_bus(struct pci_bus *bus)
 {
+	u64 rev;
 	union acpi_object *obj;
 	struct pci_host_bridge *bridge;
 
@@ -1256,7 +1257,12 @@ void acpi_pci_add_bus(struct pci_bus *bus)
 	if (!pci_is_root_bus(bus))
 		return;
 
-	obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 3,
+	rev = 3;
+	if (!acpi_check_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, rev,
+			BIT(DSM_PCI_POWER_ON_RESET_DELAY)))
+		return;
+
+	obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, rev,
 				      DSM_PCI_POWER_ON_RESET_DELAY, NULL, ACPI_TYPE_INTEGER);
 	if (!obj)
 		return;
@@ -1412,12 +1418,18 @@ static void pci_acpi_optimize_delay(struct pci_dev *pdev,
 {
 	struct pci_host_bridge *bridge = pci_find_host_bridge(pdev->bus);
 	int value;
+	u64 rev;
 	union acpi_object *obj, *elements;
 
 	if (bridge->ignore_reset_delay)
 		pdev->d3cold_delay = 0;
 
-	obj = acpi_evaluate_dsm_typed(handle, &pci_acpi_dsm_guid, 3,
+	rev = 3;
+	if (!acpi_check_dsm(handle, &pci_acpi_dsm_guid, rev,
+				BIT(DSM_PCI_DEVICE_READINESS_DURATIONS)))
+		return;
+
+	obj = acpi_evaluate_dsm_typed(handle, &pci_acpi_dsm_guid, rev,
 				      DSM_PCI_DEVICE_READINESS_DURATIONS, NULL,
 				      ACPI_TYPE_PACKAGE);
 	if (!obj)
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ