Skip to contentSkip to conversation

New: PCIe drivers do not bind

Bug 219513 Bjorn Helgaas 4 participants 6 messages Nov 19, 2024 1 message not in the archive PCI

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 11 lines · On Tue, Nov 19, 2024 at 12:55:36PM +0000, [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=219513

Hardware: Sparc64
Priority: P3
Reporter: [email protected]
Regression: No

Created attachment 307241
--> https://bugzilla.kernel.org/attachment.cgi?id=307241&action=edit
debug info (some shell commands to check the PCIe devices and drivers)

Quoted 7 lines

In linux-next (next-20241118), since
commit 03cfe0e05650 ("PCI/pwrctl: Ensure that the pwrctl drivers are probed before the PCI client drivers")
PCIe drivers no longer bind (at least on the tested SPARCv9 system).

It appears a "supplier" devlink is created, however it is are dormant. see attached "bug-info.txt"

Thanks for the report. It sounds like you bisected this to 03cfe0e05650? Can you attach a complete dmesg log to the bugzilla?

This commit is queued for v6.13, and the merge window is now open, so if it's a regression, we need to resolve it or drop it ASAP.

#2 lore raw
Quoted 18 lines · Bjorn Helgaas
Quoted 16 lines · On Tue, Nov 19, 2024 at 12:55:36PM +0000, [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=219513

Hardware: Sparc64
Priority: P3
Reporter: [email protected]
Regression: No

Created attachment 307241
--> https://bugzilla.kernel.org/attachment.cgi?id=307241&action=edit
debug info (some shell commands to check the PCIe devices and drivers)

In linux-next (next-20241118), since
commit 03cfe0e05650 ("PCI/pwrctl: Ensure that the pwrctl drivers are probed before the PCI client drivers")
PCIe drivers no longer bind (at least on the tested SPARCv9 system).

Quoted 8 lines
Quoted 2 lines

It appears a "supplier" devlink is created, however it is are dormant. see attached "bug-info.txt"

Thanks for the report. It sounds like you bisected this to 03cfe0e05650? Can you attach a complete dmesg log to the bugzilla?

This commit is queued for v6.13, and the merge window is now open, so if it's a regression, we need to resolve it or drop it ASAP.

Dullfire: is the DTS for this platform publicly available? If not, can you at least post the PCI host controller and all its children nodes here?

Bart

#4 lore raw
In reply to Dullfire
Quoted 35 lines · Dullfire
Quoted 32 lines · Bartosz Golaszewski
Quoted 18 lines · Bjorn Helgaas
Quoted 16 lines · On Tue, Nov 19, 2024 at 12:55:36PM +0000, [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=219513

Hardware: Sparc64
Priority: P3
Reporter: [email protected]
Regression: No

Created attachment 307241
--> https://bugzilla.kernel.org/attachment.cgi?id=307241&action=edit
debug info (some shell commands to check the PCIe devices and drivers)

In linux-next (next-20241118), since
commit 03cfe0e05650 ("PCI/pwrctl: Ensure that the pwrctl drivers are probed before the PCI client drivers")
PCIe drivers no longer bind (at least on the tested SPARCv9 system).

Quoted 8 lines
Quoted 2 lines

It appears a "supplier" devlink is created, however it is are dormant. see attached "bug-info.txt"

Thanks for the report. It sounds like you bisected this to 03cfe0e05650? Can you attach a complete dmesg log to the bugzilla?

This commit is queued for v6.13, and the merge window is now open, so if it's a regression, we need to resolve it or drop it ASAP.

Dullfire: is the DTS for this platform publicly available? If not, can you at least post the PCI host controller and all its children nodes here?

Quoted 8 lines
Quoted 1 line

Bart

Bart: I attached to the bug report a dts extracted from the system.

Just a FYI: SPARC systems (including linux) get their device tree from the open firmware, which likely dynamically generates at least parts of it, so there is not a discrete source for it.

Thanks Jonathan for the dts drop! Looks like the platform devices for the pcie nodes were created elsewhere for the SPARC systems. Could you please test the below diff and see if it fixes the issue?

```
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 7a061cc860d5..e70f4c089cd4 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -394,7 +394,7 @@ void pci_bus_add_device(struct pci_dev *dev)
         * PCI client drivers.
         */
        pdev = of_find_device_by_node(dn);
-       if (pdev) {
+       if (pdev && of_pci_is_supply_present(dn)) {
                if (!device_link_add(&dev->dev, &pdev->dev,
                                     DL_FLAG_AUTOREMOVE_CONSUMER))
                        pci_err(dev, "failed to add device link between %s and %s\n",
```

- Mani

Quoted 2 lines

Regards,
Jonathan Currier

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#3 lore raw
In reply to Bartosz Golaszewski
Quoted 25 lines · Bartosz Golaszewski
Quoted 24 lines · Bjorn Helgaas
Quoted 11 lines · On Tue, Nov 19, 2024 at 12:55:36PM +0000, [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=219513

Hardware: Sparc64
Priority: P3
Reporter: [email protected]
Regression: No

Created attachment 307241
--> https://bugzilla.kernel.org/attachment.cgi?id=307241&action=edit
debug info (some shell commands to check the PCIe devices and drivers)

Quoted 7 lines

In linux-next (next-20241118), since
commit 03cfe0e05650 ("PCI/pwrctl: Ensure that the pwrctl drivers are probed before the PCI client drivers")
PCIe drivers no longer bind (at least on the tested SPARCv9 system).

It appears a "supplier" devlink is created, however it is are dormant. see attached "bug-info.txt"

Thanks for the report. It sounds like you bisected this to 03cfe0e05650? Can you attach a complete dmesg log to the bugzilla?

Quoted 8 lines
Quoted 2 lines

This commit is queued for v6.13, and the merge window is now open, so if it's a regression, we need to resolve it or drop it ASAP.

Dullfire: is the DTS for this platform publicly available? If not, can you at least post the PCI host controller and all its children nodes here?

Bart

Bart: I attached to the bug report a dts extracted from the system.

Just a FYI: SPARC systems (including linux) get their device tree from the open firmware, which likely dynamically generates at least parts of it, so there is not a discrete source for it.

Regards,
Jonathan Currier

#5 lore raw
In reply to Manivannan Sadhasivam
Quoted 29 lines · Manivannan Sadhasivam
Quoted 7 lines · Dullfire

Bart: I attached to the bug report a dts extracted from the system.

Just a FYI: SPARC systems (including linux) get their device tree from the open firmware, which likely dynamically generates at least parts of it, so there is not a discrete source for it.

Thanks Jonathan for the dts drop! Looks like the platform devices for the pcie nodes were created elsewhere for the SPARC systems. Could you please test the below diff and see if it fixes the issue?

```

drivers/pci/bus.c +1 -1
index 7a061cc860d5..e70f4c089cd4 100644
@@ -394,7 +394,7 @@ void pci_bus_add_device(struct pci_dev *dev)
         * PCI client drivers.
         */
        pdev = of_find_device_by_node(dn);
-       if (pdev) {
+       if (pdev && of_pci_is_supply_present(dn)) {
                if (!device_link_add(&dev->dev, &pdev->dev,
                                     DL_FLAG_AUTOREMOVE_CONSUMER))
                        pci_err(dev, "failed to add device link between %s and %s\n",

```

Quoted 1 line

- Mani

Mani: Yup, that patch does the trick in my test case. The PCIe drivers all bound and function.

Regards,
Jonathan Currier

#6 lore raw
In reply to Bjorn Helgaas
Quoted 17 lines · Bjorn Helgaas
Quoted 16 lines · On Tue, Nov 19, 2024 at 12:55:36PM +0000, [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=219513

Hardware: Sparc64
Priority: P3
Reporter: [email protected]
Regression: No

Created attachment 307241
--> https://bugzilla.kernel.org/attachment.cgi?id=307241&action=edit
debug info (some shell commands to check the PCIe devices and drivers)

In linux-next (next-20241118), since
commit 03cfe0e05650 ("PCI/pwrctl: Ensure that the pwrctl drivers are probed before the PCI client drivers")
PCIe drivers no longer bind (at least on the tested SPARCv9 system).

Quoted 5 lines
Quoted 2 lines

It appears a "supplier" devlink is created, however it is are dormant. see attached "bug-info.txt"

Thanks for the report. It sounds like you bisected this to 03cfe0e05650? Can you attach a complete dmesg log to the bugzilla?

Yes, a bisect pointed at 03cfe0e05650. After finding that I tried the patch below to verify, since a trivial revert wasn't possible on next-20241118, and the PCIe drivers started binding again, and everything seemed functional.

drivers/pci/bus.c +1 -1
index b0e3cfdaa276..6d87773784b9 100644
@@ -404,7 +404,7 @@ void pci_bus_add_device(struct pci_dev *dev)
         * PCI client drivers.
         */
        pdev = of_find_device_by_node(dn);
-       if (pdev) {
+       if (pdev && false) {
                if (!device_link_add(&dev->dev, &pdev->dev,
                                     DL_FLAG_AUTOREMOVE_CONSUMER))
                        pci_err(dev, "failed to add device link between %s and %s\n",

Obviously not a fix, but it did help verify the issue.

Quoted 3 lines

This commit is queued for v6.13, and the merge window is now open, so if it's a regression, we need to resolve it or drop it ASAP.

Regards,
Jonathan Currier