pci: pcie_dw_qcom: fix BDF-to-SID table never getting programmed
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
@@ -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
Quoted 33 lines · Sumit Singh Dhami
From: Senthilkumar <[email protected]>
qcom_pcie_probe()does not setpriv->ops, so theof_matchtable's per-SoCconfig_sid()callback is not invoked byqcom_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->opsfrom theof_match.data viadev_get_driver_data(), as the qcom_pcie_ids[] table already intends.Signed-off-by Senthilkumar <[email protected]>Signed-off-by Sumit Singh Dhami <[email protected]>--- drivers/pci/pcie_dw_qcom.c | 3 +++ 1 file changed, 3 insertions(+)drivers/pci/pcie_dw_qcom.c +3
-0@@ -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