Skip to contentSkip to conversation

pci: pcie_dw_qcom: fix BDF-to-SID table never getting programmed

PATCH In review Sumit Singh Dhami 2 participants 2 messages Nov 4 – Nov 5 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: pcie_dw_qcom: fix BDF-to-SID table never getting programmed

From: Senthilkumar <[email protected]>

qcom_pcie_probe() does not set priv->ops, so the of_match table's per-SoC config_sid() callback is not invoked by qcom_pcie_init_port(). As a result, the RC's BDF-to-SID table remains unprogrammed and every endpoint's DMA is tagged with SID 0 instead of the SID from its own iommu-map entry, causing intermittent DMA failures on SMMU configs that fault unmatched streams (USFCFG=1).

Set priv->ops from the of_match .data via dev_get_driver_data(), as the qcom_pcie_ids[] table already intends.

---
 drivers/pci/pcie_dw_qcom.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/pci/pcie_dw_qcom.c +3 -0
index ce6b4d97d1d..dd69d8b99da 100644
@@ -489,6 +489,9 @@ static int qcom_pcie_probe(struct udevice *dev)
 	priv->dw.first_busno = dev_seq(dev);
 	priv->dw.dev = dev;
 
+	/* Wire up the per-SoC ops so qcom_pcie_init_port() can call config_sid() */
+	priv->ops = (struct qcom_pcie_ops *)dev_get_driver_data(dev);
+
 	ret = qcom_pcie_parse_dt(dev);
 	if (ret)
 		return ret;

base-commit: 3973f3c4d24df75ca90d7c0a9f03e5e5c9b48f32

Signature · 2 lines
Best regards
Sumit Singh Dhami
Reviewed-by on v1 1/1
#1 lore raw
Quoted 33 lines · Sumit Singh Dhami

From: Senthilkumar <[email protected]>

qcom_pcie_probe() does not set priv->ops, so the of_match table's per-SoC config_sid() callback is not invoked by qcom_pcie_init_port(). As a result, the RC's BDF-to-SID table remains unprogrammed and every endpoint's DMA is tagged with SID 0 instead of the SID from its own iommu-map entry, causing intermittent DMA failures on SMMU configs that fault unmatched streams (USFCFG=1).

Set priv->ops from the of_match .data via dev_get_driver_data(), as the qcom_pcie_ids[] table already intends.

---
  drivers/pci/pcie_dw_qcom.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/pci/pcie_dw_qcom.c +3 -0
index ce6b4d97d1d..dd69d8b99da 100644
@@ -489,6 +489,9 @@ static int qcom_pcie_probe(struct udevice *dev)
  	priv->dw.first_busno = dev_seq(dev);
  	priv->dw.dev = dev;
 
+	/* Wire up the per-SoC ops so qcom_pcie_init_port() can call config_sid() */
+	priv->ops = (struct qcom_pcie_ops *)dev_get_driver_data(dev);
+
  	ret = qcom_pcie_parse_dt(dev);
  	if (ret)
  		return ret;
Quoted 1 line

base-commit: 3973f3c4d24df75ca90d7c0a9f03e5e5c9b48f32

Thanks,
Neil