All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Vidya Sagar <vidyas@nvidia.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	will@kernel.org, frowand.list@gmail.com,
	linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, treding@nvidia.com,
	jonathanh@nvidia.com, kthota@nvidia.com, mmaddireddy@nvidia.com,
	sagar.tv@gmail.com, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH V2 2/2] PCI: Add support for "preserve-boot-config" property
Date: Tue, 16 Jan 2024 10:55:50 -0600	[thread overview]
Message-ID: <20240116165550.GA102137-robh@kernel.org> (raw)
In-Reply-To: <5e8f6c52-6149-42c0-affb-d8b072a77956@nvidia.com>

On Mon, Jan 15, 2024 at 08:02:56PM +0530, Vidya Sagar wrote:
> 
> 
> On 1/12/2024 10:28 PM, Bjorn Helgaas wrote:
> > External email: Use caution opening links or attachments
> > 
> > 
> > On Wed, Jan 10, 2024 at 08:37:25AM +0530, Vidya Sagar wrote:
> > > Add support for "preserve-boot-config" property that can be used to
> > > selectively (i.e. per host bridge) instruct the kernel to preserve the
> > > boot time configuration done by the platform firmware.
> > > 
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
> > > ---
> > > V2:
> > > * Addressed issues reported by kernel test robot <lkp@intel.com>
> > > 
> > >   drivers/pci/controller/pci-host-common.c |  5 ++++-
> > >   drivers/pci/of.c                         | 18 ++++++++++++++++++
> > >   drivers/pci/probe.c                      |  2 +-
> > >   include/linux/of_pci.h                   |  6 ++++++
> > >   4 files changed, 29 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c
> > > index 6be3266cd7b5..d3475dc9ec44 100644
> > > --- a/drivers/pci/controller/pci-host-common.c
> > > +++ b/drivers/pci/controller/pci-host-common.c
> > > @@ -68,13 +68,16 @@ int pci_host_common_probe(struct platform_device *pdev)
> > > 
> > >        of_pci_check_probe_only();
> > > 
> > > +     bridge->preserve_config =
> > > +             of_pci_check_preserve_boot_config(dev->of_node);
> > 
> > Thanks for leveraging the existing "preserve_config" support for the
> > ACPI _DSM.  Is pci_host_common_probe() the best place for this?  I
> > think there are many DT platform drivers that do not use
> > pci_host_common_probe(), so I wonder if there's a more generic place
> > to put this.
> My understanding is that pci_host_common_probe() is mainly used in
> systems where the firmware would have taken care of all the platform
> specific initialization and giving the ECAM and 'ranges' info through DT
> for the Linux kernel to go ahead and perform the enumeration. This is
> similar to ACPI way of handing over the system from firmware to the OS.
> 
> If PCIe controllers are getting initialized in the kernel itself, then
> pci_host_probe() is called directly from the respective host controller
> drivers which is the case with all the DesignWare based implementations
> including Tegra194 and Tegra234. In those systems, since the controllers
> themselves have come up and gotten initialized in the kernel, resource
> assignment has to happen anyway.
> 
> > 
> > I see Rob's concern about adding "preserve-boot-config" vs extending
> > "linux,pci-probe-only" and I don't really have an opinion on that,
> > although I do think the "pci-probe-only" name is not as descriptive as
> > it could be.  I guess somebody will argue that "preserve_config" could
> > be more descriptive, too :)
> Honestly I would have liked to repurpose of_pci_check_probe_only() API
> to look for "preserve-boot-config" in the respective PCIe controller's
> DT node and not "linux,pci-probe-only" in the chosen entry, had it not
> for the single usage of of_pci_check_probe_only() in arch/powerpc
> /platforms/pseries/setup.c file.
> Also FWIW, "linux,pci-probe-only" is not documented anywhere.

Yes, it is[1].

> 
> Since there is at least one user for of_pci_check_probe_only(), and
> combining with the fact that the scope where "linux,pci-probe-only" and
> "preserve-boot-config" are used (i.e. chosen entry Vs individual PCIe
> controller node), I prefer to have it as a separate option.
> Rob, please let me know if you have any strong objections to that?

Didn't I already object?

What's the concern with existing users? There shouldn't be any. If 
"linux,pci-probe-only" appeared in a bridge node, it would have been 
ignored and now would be honored.

Rob

