Skip to contentSkip to conversation

PCI: imx6: Fix i.MX7D controller_id backport regression

PATCH In review Ryan Matthews 3 participants 11 messages May 4, 2025 – May 8, 2025

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

cover PCI: imx6: Fix i.MX7D controller_id backport regression

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
#1 lore raw

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
index 822a750b064b..20c8f2cba453 100644
@@ -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
maintainer
#2 lore raw

Re: [PATCH 6.6 1/2] Revert "PCI: imx6: Skip controller_id generation logic for i.MX7D"

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected. No action required from the submitter.

The upstream commit SHA1 provided is correct: f068ffdd034c93f0c768acdc87d4d2d7023c1379

WARNING: Author mismatch between patch and upstream commit:
Backport author: Ryan Matthews<[email protected]> Commit author: Richard Zhu<[email protected]>

Status in newer kernel trees:
6.14.y | Present (exact SHA1)
6.12.y | Present (different SHA1: d0f8c566464d)

Note: The patch differs from the upstream commit:
---

1:  f068ffdd034c9 < -:  ------------- PCI: imx6: Skip controller_id generation logic for i.MX7D
-:  ------------- > 1:  ca4fa020c1b07 Revert "PCI: imx6: Skip controller_id generation logic for i.MX7D"

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.6.y        |  Success    |  Success   |
#3 lore raw

PATCH 2/2 PCI: imx6: Skip controller_id generation logic for i.MX7D

In reply to Ryan Matthews

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +2 -2
index 20c8f2cba453..cedfbd425863 100644
@@ -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
maintainer
#4 lore raw

Re: [PATCH 6.6 2/2] PCI: imx6: Skip controller_id generation logic for i.MX7D

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected. No action required from the submitter.

The upstream commit SHA1 provided is correct: f068ffdd034c93f0c768acdc87d4d2d7023c1379

WARNING: Author mismatch between patch and upstream commit:
Backport author: Ryan Matthews<[email protected]> Commit author: Richard Zhu<[email protected]>

Status in newer kernel trees:
6.14.y | Present (exact SHA1)
6.12.y | Present (different SHA1: d0f8c566464d)

Note: The patch differs from the upstream commit:
---

1:  f068ffdd034c9 < -:  ------------- PCI: imx6: Skip controller_id generation logic for i.MX7D
-:  ------------- > 1:  6f456b8c64c73 PCI: imx6: Skip controller_id generation logic for i.MX7D

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.12.y       |  Success    |  Success   |
#5 lore raw
In reply to Ryan Matthews
Quoted 9 lines · Ryan Matthews

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.

Quoted 7 lines

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.

If you want to submit patches for those branches, I'll gladly take them, thanks!

greg k-h

#6 lore raw

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
#7 lore raw

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
index a3acf144a40d..4f20094faee5 100644
@@ -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
#8 lore raw

cover PCI: imx6: Fix i.MX7D controller_id backport regression

In reply to Greg Kroah-Hartman
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 version 5.4 only.

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
#9 lore raw

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
index 30c259f63239..86cdd27cdd3b 100644
@@ -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
maintainer
#10 lore raw

Re: [PATCH 5.4 1/1] PCI: imx6: Skip controller_id generation logic for i.MX7D

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected. No action required from the submitter.

The upstream commit SHA1 provided is correct: f068ffdd034c93f0c768acdc87d4d2d7023c1379

WARNING: Author mismatch between patch and upstream commit:
Backport author: Ryan Matthews<[email protected]> Commit author: Richard Zhu<[email protected]>

Status in newer kernel trees:
6.14.y | Present (exact SHA1)
6.12.y | Present (different SHA1: d0f8c566464d)
6.6.y | Present (different SHA1: 8f5a9b5cc102)
6.1.y | Not found
5.15.y | Not found
5.10.y | Not found

Note: The patch differs from the upstream commit:
---

1:  f068ffdd034c9 < -:  ------------- PCI: imx6: Skip controller_id generation logic for i.MX7D
-:  ------------- > 1:  34963c5f41fd6 PCI: imx6: Skip controller_id generation logic for i.MX7D

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.4.y        |  Success    |  Success   |