[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230213212815.GA2934310@bhelgaas>
Date: Mon, 13 Feb 2023 15:28:15 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Rob Herring <robh@...nel.org>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Liu Peibao <liupeibao@...ngson.cn>,
Binbin Zhou <zhoubinbin@...ngson.cn>,
Huacai Chen <chenhuacai@...ngson.cn>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: Honor firmware's device disabled status
On Fri, Feb 10, 2023 at 10:43:51AM -0600, Rob Herring wrote:
> If a device has a firmware node (DT/ACPI), and the device is marked
> disabled, that is currently ignored. Add a check for this condition
> and bail out creating the pci_dev.
>
> This assumes the config space for the device can still be accessed
> because they already have by this point in order to identify the device.
>
> Cc: Liu Peibao <liupeibao@...ngson.cn>
> Cc: Binbin Zhou <zhoubinbin@...ngson.cn>
> Cc: Huacai Chen <chenhuacai@...ngson.cn>
> Signed-off-by: Rob Herring <robh@...nel.org>
Applied with Binbin's tested-by to pci/enumeration for v6.3, thanks!
> ---
> Please test if this works for Loongson.
> ---
> drivers/pci/probe.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 1779582fb500..b1d80c1d7a69 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -1841,6 +1841,8 @@ int pci_setup_device(struct pci_dev *dev)
>
> pci_set_of_node(dev);
> pci_set_acpi_fwnode(dev);
> + if (dev->dev.fwnode && !fwnode_device_is_available(dev->dev.fwnode))
> + return -ENODEV;
>
> pci_dev_assign_slot(dev);
>
> --
> 2.39.1
>
Powered by blists - more mailing lists