From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 792E4C47DA2 for ; Tue, 16 Jan 2024 16:56:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uZNOJfkfhRhr3lCyLJyfazNugunRcT3Q5gAym8gN9Lk=; b=aaAFox3Fgv7mYT Y0lNydyYfT75liJHkosMXUOSBhqBQS/ZHedac6MDAftc8PZiJKOPN/VAcbW/2Z2h7WLveI1QAtxFi Km4B985UOYuIwOH1S1h49QlHC6m5lMeSPMgu4OotVBTZReJAU8/UUKfu8pUhmJ3dflmRTeueBgwfm LH6ZWUGOAk47iDzjcFRxTJb7AwYOfNa65GwEwdO96AzcLaxLN55rIC+k06eGeENgil4UReYd+CDOp r1N8gAFBzsw7IyvV3pD1kw/UsBnv9KrX5KxbFVIhQJo70EAdjtxVcoS7p8gIJ+MZRuEKm5VRRg6fB f1CRn7cIORXjMJC6Tw1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rPmjH-00CfhH-0T; Tue, 16 Jan 2024 16:55:59 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rPmjE-00CfgP-21 for linux-arm-kernel@lists.infradead.org; Tue, 16 Jan 2024 16:55:58 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 96341B80E7D; Tue, 16 Jan 2024 16:55:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACE52C433C7; Tue, 16 Jan 2024 16:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705424152; bh=vvb30FWvCMkK5KvuyLxMDAHpy7g1C7TNhUJRnix82e0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HTFtI0JUPYXjGnf23ymD8iN1J/BvQkfvN05xycJohmdD9/dBLLJxrn+lAsQdLf6Gc HC5VR6YolpNriimnya+VLtufx9UFno8TGB3qAFpP8nuUJJ0gszUw7fotTWZ7+1EJHc TBGX4Hz6roF9hrQvBnTxUZ7F4b6hE+6IEr/eFsNb9Xicmw6HYeDleHgBY3+2bly1gK YWGTRv6X4R1OWfeROefuR3dSZemhTckyEbwZtjRlYsF4RQjozf6H9sw2C2AV36NkZt 7J/GMVRl51LoTE4ScvwQt8AT2n8/FqUOfawWA6+KsTuaZkY0/+phMTIOWRNKrGXU+L yIgKSHYRPQ2Kw== Date: Tue, 16 Jan 2024 10:55:50 -0600 From: Rob Herring To: Vidya Sagar Cc: Bjorn Helgaas , 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 Subject: Re: [PATCH V2 2/2] PCI: Add support for "preserve-boot-config" property Message-ID: <20240116165550.GA102137-robh@kernel.org> References: <20240112165830.GA2271982@bhelgaas> <5e8f6c52-6149-42c0-affb-d8b072a77956@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5e8f6c52-6149-42c0-affb-d8b072a77956@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240116_085556_927505_B98AC68D X-CRM114-Status: GOOD ( 37.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > > > Signed-off-by: Vidya Sagar > > > --- > > > V2: > > > * Addressed issues reported by kernel test robot > > > > > > 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