Skip to content

Commit f24ba84

Browse files
Kuppuswamy Sathyanarayananbjorn-helgaas
authored andcommitted
PCI/EDR: Align EDR_PORT_DPC_ENABLE_DSM with PCI Firmware r3.3
The "Downstream Port Containment related Enhancements" ECN of Jan 28, 2019 (document 12888 below), defined the EDR_PORT_DPC_ENABLE_DSM function with Revision ID 5 with Arg3 being an integer. But when the ECN was integrated into PCI Firmware r3.3, sec 4.6.12, it was defined as Revision ID 6 with Arg3 being a package containing an integer. The implementation in acpi_enable_dpc() supplies a package as Arg3 (arg4 in the code), but it previously specified Revision ID 5. Align this with PCI Firmware r3.3 by using Revision ID 6. If firmware implemented per the ECN, its Revision 5 function would receive a package as Arg3 when it expects an integer, so acpi_enable_dpc() would likely fail. If such firmware exists and lacks a Revision 6 function that expects a package, we may have to add support for Revision 5. Link: https://lore.kernel.org/r/20240501022543.1626025-1-sathyanarayanan.kuppuswamy@linux.intel.com Link: https://members.pcisig.com/wg/PCI-SIG/document/12888 Fixes: ac1c8e3 ("PCI/DPC: Add Error Disconnect Recover (EDR) support") Signed-off-by: Kuppuswamy Sathyanarayanan <[email protected]> [bhelgaas: split into two patches, update commit log] Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Satish Thatchanamurthy <[email protected]> # one platform
1 parent 4cece76 commit f24ba84

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/pci/pcie/edr.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ static int acpi_enable_dpc(struct pci_dev *pdev)
3232
int status = 0;
3333

3434
/*
35-
* Behavior when calling unsupported _DSM functions is undefined,
36-
* so check whether EDR_PORT_DPC_ENABLE_DSM is supported.
35+
* Per PCI Firmware r3.3, sec 4.6.12, EDR_PORT_DPC_ENABLE_DSM is
36+
* optional. Return success if it's not implemented.
3737
*/
38-
if (!acpi_check_dsm(adev->handle, &pci_acpi_dsm_guid, 5,
38+
if (!acpi_check_dsm(adev->handle, &pci_acpi_dsm_guid, 6,
3939
1ULL << EDR_PORT_DPC_ENABLE_DSM))
4040
return 0;
4141

@@ -46,12 +46,7 @@ static int acpi_enable_dpc(struct pci_dev *pdev)
4646
argv4.package.count = 1;
4747
argv4.package.elements = &req;
4848

49-
/*
50-
* Per Downstream Port Containment Related Enhancements ECN to PCI
51-
* Firmware Specification r3.2, sec 4.6.12, EDR_PORT_DPC_ENABLE_DSM is
52-
* optional. Return success if it's not implemented.
53-
*/
54-
obj = acpi_evaluate_dsm(adev->handle, &pci_acpi_dsm_guid, 5,
49+
obj = acpi_evaluate_dsm(adev->handle, &pci_acpi_dsm_guid, 6,
5550
EDR_PORT_DPC_ENABLE_DSM, &argv4);
5651
if (!obj)
5752
return 0;

0 commit comments

Comments
 (0)