From patchwork Wed Jan 10 03:07:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 13515644 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 918E7C47077 for ; Wed, 10 Jan 2024 03:08:35 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9Vw66wGw060BVDJ+nnxbLfKSuVp6uU55ZWwleGnyS/k=; b=pDj6y6WFJI32Lj KN759JtLZ61ildCbxka9Rdh4Zls65yXbKGreyeSjW7n7rEKYRMngoCGWRoU5MqdbG5fuX/IU9eg1f +StvlhApyxijj4D+nrSFZo8WXETT8ZfeTlKLbsk6x3aus2XQL+Mvs9w2L8PtGJdxxJKRz5buQl3d5 3cXt9TcvH+OxfqTppktsl09mjVkFM5VqzsnjreBViFd2GAHeq5mcfsMDjH35wFAEPNuuOWJlcj66g TIcadgWixZldlzZlSOdrHalAQjuK1pqF0092qr12SKJ1vIXxz49+2BH6+gnO1YYLnGfaAPiwYzlFo Atmalsl+D+/nEObXWtew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNOwr-00ABeS-0N; Wed, 10 Jan 2024 03:08:09 +0000 Received: from mail-bn8nam11on20600.outbound.protection.outlook.com ([2a01:111:f400:7eae::600] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNOwo-00ABdI-2Q for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2024 03:08:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OXUBfyIQbe+4iOLB89h2y/XAKcD261YLDM1f9FuUIBExjk6NnoSCc5CCHgPDBlRne/v+exFbr6jsbBoMz+IWuoLMs+tHD8s9LGYzTfetBMrciACVSkHeL4dC0cbu5cSpN7Jw+oTGVnMRmEl8Gtyd76ga8P4m3v2e8b1Jc4Dc3uDtBSfSmFEZ6eIHlJyW2xtG33Z5ey0ZCX9kBBBr1OjGjTyc6+oYBFL1VWlGsywMapjp4VYyur6aQLvBicMlZiFMrkjYmodkrCWgJ/UXZ2qR5kn5XS+ZcG+ifks4izHD52kd/UB1JgRiAlDwp6AuuGQmDlrLTDoNTIxkGGmBHCDiAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u19KeWRYDRhSU5OqNEp1NCs81098tcS51WLzinJBC+E=; b=PHH676Gom91YeFmhHP7DKkQ+ZPgIbZMj8mHHQ+LY7aWpYZTZXaUQD+m2eyqPM9ZBToeILiAZnJl31hrp38xv+vaSJ6WybGHcHuhzV/bVFIBTyr1GK9pFUKRFWP0p3iGII6464jRAdGOltVgngNV9QuZl3sq139Si6FA951YJqEvlEY1o1xrg4M9bWVuSA4esAImXiLRFZvKmECq6c0yVS8o4BmsZC1WadPVg1A8Bf8gbGxTiB6AFt3LHEKUKTxUdW6+HmYm95lIi7tktoY2LZnn4BwylyPnQei3UteeHmK8Td2dZ/YnM7g/pPaTDVif4uTAQVyzUv6mWhQ61iELJ8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u19KeWRYDRhSU5OqNEp1NCs81098tcS51WLzinJBC+E=; b=BfFipuuzQSjNYwM9QuZ+8Na62Vp3Sm6KO+RaZGtPXsF21EsLT+8KaiKVy5C8CtPsqrG1gVtOOBzuv+yF7Qoly9Y1waNLaoRnyA3XkliltpljFBj/yLQQhwiG1H1kOCriM6dVv4CXLWl4OxYTiKb+MgCcWUGzSOTDAUjPI/y+yQaVkMDLCTaoX+dpRDiZNjFcUpPXjoLcRG8yrf++bSnYPutA6geL63/Usa4hmYt7zbLbV82XZ3EsfU7RqJ4UahoxQ90CdqlU3WB2XhSN1AxmiRHUTKe31dcYvLDXdfU+jUyHM6WmU0JPAH2jYanDS/AKzutsJPbmbf8OcO65CgVBxg== Received: from CH0PR04CA0011.namprd04.prod.outlook.com (2603:10b6:610:76::16) by BL3PR12MB6642.namprd12.prod.outlook.com (2603:10b6:208:38e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Wed, 10 Jan 2024 03:07:56 +0000 Received: from DS3PEPF000099DF.namprd04.prod.outlook.com (2603:10b6:610:76:cafe::68) by CH0PR04CA0011.outlook.office365.com (2603:10b6:610:76::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23 via Frontend Transport; Wed, 10 Jan 2024 03:07:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by DS3PEPF000099DF.mail.protection.outlook.com (10.167.17.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.14 via Frontend Transport; Wed, 10 Jan 2024 03:07:56 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 9 Jan 2024 19:07:39 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 9 Jan 2024 19:07:39 -0800 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Tue, 9 Jan 2024 19:07:35 -0800 From: Vidya Sagar To: , , , , , , , CC: , , , , , , , , , Subject: [PATCH V2 1/2] dt-bindings: Add PCIe "preserve-boot-config" property Date: Wed, 10 Jan 2024 08:37:24 +0530 Message-ID: <20240110030725.710547-2-vidyas@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240110030725.710547-1-vidyas@nvidia.com> References: <20240110030725.710547-1-vidyas@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099DF:EE_|BL3PR12MB6642:EE_ X-MS-Office365-Filtering-Correlation-Id: 8eb49b61-23b1-40eb-6b2f-08dc11895825 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9RbD36VCUWwyoyO/scX0Qa4wUsBgfGYPTpc4RSRmfZ99Mi1FGmKZ74o3PazT9x2ej9Uv3NZRdg73m6HmSOOHnrR5znuLvTUGfkZf14G9YLOfq71iebqD3Ouai4Lx7G9VovmTmFal9PCQwQzhaIgNvZG5+EJQa6Zn2hBOC8Xl/YqXCm5Fb4LMVSuQpC/ucFKV6UV6rEqdqzWkmpzShVYhL8HllCcHr9rb5AA4VhAUoxSn4200BoxQQL+HMf30q7GPAyHltTyqeG5x8wJR38zY/AJkuLJHpqD5egCCJt8hq0UGft84RW2nDlAAp5FM0EDPGl8Q46jt7e90Ht/FqF88tgupnPQCBuueZQQ1gZqInalis4n9XeDsFrfwDVvNwJQHgnsxwOiUsGHnVpOMNOGjlhjxHoKszYDjCKRk+nOlIp4Wx0V2B87lNfGmlsZS3JpKS3LbcdF3DgV1x9e5LS0r8LSoH8Nv6YFsDfByHNXs8gF63nOlgd6A7/nMIUl7ruYd8tkfMt5mQ3Wzb4veFqTpqeYctKFnmseQrESq4rwRtl52rclF4FEoHh68eaemGbFqW35xMBsWIqLf02pDMBkM4n9E8DfA9xI+LPynR+St9JBm69taHqKdeg7H/q8YmYeVacDqLSJfsTtXR8kzBz/Pl8vqNn3HAquuY9MGuDm1WdSJh/3SZUSZgp8XkdYwJKn51uI+RlGrVI/BNVC5Rd9UbJzIuTSnzwDYbjxJPvSiza+0Ws3g0fh9omxqaaCb46X6 X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(136003)(346002)(396003)(230922051799003)(1800799012)(451199024)(82310400011)(186009)(64100799003)(36840700001)(40470700004)(46966006)(2906002)(7416002)(5660300002)(41300700001)(478600001)(7636003)(82740400003)(2616005)(426003)(1076003)(26005)(40480700001)(336012)(40460700003)(356005)(6666004)(7696005)(47076005)(36860700001)(8676002)(8936002)(4326008)(36756003)(110136005)(70586007)(54906003)(86362001)(70206006)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 03:07:56.5556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8eb49b61-23b1-40eb-6b2f-08dc11895825 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099DF.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6642 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240109_190806_830301_8D4F5A9B X-CRM114-Status: GOOD ( 11.92 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The existing "linux,pci-probe-only" property applies at a system level and it is not possible to selectively convey individual host bridge's requirement w.r.t preserving the boot configuration done by the platform firmware to the kernel. "preserve-boot-config" addresses that concern and can be used to preserve the boot configuration for host bridges selectivey. Signed-off-by: Vidya Sagar --- V2: * None Documentation/devicetree/bindings/pci/pci.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/pci.txt b/Documentation/devicetree/bindings/pci/pci.txt index 6a8f2874a24d..0a5ff998cbe8 100644 --- a/Documentation/devicetree/bindings/pci/pci.txt +++ b/Documentation/devicetree/bindings/pci/pci.txt @@ -32,6 +32,10 @@ driver implementation may support the following properties: root port to downstream device and host bridge drivers can do programming which depends on CLKREQ signal existence. For example, programming root port not to advertise ASPM L1 Sub-States support if there is no CLKREQ signal. +- preserve-boot-config: + If present this property specifies that this host bridge is already + configured by the platform firmware and the OS doesn't need to reconfigure + it again. PCI-PCI Bridge properties ------------------------- From patchwork Wed Jan 10 03:07:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 13515645 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 1D4CBC47077 for ; Wed, 10 Jan 2024 03:08:42 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=U8g1JfIfrvRSzOzBZ+B5T9Nqp56ZsCvEyoZM8CIVYwo=; b=t78mDNqz+pE2E/ fFtcZgprofG5pPw3e8PQ7lz3sLfpsUyqZ+e6BAdAwNiEPJEkif/wXuXmguJMqCVUzAdhNKFzkb/T1 opmjV3e6UTI62we76LPe1Y/xHzZhQG4X2jJr6dCf4Y2chvTUQbkh1rYpvIsbII/GyRKmEr7u3f2bi 7hgzfKaMECAY3ih/k7R71jEz7XBRCQ+QUPXmmymuBfALfdzt3ApkZKBRmh/V2ziSIUep/f1NPiwIV UZp8fDTlig3ixteD3sqB3ZRhtz6HDLYr23GL9dRME1nHEHWa56eLkhUe0uaTGcwFNdHqavTGuurVA fDK7zhm6yh3Q2N+Bp6EA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNOwv-00ABgr-2p; Wed, 10 Jan 2024 03:08:14 +0000 Received: from mail-dm6nam04on20600.outbound.protection.outlook.com ([2a01:111:f403:2409::600] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNOws-00ABej-1i for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2024 03:08:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aV25UR8uYyH8MJhSFIG6tfsZBxh4yj3Jw3avR0RNBH3ounOIcMZcBRHF/8N2AOb3s9gVWxMx+1fdz23cEmKyS3Eou3VMMhkt29rDNwxBd+zr/IIuPjxqMshjKPv3UmOpxIJiS+duEylEoz2e1RJ9T2MXodE1CGmTHmUCJQ5WYnFL6qZzcW9COuEV16VxsEI0ZjaHReZwFwjXwrs1nNPoyeo6wULc3UFEZhFdJ2fsbwovak9ucqPf6w0PpHkY5rFc6nGqhg3P22kKMut/xL6XRyobev5QWLlxv+bz3EwoC80Dt48NrUrWu8udNStiDz2jUA3Tq2Sz2MmnxWZ3A91PHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ws8eUAUXvLKzq5m+4Z1rBqx1wHa1LCUR+6dLSrIMg6I=; b=KoV6ZdjAYD0ZFUWMM1acw8IoR4wfxOsWrj2XnjUkKr9jyJ1b0ErzZPS/BTWiGnDFSx/4D/6u3X1KFePoBJ1srmlpAynGKjLHs2c3gagWX7ByZ7m6ieMRhR+iFYT+YfcbQpCtjopbHUy02KrW1msGtXvIg8jhIK5kIYVczzaNP25DgUX9lInxafMW/aiUsdApg3utXdcETXCzp2BUeQmP6CSheTrhFsP9OJBu3EJgivWrV69u6KOuXFLal6/S2HZ5PPuWwK0LzL2Ag+B3tLJeULY2ujVaQqG+Q6nGnmMts08HNpS9KcKJu1Qybfruq2/s/b/7AbI4NU+2LrzgEncfSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ws8eUAUXvLKzq5m+4Z1rBqx1wHa1LCUR+6dLSrIMg6I=; b=DDJPbSoVOrpRNAVREZ086WeDp1WMxXvC+0C0g+wzYTRyBbnORXZgGzwmoWaQcMZgq30P6yMphMjw9wjW5si1BlUP14myjkuyMdTA8029wgRIAtk57sqq0PreZ3Fj5DQmWfRGRn4pcb9ko30v3OCBG+o+8QbpqlLV4nsvaLOdgsNHDPnQ+06+31WbySdk2uy7G5DCYwV6RKMsKGCCo8zZVsKPesXSRIT1U4XuR+Y5PZ/c51K1+RSv9BNtOVeRBaCFSrU4jka+K9gjvMTaNe7hKuK715KcU7lydsxBxDkQQNKrAyC3xND6o14lZsGqDMASrtQR3jyHPnBkcijROvlxGg== Received: from CH2PR03CA0024.namprd03.prod.outlook.com (2603:10b6:610:59::34) by DS0PR12MB7630.namprd12.prod.outlook.com (2603:10b6:8:11d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.24; Wed, 10 Jan 2024 03:08:03 +0000 Received: from DS3PEPF000099DD.namprd04.prod.outlook.com (2603:10b6:610:59:cafe::c) by CH2PR03CA0024.outlook.office365.com (2603:10b6:610:59::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23 via Frontend Transport; Wed, 10 Jan 2024 03:08:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by DS3PEPF000099DD.mail.protection.outlook.com (10.167.17.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.14 via Frontend Transport; Wed, 10 Jan 2024 03:08:03 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 9 Jan 2024 19:07:46 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 9 Jan 2024 19:07:46 -0800 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Tue, 9 Jan 2024 19:07:41 -0800 From: Vidya Sagar To: , , , , , , , CC: , , , , , , , , , , "kernel test robot" Subject: [PATCH V2 2/2] PCI: Add support for "preserve-boot-config" property Date: Wed, 10 Jan 2024 08:37:25 +0530 Message-ID: <20240110030725.710547-3-vidyas@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240110030725.710547-1-vidyas@nvidia.com> References: <20240110030725.710547-1-vidyas@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099DD:EE_|DS0PR12MB7630:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c0f881a-afac-48cb-888d-08dc11895c0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1E1a+0fgxta8HwcKIG9QY46PMrMzrCKPt0gfK1vK9sAgtPwOE3htC9q/iy4CMFYzFDGxRydSp94li+zxZkK80mFUonEhFMEgQ3UBfeYI2t+wY9TxwXr4nT3LJqDOzVvj5PZAFw1ToqmZ+Mj+V4gH/bHhRFPPI0rf03aptd1nD1pJuEWs3RXEYravO8zOh17w65QsFxhtKXZz99ei1uoZXaJVwqCpoT/o4ljzKvnFq0D47lrSPjQs4Ki5L632ZvoGhwdm9w9ndQSLJq4H8keT1HBhvnE17Dfsm2LePz60K6/qOF6CzFjDSOukP47vPH48Rq2fn3RN0XxAhCMp0Vz6v54xGzlDeLXLTD2JWzkV3yEkLVjvLjreBXuyLz80GbRSykZz5qpyMWX9qWNBO+yvEtWHrWM9+8J6Zt44F8cClGguksePkU4WMric7FhWpbimEjZc4NVxTpMWX7ylV2nAIQnbppFNN1A32JvdjFu9aWwer9XLI9s5cID/rkDgdUB6lchgrc8oRQXS/RZj0PTHi1tZxJr5V1li2NEB4+//AQcHZRGE9eoypec/IXORCOdSf3ZLB7uQjrUagJ5/FPZ6a8/wKXmgTXLreI1lksiWz0ocm49cliFRVQp9bINeNqAkMH5CJysJHwphxcx9uztUgxcoXb84+JBuYBVXrU+0iAJvhwJ+nQ6+xLUzkTCkbro2NLReSnqDPF/TZfpZxwLsWyd18M94ydlcHD/r6ptzEBHjBxlVbf7Tp+JSwjWT1XSY X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(346002)(39860400002)(396003)(376002)(230922051799003)(1800799012)(186009)(451199024)(82310400011)(64100799003)(36840700001)(40470700004)(46966006)(2906002)(7416002)(5660300002)(41300700001)(83380400001)(40480700001)(40460700003)(336012)(426003)(1076003)(26005)(2616005)(36860700001)(47076005)(7696005)(6666004)(478600001)(86362001)(356005)(7636003)(4326008)(70206006)(8936002)(8676002)(54906003)(70586007)(82740400003)(36756003)(110136005)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 03:08:03.0747 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c0f881a-afac-48cb-888d-08dc11895c0a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099DD.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7630 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240109_190810_572452_E2C60177 X-CRM114-Status: GOOD ( 19.56 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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); + /* Parse and map our Configuration Space windows */ cfg = gen_pci_init(dev, bridge, ops); if (IS_ERR(cfg)) return PTR_ERR(cfg); /* Do not reassign resources if probe only */ - if (!pci_has_flag(PCI_PROBE_ONLY)) + if (!(pci_has_flag(PCI_PROBE_ONLY) || bridge->preserve_config)) pci_add_flags(PCI_REASSIGN_ALL_BUS); bridge->sysdata = cfg; diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 51e3dd0ea5ab..ed3c0dd9804e 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -258,6 +258,24 @@ void of_pci_check_probe_only(void) } EXPORT_SYMBOL_GPL(of_pci_check_probe_only); +/** + * of_pci_check_preserve_boot_config - Return true if the boot configuration + * needs to be preserved + * @node: Device tree node with the domain information. + * + * This function looks for a property called "preserve-boot-config" for a given + * PCIe controller's node and returns true if found. Having this property + * for a PCIe controller ensures that the kernel doesn't re-enumerate and + * reconfigure the BAR resources that are already done by the platform firmware. + * + * Return: true if the property exists false otherwise. + */ +bool of_pci_check_preserve_boot_config(struct device_node *node) +{ + return of_property_read_bool(node, "preserve-boot-config"); +} +EXPORT_SYMBOL_GPL(of_pci_check_preserve_boot_config); + /** * devm_of_pci_get_host_bridge_resources() - Resource-managed parsing of PCI * host bridge resources from DT diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 795534589b98..79d0ac34f567 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -3085,7 +3085,7 @@ int pci_host_probe(struct pci_host_bridge *bridge) * ioport_resource trees in either pci_bus_claim_resources() * or pci_bus_assign_resources(). */ - if (pci_has_flag(PCI_PROBE_ONLY)) { + if (pci_has_flag(PCI_PROBE_ONLY) || bridge->preserve_config) { pci_bus_claim_resources(bus); } else { pci_bus_size_bridges(bus); diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 29658c0ee71f..ba5532005125 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h @@ -13,6 +13,7 @@ struct device_node *of_pci_find_child_device(struct device_node *parent, unsigned int devfn); int of_pci_get_devfn(struct device_node *np); void of_pci_check_probe_only(void); +bool of_pci_check_preserve_boot_config(struct device_node *node); #else static inline struct device_node *of_pci_find_child_device(struct device_node *parent, unsigned int devfn) @@ -26,6 +27,11 @@ static inline int of_pci_get_devfn(struct device_node *np) } static inline void of_pci_check_probe_only(void) { } + +static inline bool of_pci_check_preserve_boot_config(struct device_node *node) +{ + return false; +} #endif #if IS_ENABLED(CONFIG_OF_IRQ)