Re: [PATCH V2 2/2] PCI: Add support for "preserve-boot-config" property

From: Bjorn Helgaas
Date: Fri Jan 12 2024 - 11:58:45 EST


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@xxxxxxxxx>
> Signed-off-by: Vidya Sagar <vidyas@xxxxxxxxxx>
> ---
> V2:
> * Addressed issues reported by kernel test robot <lkp@xxxxxxxxx>
>
> 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.

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 :)

Bjorn