From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Cc: netdev@vger.kernel.org, Rob Herring <robh@kernel.org>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Michael Walle <michael@walle.cc>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH pci] PCI: don't skip probing entire device if first fn OF node has status = "disabled"
Date: Mon, 29 May 2023 23:48:07 +0300 [thread overview]
Message-ID: <20230529204807.z2th6cilnrbzj2e2@skbuf> (raw)
In-Reply-To: <20230521115141.2384444-1-vladimir.oltean@nxp.com>
Hi Bjorn,
On Sun, May 21, 2023 at 02:51:41PM +0300, Vladimir Oltean wrote:
> pci_scan_child_bus_extend() calls pci_scan_slot() with devfn
> (bus:device:function) being a multiple of 8, i.e. for each unique
> device.
>
> pci_scan_slot() has logic to say that if the function 0 of a device is
> absent, the entire device is absent and we can skip the other functions
> entirely. Traditionally, this has meant that pci_bus_read_dev_vendor_id()
> returns an error code for that function.
>
> However, since the blamed commit, there is an extra confounding
> condition: function 0 of the device exists and has a valid vendor id,
> but it is disabled in the device tree. In that case, pci_scan_slot()
> would incorrectly skip the entire device instead of just that function.
>
> Such is the case with the NXP LS1028A SoC, which has an ECAM
> for embedded Ethernet (see pcie@1f0000000 in
> arm64/boot/dts/freescale/fsl-ls1028a.dtsi). Each Ethernet port
> represents a function within the ENETC ECAM, with function 0 going
> to ENETC Ethernet port 0, connected to SERDES port 0 (SGMII or USXGMII).
>
> When using a SERDES protocol such as 0x9999, all 4 SERDES lanes go to
> the Ethernet switch (function 5 on this ECAM) and none go to ENETC
> port 0. So, ENETC port 0 needs to have status = "disabled", and embedded
> Ethernet takes place just through the other functions (fn 2 is the DSA
> master, fn 3 is the MDIO controller, fn 5 is the DSA switch etc).
> Contrast this with other SERDES protocols like 0x85bb, where the switch
> takes up a single SERDES lane and uses the QSGMII protocol - so ENETC
> port 0 also gets access to a SERDES lane.
>
> Therefore, here, function 0 being unused has nothing to do with the
> entire PCI device being unused.
>
> Add a "bool present_but_skipped" which is propagated from the caller
> of pci_set_of_node() all the way to pci_scan_slot(), so that it can
> distinguish an error reading the ECAM from a disabled device in the
> device tree.
>
> Fixes: 6fffbc7ae137 ("PCI: Honor firmware's device disabled status")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
Do you have some comments here?
Thanks,
Vladimir
next prev parent reply other threads:[~2023-05-29 20:48 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 [this message]
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
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=20230529204807.z2th6cilnrbzj2e2@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=bhelgaas@google.com \
--cc=claudiu.manoil@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=michael@walle.cc \
--cc=netdev@vger.kernel.org \
--cc=robh@kernel.org \
/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