[1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/chosen.yaml#L140

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Vidya Sagar <vidyas@nvidia.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	will@kernel.org, frowand.list@gmail.com,
	linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, treding@nvidia.com,
	jonathanh@nvidia.com, kthota@nvidia.com, mmaddireddy@nvidia.com,
	sagar.tv@gmail.com, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH V2 2/2] PCI: Add support for "preserve-boot-config" property
Date: Tue, 16 Jan 2024 10:55:50 -0600	[thread overview]
Message-ID: <20240116165550.GA102137-robh@kernel.org> (raw)
In-Reply-To: <5e8f6c52-6149-42c0-affb-d8b072a77956@nvidia.com>

On Mon, Jan 15, 2024 at 08:02:56PM +0530, Vidya Sagar wrote:
> 
> 
> On 1/12/2024 10:28 PM, Bjorn Helgaas wrote:
> > External email: Use caution opening links or attachments
> > 
> > 
> > On Wed, Jan 10, 2024 at 08:37:25AM +0530, Vidya Sagar wrote:
> > > Add support for "preserve-boot-config" property that can be used to
> > > selectively (i.e. per host bridge) instruct the kernel to preserve the
> > > boot time configuration done by the platform firmware.
> > > 
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
> > > ---
> > > V2:
> > > * Addressed issues reported by kernel test robot <lkp@intel.com>
> > > 
> > >   drivers/pci/controller/pci-host-common.c |  5 ++++-
> > >   drivers/pci/of.c                         | 18 ++++++++++++++++++
> > >   drivers/pci/probe.c                      |  2 +-
> > >   include/linux/of_pci.h                   |  6 ++++++
> > >   4 files changed, 29 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c
> > > index 6be3266cd7b5..d3475dc9ec44 100644
> > > --- a/drivers/pci/controller/pci-host-common.c
> > > +++ b/drivers/pci/controller/pci-host-common.c
> > > @@ -68,13 +68,16 @@ int pci_host_common_probe(struct platform_device *pdev)
> > > 
> > >        of_pci_check_probe_only();
> > > 
> > > +     bridge->preserve_config =
> > > +             of_pci_check_preserve_boot_config(dev->of_node);
> > 
> > Thanks for leveraging the existing "preserve_config" support for the
> > ACPI _DSM.  Is pci_host_common_probe() the best place for this?  I
> > think there are many DT platform drivers that do not use
> > pci_host_common_probe(), so I wonder if there's a more generic place
> > to put this.
> My understanding is that pci_host_common_probe() is mainly used in
> systems where the firmware would have taken care of all the platform
> specific initialization and giving the ECAM and 'ranges' info through DT
> for the Linux kernel to go ahead and perform the enumeration. This is
> similar to ACPI way of handing over the system from firmware to the OS.
> 
> If PCIe controllers are getting initialized in the kernel itself, then
> pci_host_probe() is called directly from the respective host controller
> drivers which is the case with all the DesignWare based implementations
> including Tegra194 and Tegra234. In those systems, since the controllers
> themselves have come up and gotten initialized in the kernel, resource
> assignment has to happen anyway.
> 
> > 
> > I see Rob's concern about adding "preserve-boot-config" vs extending
> > "linux,pci-probe-only" and I don't really have an opinion on that,
> > although I do think the "pci-probe-only" name is not as descriptive as
> > it could be.  I guess somebody will argue that "preserve_config" could
> > be more descriptive, too :)
> Honestly I would have liked to repurpose of_pci_check_probe_only() API
> to look for "preserve-boot-config" in the respective PCIe controller's
> DT node and not "linux,pci-probe-only" in the chosen entry, had it not
> for the single usage of of_pci_check_probe_only() in arch/powerpc
> /platforms/pseries/setup.c file.
> Also FWIW, "linux,pci-probe-only" is not documented anywhere.

Yes, it is[1].

> 
> Since there is at least one user for of_pci_check_probe_only(), and
> combining with the fact that the scope where "linux,pci-probe-only" and
> "preserve-boot-config" are used (i.e. chosen entry Vs individual PCIe
> controller node), I prefer to have it as a separate option.
> Rob, please let me know if you have any strong objections to that?

Didn't I already object?

What's the concern with existing users? There shouldn't be any. If 
"linux,pci-probe-only" appeared in a bridge node, it would have been 
ignored and now would be honored.

