Re: [PATCH V4] PCI: Add support for preserving boot configuration

From: Rob Herring
Date: Tue Mar 05 2024 - 09:24:38 EST


On Fri, Feb 23, 2024 at 01:30:21PM +0530, Vidya Sagar wrote:
> Add support for preserving the boot configuration done by the
> platform firmware per host bridge basis, based on the presence of
> 'linux,pci-probe-only' property in the respective PCI host bridge
> device-tree node. It also unifies the ACPI and DT based boot flows
> in this regard.
>
> Signed-off-by: Vidya Sagar <vidyas@xxxxxxxxxx>
> ---
> V4:
> * Addressed Bjorn's review comments
>
> V3:
> * Unified ACPI and DT flows as part of addressing Bjorn's review comments
>
> V2:
> * Addressed issues reported by kernel test robot <lkp@xxxxxxxxx>
>
> drivers/acpi/pci_root.c | 12 -------
> drivers/pci/controller/pci-host-common.c | 4 ---
> drivers/pci/of.c | 21 +++++++++++
> drivers/pci/probe.c | 46 ++++++++++++++++++------
> include/linux/of_pci.h | 6 ++++
> 5 files changed, 62 insertions(+), 27 deletions(-)

One more thing.

> @@ -3080,20 +3106,18 @@ int pci_host_probe(struct pci_host_bridge *bridge)
>
> bus = bridge->bus;
>
> + /* If we must preserve the resource configuration, claim now */
> + if (pci_has_flag(PCI_PROBE_ONLY) || bridge->preserve_config)
> + pci_bus_claim_resources(bus);

No reason to check PCI_PROBE_ONLY if you set preserve_config based on
/chosen as well. IOW, we should deprecate PCI_PROBE_ONLY flag in favor
of the per host bridge setting.

Rob