From: Bjorn Helgaas <helgaas@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: linux-pci@vger.kernel.org, netdev@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>,
Rob Herring <robh@kernel.org>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Michael Walle <michael@walle.cc>,
linux-kernel@vger.kernel.org, Liu Peibao <liupeibao@loongson.cn>,
Binbin Zhou <zhoubinbin@loongson.cn>,
Huacai Chen <chenhuacai@loongson.cn>
Subject: Re: [PATCH pci] PCI: don't skip probing entire device if first fn OF node has status = "disabled"
Date: Wed, 31 May 2023 15:24:46 -0500 [thread overview]
Message-ID: <ZHetDo5PozWdtrxP@bhelgaas> (raw)
In-Reply-To: <20230531165819.phx7uwlgtvnt3tvb@skbuf>
[+cc Loongson folks, thread at
https://lore.kernel.org/r/20230521115141.2384444-1-vladimir.oltean@nxp.com]
On Wed, May 31, 2023 at 07:58:19PM +0300, Vladimir Oltean wrote:
> On Wed, May 31, 2023 at 11:56:02AM -0500, Bjorn Helgaas wrote:
> > What bad things happen without this patch?
>
> It's in the commit title: probing the entire device (PCI device!!!) is
> skipped if function 0 has status = "disabled". Aka PCIe functions 1, 2, 3, 4, ...
I guess I should have asked "what bad things happen without this patch
and without the DT 'disabled' status"?
I think 6fffbc7ae137 ("PCI: Honor firmware's device disabled status")
was basically a workaround for Loongson making a device visible in PCI
config space when it shouldn't have been [1].
6fffbc7ae137 [2] means we pretend the PCI device doesn't exist if DT
status is "disabled". If the device happens to be Function 0, that
means we don't look for any more functions. I guess that doesn't
matter for Loongson. But it does matter for this NXP platform, where
we don't want to use Function 0, but we *do* want to use other
Functions.
There are several PCIe things that are required to be in Function 0
(MPS, ASPM, IDE, CMA/SPDM, etc), at least in certain cases.
What would happen if instead of making pci_setup_device() fail (as
both 6fffbc7ae137 and this patch do, which means the device doesn't
even show up in "lspci"), we just prevent drivers from binding to it,
e.g., by making pci_device_probe() fail? The device would then appear
in "lspci" and the PCI core would configure things as usual, but no
drivers would be able to claim it.
Bjorn
[1] https://lore.kernel.org/all/20221114074346.23008-1-liupeibao@loongson.cn/
[2] https://git.kernel.org/linus/6fffbc7ae137
next prev parent reply other threads:[~2023-05-31 20:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-21 11:51 [PATCH pci] PCI: don't skip probing entire device if first fn OF node has status = "disabled" Vladimir Oltean
2023-05-29 20:48 ` Vladimir Oltean
2023-05-30 21:58 ` Bjorn Helgaas
2023-05-30 22:04 ` Vladimir Oltean
2023-05-30 22:27 ` Bjorn Helgaas
2023-05-30 23:15 ` Vladimir Oltean
2023-05-31 16:56 ` Bjorn Helgaas
2023-05-31 16:58 ` Vladimir Oltean
2023-05-31 20:24 ` Bjorn Helgaas [this message]
2023-06-01 8:11 ` Vladimir Oltean
2023-06-01 15:44 ` Bjorn Helgaas
2023-06-01 16:33 ` Vladimir Oltean
2023-06-01 17:51 ` Bjorn Helgaas
2023-06-01 22:15 ` Vladimir Oltean
2023-06-02 4:06 ` 陈华才
2023-06-02 7:21 ` Liu Peibao
2023-06-02 7:36 ` Jianmin Lv
2023-06-02 10:16 ` Vladimir Oltean
2023-06-03 2:35 ` Jianmin Lv
2023-06-04 8:55 ` Vladimir Oltean
2023-06-05 0:59 ` Jianmin Lv
2023-06-05 9:34 ` Vladimir Oltean
2023-06-16 2:12 ` Jianmin Lv
2023-06-16 17:57 ` Rob Herring
2023-08-03 10:39 ` Vladimir Oltean
2023-08-03 11:34 ` Vladimir Oltean
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=ZHetDo5PozWdtrxP@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=chenhuacai@loongson.cn \
--cc=claudiu.manoil@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=liupeibao@loongson.cn \
--cc=michael@walle.cc \
--cc=netdev@vger.kernel.org \
--cc=robh@kernel.org \
--cc=vladimir.oltean@nxp.com \
--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;
as well as URLs for NNTP newsgroup(s).