pci: ensure enumeration of all devices in pci_init
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.
--- drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pci-uclass.c +2 -2
@@ -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
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_checkanduclass_next_device_checkfunctions instead ofuclass_first_deviceanduclass_next_deviceinpci_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 <[email protected]>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@@ -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
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_checkanduclass_next_device_checkfunctions instead ofuclass_first_deviceanduclass_next_deviceinpci_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 <[email protected]>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@@ -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)) { ; } }Reviewed-by Stefan Roese <[email protected]>
Quoted 3 lines
BTW: With this patch now, this one is obsolete?
Yes, this is not needed anymore.
Marek
PATCH 1/1 pci: ensure enumeration of all devices in pci_init
In reply to Marek BehúnQuoted 16 lines · Marek Behún
Use the
uclass_first_device_checkanduclass_next_device_checkfunctions instead ofuclass_first_deviceanduclass_next_deviceinpci_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 <[email protected]>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(-)
PATCH 1/1 pci: ensure enumeration of all devices in pci_init
In reply to Marek BehúnQuoted 6 lines · Marek Behún
Use the
uclass_first_device_checkanduclass_next_device_checkfunctions instead ofuclass_first_deviceanduclass_next_deviceinpci_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
Signed-off-by Marek Behún <[email protected]>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]>Reviewed-by Stefan Roese <[email protected]>Reviewed-by Bin Meng <[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>