Skip to content

Commit 8c251c5

Browse files
ming4lidavejiang
authored andcommitted
cxl/pci: Get AER capability address from RCRB only for RCH dport
cxl_setup_parent_dport() needs to get RCH dport AER capability address from RCRB to disable AER interrupt. The function does not check if dport is RCH dport, it will get a wrong pci_host_bridge structure by dport_dev in VH case because dport_dev points to a pci device(RP or switch DSP) rather than a pci host bridge device. Fixes: f05fd10 ("cxl/pci: Add RCH downstream port AER register discovery") Signed-off-by: Li Ming <[email protected]> Reviewed-by: Dan Williams <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Tested-by: Ira Weiny <[email protected]> Tested-by: Alison Schofield <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent de9c2c6 commit 8c251c5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/cxl/core/pci.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -834,11 +834,13 @@ static void cxl_disable_rch_root_ints(struct cxl_dport *dport)
834834
void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
835835
{
836836
struct device *dport_dev = dport->dport_dev;
837-
struct pci_host_bridge *host_bridge;
838837

839-
host_bridge = to_pci_host_bridge(dport_dev);
840-
if (host_bridge->native_aer)
841-
dport->rcrb.aer_cap = cxl_rcrb_to_aer(dport_dev, dport->rcrb.base);
838+
if (dport->rch) {
839+
struct pci_host_bridge *host_bridge = to_pci_host_bridge(dport_dev);
840+
841+
if (host_bridge->native_aer)
842+
dport->rcrb.aer_cap = cxl_rcrb_to_aer(dport_dev, dport->rcrb.base);
843+
}
842844

843845
dport->reg_map.host = host;
844846
cxl_dport_map_regs(dport);

0 commit comments

Comments
 (0)