Skip to contentSkip to conversation

PCI: layerscape: fix index passed to syscon_regmap_lookup_by_phandle_args

PATCH Applied Ioana Ciornei 5 participants 6 messages Mar 27, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: layerscape: fix index passed to syscon_regmap_lookup_by_phandle_args

The arg_count variable passed to the syscon_regmap_lookup_by_phandle_args() function represents the number of argument cells following the phandle. In this case, the number of arguments should be 1 instead of 2 since the dt property looks like below.

	fsl,pcie-scfg = <&scfg 0>;

Without this fix, layerscape-pcie fails with the following message on LS1043A:

[    0.157041] OF: /soc/pcie@3500000: phandle scfg@1570000 needs 2, found 1
[    0.157050] layerscape-pcie 3500000.pcie: No syscfg phandle specified
[    0.157053] layerscape-pcie 3500000.pcie: probe with driver layerscape-pcie failed with error -22
Fixes 149fc35734e5 ("PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args")
---
 drivers/pci/controller/dwc/pci-layerscape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pci-layerscape.c +1 -1
index 239a05b36e8e..a44b5c256d6e 100644
@@ -356,7 +356,7 @@ static int ls_pcie_probe(struct platform_device *pdev)
 	if (pcie->drvdata->scfg_support) {
 		pcie->scfg =
 			syscon_regmap_lookup_by_phandle_args(dev->of_node,
-							     "fsl,pcie-scfg", 2,
+							     "fsl,pcie-scfg", 1,
 							     index);
 		if (IS_ERR(pcie->scfg)) {
 			dev_err(dev, "No syscfg phandle specified\n");
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ioana Ciornei

The arg_count variable passed to the syscon_regmap_lookup_by_phandle_args() function represents the number of argument cells following the phandle. In this case, the number of arguments should be 1 instead of 2 since the dt property looks like below.

	fsl,pcie-scfg = <&scfg 0>;
Quoted 8 lines

Without this fix, layerscape-pcie fails with the following message on LS1043A:

[    0.157041] OF: /soc/pcie@3500000: phandle scfg@1570000 needs 2, found 1
[    0.157050] layerscape-pcie 3500000.pcie: No syscfg phandle specified
[    0.157053] layerscape-pcie 3500000.pcie: probe with driver layerscape-pcie failed with error -22
Fixes 149fc35734e5 ("PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args")

Uh, obviously, probably I thought the code is using of_property_read_u32_index(), but that's of_property_read_u32_array().

Thanks.

Best regards,
Krzysztof

maintainer Acked-by
#2 lore raw
Quoted 24 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>

Quoted 11 lines · Ioana Ciornei

The arg_count variable passed to the syscon_regmap_lookup_by_phandle_args() function represents the number of argument cells following the phandle. In this case, the number of arguments should be 1 instead of 2 since the dt property looks like below.

	fsl,pcie-scfg = <&scfg 0>;

Without this fix, layerscape-pcie fails with the following message on LS1043A:

[    0.157041] OF: /soc/pcie@3500000: phandle scfg@1570000 needs 2,

found 1

Quoted 2 lines
[    0.157050] layerscape-pcie 3500000.pcie: No syscfg phandle specified
[    0.157053] layerscape-pcie 3500000.pcie: probe with driver layerscape-

pcie failed with error -22

Quoted 3 lines
Fixes 149fc35734e5 ("PCI: layerscape: Use

syscon_regmap_lookup_by_phandle_args")

Quoted 6 lines

Uh, obviously, probably I thought the code is using of_property_read_u32_index(), but that's of_property_read_u32_array().

Thanks.

Thank you Ioana for the quick patch fix.

Roy

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Ioana Ciornei
Quoted 10 lines · Ioana Ciornei

The arg_count variable passed to the syscon_regmap_lookup_by_phandle_args() function represents the number of argument cells following the phandle. In this case, the number of arguments should be 1 instead of 2 since the dt property looks like below.

	fsl,pcie-scfg = <&scfg 0>;

Without this fix, layerscape-pcie fails with the following message on LS1043A:

Quoted 7 lines
[    0.157041] OF: /soc/pcie@3500000: phandle scfg@1570000 needs 2, found 1
[    0.157050] layerscape-pcie 3500000.pcie: No syscfg phandle specified
[    0.157053] layerscape-pcie 3500000.pcie: probe with driver layerscape-pcie failed with error -22
Fixes 149fc35734e5 ("PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args")

---

Bjorn:
This is hot fix for some layerscape platform, which block pcie
functions. 149fc35734e5 still in v6.14 next.

Quoted 19 lines
 drivers/pci/controller/dwc/pci-layerscape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pci-layerscape.c +1 -2
index 239a05b36e8e..a44b5c256d6e 100644
@@ -356,7 +356,7 @@ static int ls_pcie_probe(struct platform_device *pdev)
 	if (pcie->drvdata->scfg_support) {
 		pcie->scfg =
 			syscon_regmap_lookup_by_phandle_args(dev->of_node,
-							     "fsl,pcie-scfg", 2,
+							     "fsl,pcie-scfg", 1,
 							     index);
 		if (IS_ERR(pcie->scfg)) {
 			dev_err(dev, "No syscfg phandle specified\n");
--

2.34.1

#4 lore raw
In reply to Ioana Ciornei
Quoted 10 lines · Ioana Ciornei

The arg_count variable passed to the syscon_regmap_lookup_by_phandle_args() function represents the number of argument cells following the phandle. In this case, the number of arguments should be 1 instead of 2 since the dt property looks like below.

	fsl,pcie-scfg = <&scfg 0>;

Without this fix, layerscape-pcie fails with the following message on LS1043A:

Quoted 6 lines
[    0.157041] OF: /soc/pcie@3500000: phandle scfg@1570000 needs 2, found 1
[    0.157050] layerscape-pcie 3500000.pcie: No syscfg phandle specified
[    0.157053] layerscape-pcie 3500000.pcie: probe with driver layerscape-pcie failed with error -22
Fixes 149fc35734e5 ("PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args")

Thanks, applied to pci/controller/layerscape for v6.15. Hopefully the last change for this cycle :)

Thanks for the message sample. I dropped the timestamps because they're not really relevant here.

Quoted 20 lines
---
 drivers/pci/controller/dwc/pci-layerscape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pci-layerscape.c +1 -1
index 239a05b36e8e..a44b5c256d6e 100644
@@ -356,7 +356,7 @@ static int ls_pcie_probe(struct platform_device *pdev)
 	if (pcie->drvdata->scfg_support) {
 		pcie->scfg =
 			syscon_regmap_lookup_by_phandle_args(dev->of_node,
-							     "fsl,pcie-scfg", 2,
+							     "fsl,pcie-scfg", 1,
 							     index);
 		if (IS_ERR(pcie->scfg)) {
 			dev_err(dev, "No syscfg phandle specified\n");
Signature · 1 line
2.34.1
#5 lore raw
Quoted 15 lines · Bjorn Helgaas
Quoted 14 lines · Ioana Ciornei

The arg_count variable passed to the syscon_regmap_lookup_by_phandle_args() function represents the number of argument cells following the phandle. In this case, the number of arguments should be 1 instead of 2 since the dt property looks like below.

	fsl,pcie-scfg = <&scfg 0>;

Without this fix, layerscape-pcie fails with the following message on LS1043A:

[    0.157041] OF: /soc/pcie@3500000: phandle scfg@1570000 needs 2, found 1
[    0.157050] layerscape-pcie 3500000.pcie: No syscfg phandle specified
[    0.157053] layerscape-pcie 3500000.pcie: probe with driver layerscape-pcie failed with error -22
Quoted 8 lines
Quoted 2 lines
Fixes 149fc35734e5 ("PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args")

Thanks, applied to pci/controller/layerscape for v6.15. Hopefully the last change for this cycle :)

Thanks for the message sample. I dropped the timestamps because they're not really relevant here.

I guess this should have a stable tag since 149fc35734e5 appeared in v6.14. I added one.

Quoted 20 lines
Quoted 20 lines
---
 drivers/pci/controller/dwc/pci-layerscape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pci-layerscape.c +1 -1
index 239a05b36e8e..a44b5c256d6e 100644
@@ -356,7 +356,7 @@ static int ls_pcie_probe(struct platform_device *pdev)
 	if (pcie->drvdata->scfg_support) {
 		pcie->scfg =
 			syscon_regmap_lookup_by_phandle_args(dev->of_node,
-							     "fsl,pcie-scfg", 2,
+							     "fsl,pcie-scfg", 1,
 							     index);
 		if (IS_ERR(pcie->scfg)) {
 			dev_err(dev, "No syscfg phandle specified\n");
Signature · 1 line
2.34.1