Skip to content

Commit 68c8edf

Browse files
committed
Merge branch 'pci/edr'
- Specify Revision 6 of the "Enable DPC" _DSM function to match the implementation (Kuppuswamy Sathyanarayanan) - Check for failure of the "Locate Port" _DSM function (Kuppuswamy Sathyanarayanan) * pci/edr: PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3 PCI/EDR: Align EDR_PORT_DPC_ENABLE_DSM with PCI Firmware r3.3
2 parents d539117 + e2e78a2 commit 68c8edf

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

drivers/pci/pcie/edr.c

Lines changed: 17 additions & 11 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;
@@ -85,8 +80,9 @@ static struct pci_dev *acpi_dpc_port_get(struct pci_dev *pdev)
8580
u16 port;
8681

8782
/*
88-
* Behavior when calling unsupported _DSM functions is undefined,
89-
* 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).
9086
*/
9187
if (!acpi_check_dsm(adev->handle, &pci_acpi_dsm_guid, 5,
9288
1ULL << EDR_PORT_LOCATE_DSM))
@@ -103,6 +99,16 @@ static struct pci_dev *acpi_dpc_port_get(struct pci_dev *pdev)
10399
return NULL;
104100
}
105101

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+
106112
/*
107113
* Firmware returns DPC port BDF details in following format:
108114
* 15:8 = bus

0 commit comments

Comments
 (0)