[U-Boot] [PATCH u-boot] 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.
Signed-off-by: Marek Behún marek.behun@nic.cz Cc: Stefan Roese sr@denx.de Cc: Anton Schubert anton.schubert@gmx.de Cc: Dirk Eibach dirk.eibach@gdsys.cc Cc: Mario Six mario.six@gdsys.cc Cc: Chris Packham chris.packham@alliedtelesis.co.nz Cc: Phil Sutter phil@nwl.cc Cc: VlaoMao vlaomao@gmail.com Cc: Tom Rini trini@konsulko.com --- drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index cf1e7617ae..dac7cd3e17 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -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)) { ; } }

(Added Simon & Bin to Cc)
On 21.05.19 12:04, Marek Behún wrote:
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.
Signed-off-by: Marek Behún marek.behun@nic.cz Cc: Stefan Roese sr@denx.de Cc: Anton Schubert anton.schubert@gmx.de Cc: Dirk Eibach dirk.eibach@gdsys.cc Cc: Mario Six mario.six@gdsys.cc Cc: Chris Packham chris.packham@alliedtelesis.co.nz Cc: Phil Sutter phil@nwl.cc Cc: VlaoMao vlaomao@gmail.com Cc: Tom Rini trini@konsulko.com
drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index cf1e7617ae..dac7cd3e17 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -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)) {
Reviewed-by: Stefan Roese sr@denx.de
BTW: With this patch now, this one is obsolete?
http://patchwork.ozlabs.org/patch/1099538/
Thanks, Stefan

On Tue, 21 May 2019 13:43:54 +0200 Stefan Roese sr@denx.de wrote:
(Added Simon & Bin to Cc)
On 21.05.19 12:04, Marek Behún wrote:
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.
Signed-off-by: Marek Behún marek.behun@nic.cz Cc: Stefan Roese sr@denx.de Cc: Anton Schubert anton.schubert@gmx.de Cc: Dirk Eibach dirk.eibach@gdsys.cc Cc: Mario Six mario.six@gdsys.cc Cc: Chris Packham chris.packham@alliedtelesis.co.nz Cc: Phil Sutter phil@nwl.cc Cc: VlaoMao vlaomao@gmail.com Cc: Tom Rini trini@konsulko.com
drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index cf1e7617ae..dac7cd3e17 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -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)) {
Reviewed-by: Stefan Roese sr@denx.de
BTW: With this patch now, this one is obsolete?
Yes, this is not needed anymore. Marek

On Tue, May 21, 2019 at 6:04 PM Marek Behún marek.behun@nic.cz wrote:
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.
Signed-off-by: Marek Behún marek.behun@nic.cz Cc: Stefan Roese sr@denx.de Cc: Anton Schubert anton.schubert@gmx.de Cc: Dirk Eibach dirk.eibach@gdsys.cc Cc: Mario Six mario.six@gdsys.cc Cc: Chris Packham chris.packham@alliedtelesis.co.nz Cc: Phil Sutter phil@nwl.cc Cc: VlaoMao vlaomao@gmail.com Cc: Tom Rini trini@konsulko.com
drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Tue, May 21, 2019 at 12:04:31PM +0200, Marek Behún wrote:
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.
Signed-off-by: Marek Behún marek.behun@nic.cz Cc: Stefan Roese sr@denx.de Cc: Anton Schubert anton.schubert@gmx.de Cc: Dirk Eibach dirk.eibach@gdsys.cc Cc: Mario Six mario.six@gdsys.cc Cc: Chris Packham chris.packham@alliedtelesis.co.nz Cc: Phil Sutter phil@nwl.cc Cc: VlaoMao vlaomao@gmail.com Cc: Tom Rini trini@konsulko.com Reviewed-by: Stefan Roese sr@denx.de Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/master, thanks!
participants (4)
-
Bin Meng
-
Marek Behún
-
Stefan Roese
-
Tom Rini