From patchwork Thu Mar 13 10:06:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhou Shengqing X-Patchwork-Id: 14014625 X-Patchwork-Delegate: bhelgaas@google.com Received: from out28-123.mail.aliyun.com (out28-123.mail.aliyun.com [115.124.28.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBAC926562B; Thu, 13 Mar 2025 10:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741860459; cv=none; b=TFR2h3juYBj1UgUkjXtDzfWxWmiGnQ3BRJroRtlcs/Q2/lyp4rEr7TU8nrvAqJKRzfvqXxIUYVVzAjjOjCzLriSSD5VXyX7OgRfMvDSCmbco3xUp32svHFkz3NRklN6GkBFAlYpngJD7BdLtSwANa0XJ0TZtaCWdx7b4wjqTYBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741860459; c=relaxed/simple; bh=rFOy1+Pmit0NR8mxZhaIt3FG7jfOXL965z3BZnrsP2c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CEdqsPB2jb0CJpB7DBYT4S/qq3F3NEH+6xahRnSyDflfBPnhfGH1piI2CpalP3PkYUHNtHJi1JcHXrxIPqd4WBAjPgr73eJ+OESKd2q0MkGQM9P7on0M2Y4+8syW7aWbHivz5Kx1oWVfYJ72c7r4wIowT5VbpU/FCH81In6sBoU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ttyinfo.com; spf=pass smtp.mailfrom=ttyinfo.com; arc=none smtp.client-ip=115.124.28.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ttyinfo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ttyinfo.com Received: from tzl..(mailfrom:zhoushengqing@ttyinfo.com fp:SMTPD_---.bsXubLz_1741860439 cluster:ay29) by smtp.aliyun-inc.com; Thu, 13 Mar 2025 18:07:27 +0800 From: Zhou Shengqing To: Bjorn Helgaas Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, rafael@kernel.org, zhoushengqing@ttyinfo.com Subject: [PATCH v5 2/2] Add acpi_check_dsm() for PCI _DSM definitions Date: Thu, 13 Mar 2025 10:06:56 +0000 Message-Id: <20250313100658.15805-2-zhoushengqing@ttyinfo.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250313100658.15805-1-zhoushengqing@ttyinfo.com> References: <20250313100658.15805-1-zhoushengqing@ttyinfo.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 add acpi_check_dsm() for DSM_PCI_POWER_ON_RESET_DELAY, DSM_PCI_DEVICE_READINESS_DURATIONS. Signed-off-by: Zhou Shengqing --- drivers/pci/pci-acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 4f9e0548c96d..47caad28a133 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -1257,6 +1257,10 @@ void acpi_pci_add_bus(struct pci_bus *bus) if (!pci_is_root_bus(bus)) return; + if (!acpi_check_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 3, + BIT(DSM_PCI_POWER_ON_RESET_DELAY))) + return; + obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 3, DSM_PCI_POWER_ON_RESET_DELAY, NULL, ACPI_TYPE_INTEGER); if (!obj) @@ -1418,6 +1422,10 @@ static void pci_acpi_optimize_delay(struct pci_dev *pdev, if (bridge->ignore_reset_delay) pdev->d3cold_delay = 0; + if (!acpi_check_dsm(handle, &pci_acpi_dsm_guid, 3, + BIT(DSM_PCI_DEVICE_READINESS_DURATIONS))) + return; + obj = acpi_evaluate_dsm_typed(handle, &pci_acpi_dsm_guid, 3, DSM_PCI_DEVICE_READINESS_DURATIONS, NULL, ACPI_TYPE_PACKAGE);