From: Bjorn Helgaas <helgaas@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Liu Peibao <liupeibao@loongson.cn>,
Binbin Zhou <zhoubinbin@loongson.cn>,
Huacai Chen <chenhuacai@loongson.cn>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: Honor firmware's device disabled status
Date: Mon, 13 Feb 2023 15:28:15 -0600 [thread overview]
Message-ID: <20230213212815.GA2934310@bhelgaas> (raw)
In-Reply-To: <20230210164351.2687475-1-robh@kernel.org>
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@loongson.cn>
> Cc: Binbin Zhou <zhoubinbin@loongson.cn>
> Cc: Huacai Chen <chenhuacai@loongson.cn>
> Signed-off-by: Rob Herring <robh@kernel.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
>
prev parent reply other threads:[~2023-02-13 21:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 16:43 [PATCH] PCI: Honor firmware's device disabled status Rob Herring
2023-02-11 2:39 ` 周彬彬
2023-02-13 21:28 ` Bjorn Helgaas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230213212815.GA2934310@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=chenhuacai@loongson.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=liupeibao@loongson.cn \
--cc=robh@kernel.org \
--cc=zhoubinbin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox