All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init
@ 2019-05-21 10:04 Marek Behún
  2019-05-21 11:43 ` Stefan Roese
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marek Behún @ 2019-05-21 10:04 UTC (permalink / raw)
  To: u-boot

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)) {
 		;
 	}
 }
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init
  2019-05-21 10:04 [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init Marek Behún
@ 2019-05-21 11:43 ` Stefan Roese
  2019-05-22 10:39   ` Marek Behún
  2019-05-21 14:07 ` Bin Meng
  2019-07-14 13:06 ` Tom Rini
  2 siblings, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2019-05-21 11:43 UTC (permalink / raw)
  To: u-boot

(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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init
  2019-05-21 10:04 [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init Marek Behún
  2019-05-21 11:43 ` Stefan Roese
@ 2019-05-21 14:07 ` Bin Meng
  2019-07-14 13:06 ` Tom Rini
  2 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2019-05-21 14:07 UTC (permalink / raw)
  To: u-boot

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init
  2019-05-21 11:43 ` Stefan Roese
@ 2019-05-22 10:39   ` Marek Behún
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Behún @ 2019-05-22 10:39 UTC (permalink / raw)
  To: u-boot

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?
> 
> http://patchwork.ozlabs.org/patch/1099538/

Yes, this is not needed anymore.
Marek

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init
  2019-05-21 10:04 [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init Marek Behún
  2019-05-21 11:43 ` Stefan Roese
  2019-05-21 14:07 ` Bin Meng
@ 2019-07-14 13:06 ` Tom Rini
  2 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2019-07-14 13:06 UTC (permalink / raw)
  To: u-boot

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!

-- 
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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-14 13:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21 10:04 [U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init Marek Behún
2019-05-21 11:43 ` Stefan Roese
2019-05-22 10:39   ` Marek Behún
2019-05-21 14:07 ` Bin Meng
2019-07-14 13:06 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.