Skip to contentSkip to conversation

pci: ensure enumeration of all devices in pci_init

PATCH New Marek Behún 4 participants 5 messages May 21, 2019 – Jul 14, 2019 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: ensure enumeration of all devices in pci_init

Use the uclass_first_device_check and uclass_next_device_check functions instead of uclass_first_device and uclass_next_device in pci_init. This ensures that all PCI devices are tried to be probed. Currently if a device fails to probe, the enumeration stops and the devices which come after the failed device are not probed.

Cc Stefan Roese <[email protected]>
Cc Anton Schubert <[email protected]>
Cc Dirk Eibach <[email protected]>
Cc Mario Six <[email protected]>
Cc Chris Packham <[email protected]>
Cc Phil Sutter <[email protected]>
Cc VlaoMao <[email protected]>
Cc Tom Rini <[email protected]>
---
 drivers/pci/pci-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pci-uclass.c +2 -2
index cf1e7617ae..dac7cd3e17 100644
@@ -1502,9 +1502,9 @@ void pci_init(void)
 	 * Enumerate all known controller devices. Enumeration has the side-
 	 * effect of probing them, so PCIe devices will be enumerated too.
 	 */
-	for (uclass_first_device(UCLASS_PCI, &bus);
+	for (uclass_first_device_check(UCLASS_PCI, &bus);
 	     bus;
-	     uclass_next_device(&bus)) {
+	     uclass_next_device_check(&bus)) {
 		;
 	}
 }
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 pci: ensure enumeration of all devices in pci_init

(Added Simon & Bin to Cc)

Quoted 26 lines · Marek Behún

Use the uclass_first_device_check and uclass_next_device_check functions instead of uclass_first_device and uclass_next_device in pci_init. This ensures that all PCI devices are tried to be probed. Currently if a device fails to probe, the enumeration stops and the devices which come after the failed device are not probed.

Cc Stefan Roese <[email protected]>
Cc Anton Schubert <[email protected]>
Cc Dirk Eibach <[email protected]>
Cc Mario Six <[email protected]>
Cc Chris Packham <[email protected]>
Cc Phil Sutter <[email protected]>
Cc VlaoMao <[email protected]>
Cc Tom Rini <[email protected]>
---
  drivers/pci/pci-uclass.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pci-uclass.c +0 -0
index cf1e7617ae..dac7cd3e17 100644
@@ -1502,9 +1502,9 @@ void pci_init(void)
  	 * Enumerate all known controller devices. Enumeration has the side-

drivers/pci/pci-uclass.c void pci_init(void) · line 1510

Quoted 10 lines
drivers/pci/pci-uclass.c +2 -2
  	 * effect of probing them, so PCIe devices will be enumerated too.
  	 */
-	for (uclass_first_device(UCLASS_PCI, &bus);
+	for (uclass_first_device_check(UCLASS_PCI, &bus);
  	     bus;
-	     uclass_next_device(&bus)) {
+	     uclass_next_device_check(&bus)) {
  		;
  	}
  }

BTW: With this patch now, this one is obsolete?

http://patchwork.ozlabs.org/patch/1099538/

Thanks,
Stefan

#2 lore raw

PATCH 1/1 pci: ensure enumeration of all devices in pci_init

Quoted 43 lines · On Tue, 21 May 2019 13:43:54 +0200 Stefan Roese <[email protected]> wrote:

(Added Simon & Bin to Cc)

Quoted 29 lines · Marek Behún

Use the uclass_first_device_check and uclass_next_device_check functions instead of uclass_first_device and uclass_next_device in pci_init. This ensures that all PCI devices are tried to be probed. Currently if a device fails to probe, the enumeration stops and the devices which come after the failed device are not probed.

Cc Stefan Roese <[email protected]>
Cc Anton Schubert <[email protected]>
Cc Dirk Eibach <[email protected]>
Cc Mario Six <[email protected]>
Cc Chris Packham <[email protected]>
Cc Phil Sutter <[email protected]>
Cc VlaoMao <[email protected]>
Cc Tom Rini <[email protected]>
---
  drivers/pci/pci-uclass.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pci-uclass.c +0 -0
index cf1e7617ae..dac7cd3e17 100644
@@ -1502,9 +1502,9 @@ void pci_init(void)
  	 * Enumerate all known controller devices. Enumeration

has the side-
* effect of probing them, so PCIe devices will be
enumerated too. */

drivers/pci/pci-uclass.c void pci_init(void) · line 1510

Quoted 8 lines
drivers/pci/pci-uclass.c +2 -2
-	for (uclass_first_device(UCLASS_PCI, &bus);
+	for (uclass_first_device_check(UCLASS_PCI, &bus);
  	     bus;
-	     uclass_next_device(&bus)) {
+	     uclass_next_device_check(&bus)) {
  		;
  	}
  }
Quoted 3 lines

BTW: With this patch now, this one is obsolete?

http://patchwork.ozlabs.org/patch/1099538/

Yes, this is not needed anymore.
Marek

#3 lore raw

PATCH 1/1 pci: ensure enumeration of all devices in pci_init

In reply to Marek Behún
Quoted 16 lines · Marek Behún

Use the uclass_first_device_check and uclass_next_device_check functions instead of uclass_first_device and uclass_next_device in pci_init. This ensures that all PCI devices are tried to be probed. Currently if a device fails to probe, the enumeration stops and the devices which come after the failed device are not probed.

Cc Stefan Roese <[email protected]>
Cc Anton Schubert <[email protected]>
Cc Dirk Eibach <[email protected]>
Cc Mario Six <[email protected]>
Cc Chris Packham <[email protected]>
Cc Phil Sutter <[email protected]>
Cc VlaoMao <[email protected]>
Cc Tom Rini <[email protected]>
Quoted 4 lines
---
 drivers/pci/pci-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#4 lore raw

PATCH 1/1 pci: ensure enumeration of all devices in pci_init

In reply to Marek Behún
Quoted 6 lines · Marek Behún

Use the uclass_first_device_check and uclass_next_device_check functions instead of uclass_first_device and uclass_next_device in pci_init. This ensures that all PCI devices are tried to be probed. Currently if a device fails to probe, the enumeration stops and the devices which come after the failed device are not probed.

Quoted 11 lines
Cc Stefan Roese <[email protected]>
Cc Anton Schubert <[email protected]>
Cc Dirk Eibach <[email protected]>
Cc Mario Six <[email protected]>
Cc Chris Packham <[email protected]>
Cc Phil Sutter <[email protected]>
Cc VlaoMao <[email protected]>
Cc Tom Rini <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190714/0a61cd40/attachment.sig>