public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Herve Codina <herve.codina@bootlin.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>, Rob Herring <robh@kernel.org>,
	Saravana Kannan <saravanak@google.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Lizhi Hou <lizhi.hou@amd.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-pci@vger.kernel.org,
	Allan Nielsen <allan.nielsen@microchip.com>,
	Horatiu Vultur <horatiu.vultur@microchip.com>,
	Steen Hegelund <steen.hegelund@microchip.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v7 5/5] PCI: of: Create device-tree PCI host bridge node
Date: Fri, 21 Feb 2025 12:19:38 -0600	[thread overview]
Message-ID: <20250221181938.GA352971@bhelgaas> (raw)
In-Reply-To: <20250221093427.3d83b9e3@bootlin.com>

On Fri, Feb 21, 2025 at 09:34:27AM +0100, Herve Codina wrote:
> Hi Bjorn,
> 
> On Thu, 20 Feb 2025 18:07:53 -0600
> Bjorn Helgaas <helgaas@kernel.org> wrote:
> 
> > On Thu, Feb 20, 2025 at 09:25:14AM +0100, Herve Codina wrote:
> > > On Wed, 19 Feb 2025 11:39:12 -0600
> > > Bjorn Helgaas <helgaas@kernel.org> wrote:  
> > > > On Tue, Feb 04, 2025 at 08:35:00AM +0100, Herve Codina wrote:  
> > > > > PCI devices device-tree nodes can be already created. This was
> > > > > introduced by commit 407d1a51921e ("PCI: Create device tree node for
> > > > > bridge").
> > > > > 
> > > > > In order to have device-tree nodes related to PCI devices attached on
> > > > > their PCI root bus (the PCI bus handled by the PCI host bridge), a PCI
> > > > > root bus device-tree node is needed. This root bus node will be used as
> > > > > the parent node of the first level devices scanned on the bus. On
> > > > > device-tree based systems, this PCI root bus device tree node is set to
> > > > > the node of the related PCI host bridge. The PCI host bridge node is
> > > > > available in the device-tree used to describe the hardware passed at
> > > > > boot.
> > > > > 
> > > > > On non device-tree based system (such as ACPI), a device-tree node for
> > > > > the PCI host bridge or for the root bus does not exist. Indeed, the PCI
> > > > > host bridge is not described in a device-tree used at boot simply
> > > > > because no device-tree are passed at boot.
> > > > > 
> > > > > The device-tree PCI host bridge node creation needs to be done at
> > > > > runtime. This is done in the same way as for the creation of the PCI
> > > > > device nodes. I.e. node and properties are created based on computed
> > > > > information done by the PCI core. Also, as is done on device-tree based
> > > > > systems, this PCI host bridge node is used for the PCI root bus.    
> > > > 
> > > > This is a detailed low-level description of what this patch does.  Can
> > > > we include a high level outline of what the benefit is and why we want
> > > > this patch?
> > > > 
> > > > Based on 185686beb464 ("misc: Add support for LAN966x PCI device"), I
> > > > assume the purpose is to deal with some kind of non-standard PCI
> > > > topology, e.g., a single B/D/F function contains several different
> > > > pieces of functionality to be driven by several different drivers, and
> > > > we build a device tree description of those pieces and then bind those
> > > > drivers to the functionality using platform_device interfaces?  
> > > 
> > > What do you think if I add the following at the end of the commit log?
> > > 
> > >    With this done, hardware available in complex PCI device can be
> > >    described by a device-tree overlay loaded by the PCI device driver
> > >    on non device-tree based systems. For instance, the LAN966x PCI device
> > >    introduced by commit 185686beb464 ("misc: Add support for LAN966x
> > >    PCI device") can be available on x86 systems.  
> > 
> > This isn't just about complexity of the device.  There are NICs that
> > are much more complex.
> > 
> > IIUC this is really about devices that don't follow the standard
> > "one PCI function <--> one driver" model, so I think it's important to
> > include something about the case of a single function that includes
> > several unrelated bits of functionality that require different
> > drivers.
> 
> Yes.
> 
> > 
> > "LAN966x" might mean something to people who know that this thing has
> > a half dozen separate things inside it, but the name by itself doesn't
> > suggest that, so I don't think it's really helpful to the general
> > audience.
> > 
> 
> Does this one at the end of the commit log sound better?
> 
>     With this done, hardware available in a PCI device that doesn't follow
>     the PCI model consisting in one PCI function handled by one driver can
>     be described by a device-tree overlay loaded by the PCI device driver
>     on non device-tree based systems. Those PCI devices provide a single PCI
>     function that includes several functionalities that require different
>     driver. The device-tree overlay describes in that case the internal
>     devices and their relationships. It allows to load drivers needed by
>     those different devices in order to have functionalities handled.

Yep, thanks.

  reply	other threads:[~2025-02-21 18:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04  7:34 [PATCH v7 0/5] Add support for the PCI host bridge device-tree node creation Herve Codina
2025-02-04  7:34 ` [PATCH v7 1/5] driver core: Introduce device_{add,remove}_of_node() Herve Codina
2025-02-19  8:27   ` Greg Kroah-Hartman
2025-02-19 15:59   ` Jonathan Cameron
2025-02-20  8:12     ` Herve Codina
2025-02-04  7:34 ` [PATCH v7 2/5] PCI: of: Use device_{add,remove}_of_node() to attach of_node to existing device Herve Codina
2025-02-04  7:34 ` [PATCH v7 3/5] PCI: of_property: Add support for NULL pdev in of_pci_set_address() Herve Codina
2025-02-04  7:34 ` [PATCH v7 4/5] PCI: of_property: Constify parameter in of_pci_get_addr_flags() Herve Codina
2025-02-04  7:35 ` [PATCH v7 5/5] PCI: of: Create device-tree PCI host bridge node Herve Codina
2025-02-19 17:39   ` Bjorn Helgaas
2025-02-20  8:25     ` Herve Codina
2025-02-21  0:07       ` Bjorn Helgaas
2025-02-21  8:34         ` Herve Codina
2025-02-21 18:19           ` Bjorn Helgaas [this message]
2025-02-19  8:24 ` [PATCH v7 0/5] Add support for the PCI host bridge device-tree node creation Herve Codina
2025-02-19  8:28   ` Greg Kroah-Hartman
2025-02-19 17:34 ` Bjorn Helgaas
2025-02-19 20:46 ` Rob Herring

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=20250221181938.GA352971@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=allan.nielsen@microchip.com \
    --cc=bhelgaas@google.com \
    --cc=dakr@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=herve.codina@bootlin.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@google.com \
    --cc=steen.hegelund@microchip.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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