PCI: layerscape: fix index passed to syscon_regmap_lookup_by_phandle_args
Subsystems (4)
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
--- drivers/pci/controller/dwc/pci-layerscape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pci-layerscape.c +1 -1
@@ -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
Quoted 7 lines · Ioana Ciornei
The
arg_countvariable passed to thesyscon_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 -22Fixes 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
Quoted 24 lines
-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>Quoted 11 lines · Ioana Ciornei
The
arg_countvariable passed to thesyscon_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'sof_property_read_u32_array().Thanks.
Reviewed-by Krzysztof Kozlowski <[email protected]>
Thank you Ioana for the quick patch fix.
Roy
Quoted 10 lines · Ioana Ciornei
The
arg_countvariable passed to thesyscon_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 -22Fixes 149fc35734e5 ("PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args")Signed-off-by Ioana Ciornei <[email protected]>---
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@@ -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
Bjorn Helgaas
AppliedQuoted 10 lines · Ioana Ciornei
The
arg_countvariable passed to thesyscon_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 -22Fixes 149fc35734e5 ("PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args")Signed-off-by Ioana Ciornei <[email protected]>
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@@ -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
Quoted 15 lines · Bjorn Helgaas
Quoted 14 lines · Ioana Ciornei
The
arg_countvariable passed to thesyscon_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")Signed-off-by Ioana Ciornei <[email protected]>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@@ -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