Rob

[1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/chosen.yaml#L140

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-01-16 16:55 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10  3:07 [PATCH V2 0/2] Add support to preserve boot config in the DT flow Vidya Sagar
2024-01-10  3:07 ` Vidya Sagar
2024-01-10  3:07 ` [PATCH V2 1/2] dt-bindings: Add PCIe "preserve-boot-config" property Vidya Sagar
2024-01-10  3:07   ` Vidya Sagar
2024-01-12 14:33   ` Rob Herring
2024-01-12 14:33     ` Rob Herring
2024-01-10  3:07 ` [PATCH V2 2/2] PCI: Add support for " Vidya Sagar
2024-01-10  3:07   ` Vidya Sagar
2024-01-12 16:58   ` Bjorn Helgaas
2024-01-12 16:58     ` Bjorn Helgaas
2024-01-15 14:32     ` Vidya Sagar
2024-01-15 14:32       ` Vidya Sagar
2024-01-16 16:55       ` Rob Herring [this message]
2024-01-16 16:55         ` Rob Herring
2024-01-19 17:31       ` Bjorn Helgaas
2024-01-19 17:31         ` Bjorn Helgaas
2024-01-12 16:59   ` Bjorn Helgaas
2024-01-12 16:59     ` Bjorn Helgaas
2024-02-22 12:41   ` [PATCH V3] PCI: Add support for preserving boot configuration Vidya Sagar
2024-02-22 12:41     ` Vidya Sagar
2024-02-22 17:06     ` Bjorn Helgaas
2024-02-22 17:06       ` Bjorn Helgaas
2024-02-22 21:18       ` Vidya Sagar
2024-02-22 21:18         ` Vidya Sagar
2024-02-22 22:08         ` Bjorn Helgaas
2024-02-22 22:08           ` Bjorn Helgaas
2024-02-23  8:00     ` [PATCH V4] " Vidya Sagar
2024-02-23  8:00       ` Vidya Sagar
2024-03-05 14:10       ` Rob Herring
2024-03-05 14:10         ` Rob Herring
2024-03-05 14:24       ` Rob Herring
2024-03-05 14:24         ` Rob Herring
2024-04-01  7:50       ` [PATCH V5] " Vidya Sagar
2024-04-01  7:50         ` Vidya Sagar
2024-04-02 16:01         ` Rob Herring
2024-04-02 16:01           ` Rob Herring
2024-04-10  7:44           ` Vidya Sagar
2024-04-10  7:44             ` Vidya Sagar
2024-04-10 20:50         ` Bjorn Helgaas
2024-04-10 20:50           ` Bjorn Helgaas
2024-04-18 17:31           ` Vidya Sagar
2024-04-18 17:31             ` Vidya Sagar
2024-04-18 17:40         ` [PATCH V6] " Vidya Sagar
2024-04-18 17:40           ` Vidya Sagar
2024-04-21 19:03           ` Bjorn Helgaas
2024-04-21 19:03             ` Bjorn Helgaas
2024-04-21 19:09           ` [PATCH v7-incomplete 0/3] " Bjorn Helgaas
2024-04-21 19:09             ` Bjorn Helgaas
2024-04-21 19:09             ` [PATCH v7-incomplete 1/3] PCI: Move PRESERVE_BOOT_CONFIG _DSM evaluation to pci_register_host_bridge() Bjorn Helgaas
2024-04-21 19:09               ` Bjorn Helgaas
2024-04-22  7:45               ` Andy Shevchenko
2024-04-22  7:45                 ` Andy Shevchenko
2024-04-21 19:09             ` [PATCH v7-incomplete 2/3] PCI: of: Add of_pci_preserve_config() for per-host bridge support Bjorn Helgaas
2024-04-21 19:09               ` Bjorn Helgaas
2024-04-21 19:09             ` [PATCH v7-incomplete 3/3] PCI: Unify ACPI and DT 'preserve config' support Bjorn Helgaas
2024-04-21 19:09               ` Bjorn Helgaas
2024-04-22  7:43               ` Andy Shevchenko
2024-04-22  7:43                 ` Andy Shevchenko

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=20240116165550.GA102137-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kthota@nvidia.com \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lpieralisi@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=sagar.tv@gmail.com \
    --cc=treding@nvidia.com \
    --cc=vidyas@nvidia.com \
    --cc=will@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.