All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] drivers: pci: ignore disabled devices
@ 2019-12-01 16:45 Michael Walle
  2019-12-02  9:12 ` Alexandru Marginean
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Walle @ 2019-12-01 16:45 UTC (permalink / raw)
  To: u-boot

PCI devices may be disabled in the device tree. Devices which are probed
by the device tree handle the "status" property and are skipped if
disabled. Devices which are probed by the PCI enumeration don't check
that property. Fix it.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 drivers/pci/pci-uclass.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 896cb6b23a..fab20fc60e 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -677,6 +677,11 @@ static int pci_find_and_bind_driver(struct udevice *parent,
 	/* Determine optional OF node */
 	pci_dev_find_ofnode(parent, bdf, &node);
 
+	if (ofnode_valid(node) && !ofnode_is_available(node)) {
+		debug("%s: Ignoring disabled device\n", __func__);
+		return -EPERM;
+	}
+
 	start = ll_entry_start(struct pci_driver_entry, pci_driver_entry);
 	n_ents = ll_entry_count(struct pci_driver_entry, pci_driver_entry);
 	for (entry = start; entry != start + n_ents; entry++) {
-- 
2.20.1

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

* [U-Boot] [PATCH] drivers: pci: ignore disabled devices
  2019-12-01 16:45 [U-Boot] [PATCH] drivers: pci: ignore disabled devices Michael Walle
@ 2019-12-02  9:12 ` Alexandru Marginean
  2019-12-02  9:21 ` Bin Meng
  2019-12-05 22:09 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandru Marginean @ 2019-12-02  9:12 UTC (permalink / raw)
  To: u-boot

On 12/1/2019 5:45 PM, Michael Walle wrote:
> PCI devices may be disabled in the device tree. Devices which are probed
> by the device tree handle the "status" property and are skipped if
> disabled. Devices which are probed by the PCI enumeration don't check
> that property. Fix it.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>   drivers/pci/pci-uclass.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
Reviewed-by: Alex Marginean <alexandru.marginean@nxp.com>
Tested-by: Alex Marginean <alexandru.marginean@nxp.com>

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

* [U-Boot] [PATCH] drivers: pci: ignore disabled devices
  2019-12-01 16:45 [U-Boot] [PATCH] drivers: pci: ignore disabled devices Michael Walle
  2019-12-02  9:12 ` Alexandru Marginean
@ 2019-12-02  9:21 ` Bin Meng
  2019-12-05 22:09 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2019-12-02  9:21 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 2, 2019 at 12:45 AM Michael Walle <michael@walle.cc> wrote:
>
> PCI devices may be disabled in the device tree. Devices which are probed
> by the device tree handle the "status" property and are skipped if
> disabled. Devices which are probed by the PCI enumeration don't check
> that property. Fix it.
>
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  drivers/pci/pci-uclass.c | 5 +++++
>  1 file changed, 5 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

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

* [U-Boot] [PATCH] drivers: pci: ignore disabled devices
  2019-12-01 16:45 [U-Boot] [PATCH] drivers: pci: ignore disabled devices Michael Walle
  2019-12-02  9:12 ` Alexandru Marginean
  2019-12-02  9:21 ` Bin Meng
@ 2019-12-05 22:09 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-12-05 22:09 UTC (permalink / raw)
  To: u-boot

On Sun, Dec 01, 2019 at 05:45:18PM +0100, Michael Walle wrote:

> PCI devices may be disabled in the device tree. Devices which are probed
> by the device tree handle the "status" property and are skipped if
> disabled. Devices which are probed by the PCI enumeration don't check
> that property. Fix it.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> Reviewed-by: Alex Marginean <alexandru.marginean@nxp.com>
> Tested-by: Alex Marginean <alexandru.marginean@nxp.com>
> 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: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191205/0c202c50/attachment-0001.sig>

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

end of thread, other threads:[~2019-12-05 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01 16:45 [U-Boot] [PATCH] drivers: pci: ignore disabled devices Michael Walle
2019-12-02  9:12 ` Alexandru Marginean
2019-12-02  9:21 ` Bin Meng
2019-12-05 22:09 ` 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.