summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Ming <ming4.li@intel.com>2024-08-09 08:27:49 +0000
committerDave Jiang <dave.jiang@intel.com>2024-08-09 15:13:07 -0700
commit8c251c5ab1b7cd204231e4ee936bfe078a33f234 (patch)
tree6a39c7a55e8ca64dedd86332383ac9a0310bb3dd
parentde9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed (diff)
downloadlinux-stable-8c251c5ab1b7cd204231e4ee936bfe078a33f234.tar.gz
linux-stable-8c251c5ab1b7cd204231e4ee936bfe078a33f234.tar.bz2
linux-stable-8c251c5ab1b7cd204231e4ee936bfe078a33f234.zip
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: f05fd10d138d ("cxl/pci: Add RCH downstream port AER register discovery") Signed-off-by: Li Ming <ming4.li@intel.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Tested-by: Ira Weiny <ira.weiny@intel.com> Tested-by: Alison Schofield <alison.schofield@intel.com> Link: https://patch.msgid.link/20240809082750.3015641-2-ming4.li@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
-rw-r--r--drivers/cxl/core/pci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
index a663e7566c48..51132a575b27 100644
--- a/drivers/cxl/core/pci.c
+++ b/drivers/cxl/core/pci.c
@@ -834,11 +834,13 @@ static void cxl_disable_rch_root_ints(struct cxl_dport *dport)
void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
{
struct device *dport_dev = dport->dport_dev;
- struct pci_host_bridge *host_bridge;
- host_bridge = to_pci_host_bridge(dport_dev);
- if (host_bridge->native_aer)
- dport->rcrb.aer_cap = cxl_rcrb_to_aer(dport_dev, dport->rcrb.base);
+ if (dport->rch) {
+ struct pci_host_bridge *host_bridge = to_pci_host_bridge(dport_dev);
+
+ if (host_bridge->native_aer)
+ dport->rcrb.aer_cap = cxl_rcrb_to_aer(dport_dev, dport->rcrb.base);
+ }
dport->reg_map.host = host;
cxl_dport_map_regs(dport);