PCI: imx6: Fix i.MX7D controller_id backport regression
Subsystems (4)
cover PCI: imx6: Fix i.MX7D controller_id backport regression
Hello newbies,
This is a test drive.
Hello,
This fixes an i.Mx 7D SoC PCIe regression caused by a backport mistake.
The regression is broken PCIe initialization and for me a boot hang.
I don't know how to organize this. I think a revert and redo best captures what's happening.
To complicate things, it looks like the redo patch could also be applied to 5.4, 5.10, 5.15, and 6.1. But those versions don't have the original backport commit. Version 6.12 matches master and needs no change.
One conflict resolution is needed to apply the redo patch back to versions 6.1 -> 5.15 -> 5.10. One more resolution to apply back to -> 5.4. Patches against those other versions aren't included here.
-- Ryan
Richard Zhu (1):
PCI: imx6: Skip controller_id generation logic for i.MX7D
Ryan Matthews (1):
Revert "PCI: imx6: Skip controller_id generation logic for i.MX7D"
drivers/pci/controller/dwc/pci-imx6.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
base-commit: 814637ca257f4faf57a73fd4e38888cce88b5911
Signature · 1 line
2.47.2
PATCH 1/2 Revert "PCI: imx6: Skip controller_id generation logic for i.MX7D"
This reverts commit 2a12efc567a270a155e3b886258297abd79cdea0 which is commit f068ffdd034c93f0c768acdc87d4d2d7023c1379 upstream.
This is a backport mistake.
Deleting "IMX7D" here skips more than just controller_id logic. It skips reset assignments too, which causes:
imx6q-pcie 33800000.pcie: PCIe PLL lock timeout
In my case, in addition to broken PCIe, kernel boot hangs entirely.
This isn't a problem upstream because before this, they moved the rest of the code out of the switch case.
--- drivers/pci/controller/dwc/pci-imx6.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pci-imx6.c +1 -0
@@ -1281,6 +1281,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)switch (imx6_pcie->drvdata->variant) {case IMX8MQ :case IMX8MQ_EP : +case IMX7D :if (dbi_base->start ==IMX8MQ_PCIE2_BASE_ADDR ) imx6_pcie->controller_id =1 ;
Signature · 1 line
2.47.2
PATCH 2/2 PCI: imx6: Skip controller_id generation logic for i.MX7D
In reply to Ryan MatthewsFrom: Richard Zhu <[email protected]>
[ Upstream commit f068ffdd034c93f0c768acdc87d4d2d7023c1379 ]
The i.MX7D only has one PCIe controller, so controller_id should always be
0. The previous code is incorrect although yielding the correct result.
Fix by removing "IMX7D" from the switch case branch.
[Because this switch case does more than just controller_id
logic, move the "IMX7D" case label instead of removing it entirely.]
--- drivers/pci/controller/dwc/pci-imx6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +2 -2
@@ -1281,10 +1281,10 @@ static int imx6_pcie_probe(struct platform_device *pdev)switch (imx6_pcie->drvdata->variant) {case IMX8MQ :case IMX8MQ_EP : -case IMX7D :if (dbi_base->start ==IMX8MQ_PCIE2_BASE_ADDR ) imx6_pcie->controller_id =1 ; - + fallthrough; +case IMX7D : imx6_pcie->pciephy_reset =devm_reset_control_get_exclusive (dev,"pciephy" );if (IS_ERR (imx6_pcie->pciephy_reset)) {
Signature · 1 line
2.47.2
Quoted 3 lines · Ryan Matthews
Hello newbies,
This is a test drive.
This is a maintainer response.
cover PCI: imx6: Fix i.MX7D controller_id backport regression
Quoted 3 lines · Ryan Matthews
One conflict resolution is needed to apply the redo patch back to versions 6.1 -> 5.15 -> 5.10. One more resolution to apply back to -> 5.4. Patches against those other versions aren't included here.
Quoted 2 lines · Greg Kroah-Hartman
If you want to submit patches for those branches, I'll gladly take them, thanks!
This patch applies to versions 6.1, 5.15, and 5.10.
On these versions I build tested but didn't run test. I have practical access to relevant hardware which runs 6.6 but not the others.
-- Ryan
Richard Zhu (1):
PCI: imx6: Skip controller_id generation logic for i.MX7D
drivers/pci/controller/dwc/pci-imx6.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
base-commit: b6736e03756f42186840724eb38cb412dfb547be
Signature · 1 line
2.47.2
PATCH 1/1 PCI: imx6: Skip controller_id generation logic for i.MX7D
From: Richard Zhu <[email protected]>
[ Upstream commit f068ffdd034c93f0c768acdc87d4d2d7023c1379 ]
The i.MX7D only has one PCIe controller, so controller_id should always be
0. The previous code is incorrect although yielding the correct result.
Fix by removing "IMX7D" from the switch case branch.
[Because this switch case does more than just controller_id
logic, move the "IMX7D" case label instead of removing it entirely.]
--- drivers/pci/controller/dwc/pci-imx6.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +2 -3
@@ -1172,11 +1172,10 @@ static int imx6_pcie_probe(struct platform_device *pdev)if (IS_ERR (imx6_pcie->pcie_aux))return dev_err_probe (dev,PTR_ERR (imx6_pcie->pcie_aux),"pcie_aux clock source missing or invalid\n" ); - fallthrough; -case IMX7D :if (dbi_base->start ==IMX8MQ_PCIE2_BASE_ADDR ) imx6_pcie->controller_id =1 ; - + fallthrough; +case IMX7D : imx6_pcie->pciephy_reset =devm_reset_control_get_exclusive (dev,"pciephy" );if (IS_ERR (imx6_pcie->pciephy_reset)) {
Signature · 1 line
2.47.2
cover PCI: imx6: Fix i.MX7D controller_id backport regression
In reply to Ryan MatthewsQuoted 3 lines · Ryan Matthews
One conflict resolution is needed to apply the redo patch back to versions 6.1 -> 5.15 -> 5.10. One more resolution to apply back to -> 5.4. Patches against those other versions aren't included here.
Quoted 2 lines · Greg Kroah-Hartman
If you want to submit patches for those branches, I'll gladly take them, thanks!
This patch applies to version 5.4.
On this version I build tested but didn't run test. I have practical access to relevant hardware which runs 6.6 but not this.
-- Ryan
Richard Zhu (1):
PCI: imx6: Skip controller_id generation logic for i.MX7D
drivers/pci/controller/dwc/pci-imx6.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
base-commit: 2c8115e4757809ffd537ed9108da115026d3581f
Signature · 1 line
2.47.2
PATCH 1/1 PCI: imx6: Skip controller_id generation logic for i.MX7D
From: Richard Zhu <[email protected]>
[ Upstream commit f068ffdd034c93f0c768acdc87d4d2d7023c1379 ]
The i.MX7D only has one PCIe controller, so controller_id should always be
0. The previous code is incorrect although yielding the correct result.
Fix by removing "IMX7D" from the switch case branch.
[Because this switch case does more than just controller_id
logic, move the "IMX7D" case label instead of removing it entirely.]
--- drivers/pci/controller/dwc/pci-imx6.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +2 -3
@@ -1112,11 +1112,10 @@ static int imx6_pcie_probe(struct platform_device *pdev)dev_err (dev,"pcie_aux clock source missing or invalid\n" );return PTR_ERR (imx6_pcie->pcie_aux); } -/* fall through */ -case IMX7D :if (dbi_base->start ==IMX8MQ_PCIE2_BASE_ADDR ) imx6_pcie->controller_id =1 ; - +/* fall through */ +case IMX7D : imx6_pcie->pciephy_reset =devm_reset_control_get_exclusive (dev,"pciephy" );if (IS_ERR (imx6_pcie->pciephy_reset)) {
Signature · 1 line
2.47.2