Skip to content

Commit e2e78a2

Browse files
Kuppuswamy Sathyanarayananbjorn-helgaas
authored andcommitted
PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3
The "Downstream Port Containment related Enhancements" ECN of Jan 28, 2019 (document 12888 below), defined the EDR_PORT_LOCATE_DSM function with Revision ID 5 with a return value encoding (Bits 2:0 = Function, Bits 7:3 = Device, Bits 15:8 = Bus). When the ECN was integrated into PCI Firmware r3.3, sec 4.6.13, Bit 31 was added to indicate success or failure. Check Bit 31 for failure in acpi_dpc_port_get(). 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 f24ba84 commit e2e78a2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/pci/pcie/edr.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ static struct pci_dev *acpi_dpc_port_get(struct pci_dev *pdev)
8080
u16 port;
8181

8282
/*
83-
* Behavior when calling unsupported _DSM functions is undefined,
84-
* so check whether EDR_PORT_DPC_ENABLE_DSM is supported.
83+
* If EDR_PORT_LOCATE_DSM is not implemented under the target of
84+
* EDR, the target is the port that experienced the containment
85+
* event (PCI Firmware r3.3, sec 4.6.13).
8586
*/
8687
if (!acpi_check_dsm(adev->handle, &pci_acpi_dsm_guid, 5,
8788
1ULL << EDR_PORT_LOCATE_DSM))
@@ -98,6 +99,16 @@ static struct pci_dev *acpi_dpc_port_get(struct pci_dev *pdev)
9899
return NULL;
99100
}
100101

102+
/*
103+
* Bit 31 represents the success/failure of the operation. If bit
104+
* 31 is set, the operation failed.
105+
*/
106+
if (obj->integer.value & BIT(31)) {
107+
ACPI_FREE(obj);
108+
pci_err(pdev, "Locate Port _DSM failed\n");
109+
return NULL;
110+
}
111+
101112
/*
102113
* Firmware returns DPC port BDF details in following format:
103114
* 15:8 = bus

0 commit comments

Comments
 (0)