From patchwork Mon Sep 19 14:36:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980527 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDF85C6FA86 for ; Mon, 19 Sep 2022 14:37:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbiISOhU (ORCPT ); Mon, 19 Sep 2022 10:37:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbiISOhM (ORCPT ); Mon, 19 Sep 2022 10:37:12 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2044.outbound.protection.outlook.com [40.107.93.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3C5F32DA3; Mon, 19 Sep 2022 07:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QdMv4Jwstg+nMl6pjLSUzBBENsntjDRW0IO8+ORNRjj1ddO7IPylmbgIx54QXPuMzqK+aV49jXFEgSSln0LTdZdHYGxsuTUwcypCtf0OigYmOdzAs7KsVRqNqeBZ6lGRymQUTgAYLndlRd4lgQHJi28qyAiVF/I+of72+KlvwS2y+cL8JEFGYoX4c7BkcIvZEEv30xUoauf+28kwE1dpPaRkeb9vnhmmJwlJBrW4j25TKopA5W8zWqCHzzHzaeOv7biWXEr8GlJURnQzuBJA84wVBI1+OXVlftHfE3O/6CsLvWpAjXsmpn/8By1Slk8X8lzqNjFRfflYBu8UVq9CEQ== 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=DNHGAqvjxnOQxva/eEq4B4ZohdjvB1IQWMLluNQpL1M=; b=isZyimlMecFRXJl4Fs/NQckliSZJiNKE721302c9IC+eLHjKAFsj076IjzbhtPHx01ZEP7QCT73e4U9t2rmnTsXh+YpuMBkrczvwysw3OhWJCEaSZd8vpnXwFQnFrliXrd4eHj4E9akrY2ayrI7iuz2412J2c9YvZ2nAwJ2oISXbQzrOiH6oOGWZB/QYrzzGkHOrCnFHrgWZ3Z+5ZhAR63r7UZ1ZFavcp6pfMgZbVAiPcDQv1WCpjmrQRlD89HUN+rL++Rszg9DDYeejJ468Hl6sRZeKttB/aeftBVsZGrP5UM7m0I76BM25hH/btRoHNtn1GmZX6O5H7g+zEjbv9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=DNHGAqvjxnOQxva/eEq4B4ZohdjvB1IQWMLluNQpL1M=; b=TSn2CxBKNF30UeA6VEQzF/LF7GDgT6TggXF0Jz2x+6bK1vO66nl7BfHPBtcZD3duy3REAY9MC7ec+/EOBybkQ7iEmV7eF791RPN8Ydf5LESindhzN95MDvZCgO03LT5futGuxGReFqiQcgrKf7Lke9AQ2oo2NR3/1d6jOT6MiQMqL98QUBEpXv5rF5lY6vTBM0ircoyfOTRLSdOoLBeMqsCAffcEz4PUnsB3DZYrL8PmaI2jxfVAIFb/75jG9Ow4v0FIvf6fWcXIQYtug+RjactZITM2/INp5Y08vTqf/GiNWz6KVxbZXRFvnRt/zHkhkd9VQz2gZh8iISModVdMUA== Received: from CY5PR15CA0206.namprd15.prod.outlook.com (2603:10b6:930:82::20) by MN2PR12MB4096.namprd12.prod.outlook.com (2603:10b6:208:1dc::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Mon, 19 Sep 2022 14:37:06 +0000 Received: from CY4PEPF0000B8EA.namprd05.prod.outlook.com (2603:10b6:930:82:cafe::9b) by CY5PR15CA0206.outlook.office365.com (2603:10b6:930:82::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 14:37:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000B8EA.mail.protection.outlook.com (10.167.241.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.11 via Frontend Transport; Mon, 19 Sep 2022 14:37:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:36:45 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:36:45 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:36:40 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 1/9] PCI: tegra194: Use devm_gpiod_get_optional() to parse "nvidia,refclk-select" Date: Mon, 19 Sep 2022 20:06:19 +0530 Message-ID: <20220919143627.13803-2-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8EA:EE_|MN2PR12MB4096:EE_ X-MS-Office365-Filtering-Correlation-Id: e23c993f-8197-4953-2aae-08da9a4c6cff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cK9ot8+utZk+62PJ2KlrMdpDdt6C83Wg5c9h02QkX+SPU2cxO37En2glcxvZSIkxRVn6vxudlWRY2KFiW0jPR6qDQJZ7EIB3oYG+UrjwIjciffw63wjL1uL5U5CqdwfiASfaR1+56Ji/jI1KJOojU2LvjHMWj2U1wg68uXe4QX0oasq5pU/hDNJsTJZz9W0a91Vkc2IHJW2DycExtFSkykSjHCTJLrsj9yfy/vkuw8boq68y4tShoFx8gHKhtERuvhDLGz+kbEY0uB9Elr9iMeZY2YZD7SARp6VUJXlU6niJSLgEhDTv52mua/vfMcL4H5crvoXrxEzlvyqw0qE6T7VXSuPwF96GKeBtfxx+sbMMEjy+q8D4u1qL2otAEOPHuH3B41YU+v5LX0d6/u4Phvi4RPe7RYUNKFI+FeESeLYGAFQN7dKAJxFOjevb6lX0OBsi2ndFsA5gXxabl7+TaLRM9amjWzBf0jSzt0hygaJL54tU2EoXIN0wjNFwvWNdN2hYmhKTzVbFN5nkGOwV1HB/KleFpPCD3TqaSs5+zRz2IA43UDrW99WOlDGz8ezIhQTf4DsGEwxRAR61KBw5+T4658v2bgVHKLt5dfv8U7RBv7Ks/GX0mMgZ3VIH3A7tT8lkaHURrmoM+kDW6DIW48NUazVi0vwIh4JIoAodHTa5YpFFQhEyVervzBjksNPERt8lRHh/dDU1XBOA/EH60Y/Ycfjoecg9c2tJmfmUn8Z2kHtKV5mycizzR6MDk51xfGzpMEc1g53Tf8Jgu9g2WOMn1wM9zHawcfZN2VniEsU= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(39860400002)(396003)(346002)(451199015)(40470700004)(36840700001)(46966006)(7696005)(36756003)(6666004)(26005)(40460700003)(82740400003)(8676002)(4326008)(70206006)(82310400005)(110136005)(54906003)(70586007)(41300700001)(36860700001)(40480700001)(921005)(86362001)(7636003)(2616005)(83380400001)(47076005)(186003)(1076003)(336012)(426003)(478600001)(2906002)(316002)(356005)(5660300002)(4744005)(7416002)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:06.1950 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e23c993f-8197-4953-2aae-08da9a4c6cff X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000B8EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4096 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The GPIO DT property "nvidia,refclk-select" to select the PCIe reference clock is optional. Use devm_gpiod_get_optional() to get it. Signed-off-by: Vidya Sagar --- drivers/pci/controller/dwc/pcie-tegra194.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 1b6b437823d2..2631685e3315 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1176,9 +1176,9 @@ static int tegra_pcie_dw_parse_dt(struct tegra_pcie_dw *pcie) return err; } - pcie->pex_refclk_sel_gpiod = devm_gpiod_get(pcie->dev, - "nvidia,refclk-select", - GPIOD_OUT_HIGH); + pcie->pex_refclk_sel_gpiod = devm_gpiod_get_optional(pcie->dev, + "nvidia,refclk-select", + GPIOD_OUT_HIGH); if (IS_ERR(pcie->pex_refclk_sel_gpiod)) { int err = PTR_ERR(pcie->pex_refclk_sel_gpiod); const char *level = KERN_ERR; From patchwork Mon Sep 19 14:36:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980528 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8F48C6FA86 for ; Mon, 19 Sep 2022 14:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbiISOhX (ORCPT ); Mon, 19 Sep 2022 10:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230141AbiISOhS (ORCPT ); Mon, 19 Sep 2022 10:37:18 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2055.outbound.protection.outlook.com [40.107.244.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C5F32D99; Mon, 19 Sep 2022 07:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FhhHMWCGRojwWVBvEzpqVCWAaE/qb71tPFb1NfVayzvfNUO+Hf9FeEdSzJTQEYr//xTE6Zo+DPSV1PwKWCDdnl40v7faiS5bTbb01CHzspi5sdQFO9YXbh6O5HxuCYmPKo8uB3PEVS1Q+glRIMA3khQwot6NK4A1rl+CIFo+xH5fiBETP1AORwo7dQ6HnMhH7bWwaEkkITn61EnlfovpSzRCnsLfFASSzHh4PobfNYEkpq+QKnxapTnIVVmNDMzKNlzEcPfh0UQ5bKulAi4vz9vPdiNwVmFKbd//XNdt+4wPl5EGZdKc9O7o0NVn+XtW2JfoPF14dcJFucPCU3L+nA== 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=gcPj5wXLd6TopjUqnyhqEg0mG7Ry1tjniNVUrQSStZc=; b=RSdOUEzpEahBEXWzBlZQcWSEnHGFDwry9gVFLgyjBfKyjO0i4xJTn0CNgDFpbzpAy/A359YjybkESeJrNgxN0xKyeUK6WSNxExTvQpxelf2FOX+npSUH41kNIBGwkIYEUftDAg27nozntD0/DqM5Dt36il6vSb1M+6FJQxoTXi+AttSLfYgYdl7lPcjRAHjGdKdJ2B6arwgKOSdbSbIWmSj387Q7YMdQUWLMo+agHqet+4aqFQPzHJZA09Eku3cDqVOczNaQTcQX1iyRe/O5WE4/jBwq9KuMXLf1Hi/pPXCV6MnkpXO4U8WdOYw+uNBJMfhJYsT16AZUPF/m1jTfHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=gcPj5wXLd6TopjUqnyhqEg0mG7Ry1tjniNVUrQSStZc=; b=nH3XNBITGKZs2X0QqaM/fqzwCYnRm1yGc9oRCy1nevMTNfYLVSsD3Rlj6Wzwq17hDuS7CXL9OmaTDy8DjOEDk1TVgrz3aD5zmoCRRZqMAtT7wWjnhr3+wJioOIQVVRaxRaUQtLLolvrIa2ZIrSpJxtyQTqJtvdEVJsFHD07gyIxxy45PgKf1lZ4Pv2En5gR6KIKl8YhkIiGt33mCg7ij9vp62YB4UX7mH8IuGaDM3QLVIU4Ad0k5E6FbgXGRQhMds95DFDbDv7ZIOs8d+9er1jKRueswkwd4kJZ6uLlawyGgPy41zcPOHJxo2ZsmyZWJUmo0V30IENW9hqC/ehwbsQ== Received: from CY5PR15CA0207.namprd15.prod.outlook.com (2603:10b6:930:82::26) by DS7PR12MB6239.namprd12.prod.outlook.com (2603:10b6:8:95::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.19; Mon, 19 Sep 2022 14:37:10 +0000 Received: from CY4PEPF0000B8EA.namprd05.prod.outlook.com (2603:10b6:930:82:cafe::f6) by CY5PR15CA0207.outlook.office365.com (2603:10b6:930:82::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 14:37:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000B8EA.mail.protection.outlook.com (10.167.241.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.11 via Frontend Transport; Mon, 19 Sep 2022 14:37:10 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:36:53 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:36:52 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:36:47 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 2/9] PCI: tegra194: Drive CLKREQ signal low explicitly Date: Mon, 19 Sep 2022 20:06:20 +0530 Message-ID: <20220919143627.13803-3-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8EA:EE_|DS7PR12MB6239:EE_ X-MS-Office365-Filtering-Correlation-Id: 30c4e4b6-c0cd-4497-bcb9-08da9a4c6f9a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qD17PPJURFZQw9pRJOaVBqz3hQIMUnRF4mAnO6Aa0i7ugFOscF4TU16mNnaqJfHLR+ZfZo9g9JKyPIM+viES6H6AE6kIXwu59QCtSFb/H09CKlVBbqOHn1NQiSrpDwm3I2GMflYNloAGvz7z9+O/6AzGihCX05iaLISwM+KFdOP0lOsQRu1ahxSAS1sFQixGM1fAQ4ljbkPNL38oSVfO/A5KIE+bsyvypGiTay1aHIvcLVmK6vx2RrSrVxZSKp51YBtYYCBlQyl6go8v1ng7lgqo1MDu7VKgRTe+FFMTCg0ZAtexC8GEPw0b6pumAaB1KsWBfj9wXZ6Ko8lcv6m1dPhGxf38ZZro2affhA0J+WF91TJy3bMAFIZ94zx8jomUyLbgq1vepUQ7Ig+b7Tf/qzc7ab+o+Z0+Pzx60f8jUtTQrepcEvtw1DVKhO87JMU8WpLDOIWvmv0x+0PgOG83sDRrjMVLnpt62P6AoEESvulMhBcUaXFBG/e5EZXJY1enTRz9n8jiIIfbZ65iAU3xWBh1Nul//y2ETxjznRe/AM9h6citMvssqhG6EwST6lzibuPnhCJ1Eca2V4SwPdRC800t/YGomH5w69yADvV5vqO6BFAmhU9o5sWMT8h4M5SLclOJPW/vM9tyNAevlDMemqVw7j+zM6B6hZ4EbG8Zq9MKuQi07RZqZ5Omt5qfpTvOHpwRqmK/Jx9N4nN9COTsXaLsp2OIjFzPOTcJ1x7wkdLI2zIl9tUQT9J90hx6Hh2cKXjTS+w4uEOC+YwrByzSGpxutqPfEcAAVw8KALara6Q= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(346002)(396003)(136003)(451199015)(40470700004)(36840700001)(46966006)(7696005)(26005)(2616005)(356005)(478600001)(7416002)(2906002)(5660300002)(36860700001)(82310400005)(82740400003)(36756003)(86362001)(40460700003)(336012)(1076003)(186003)(426003)(47076005)(40480700001)(6666004)(41300700001)(4326008)(7636003)(921005)(316002)(8676002)(110136005)(54906003)(70586007)(70206006)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:10.5856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30c4e4b6-c0cd-4497-bcb9-08da9a4c6f9a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000B8EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6239 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Currently, the default setting is that CLKREQ signal of a Root Port is internally overridden to '0' to enable REFCLK flowing out to the slot. It is observed that one of the PCIe switches (case in point Broadcom PCIe Gen4 switch) is propagating the CLKREQ signal of the root port to the downstream side of the switch and expecting the endpoints to pull it low so that it (PCIe switch) can give out the REFCLK although the Switch as such doesn't support CLK-PM or ASPM-L1SS. So, as a work-around, this patch drives the CLKREQ of the Root Port itself low to avoid link up issues between PCIe switch downstream port and endpoints. This is not a wrong thing to do after all the CLKREQ is anyway being overridden to '0' internally and now it is just that the same is being propagated outside also. Signed-off-by: Vidya Sagar --- drivers/pci/controller/dwc/pcie-tegra194.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 2631685e3315..d053e52b1778 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -46,6 +46,7 @@ #define APPL_PINMUX_CLKREQ_OVERRIDE BIT(3) #define APPL_PINMUX_CLK_OUTPUT_IN_OVERRIDE_EN BIT(4) #define APPL_PINMUX_CLK_OUTPUT_IN_OVERRIDE BIT(5) +#define APPL_PINMUX_CLKREQ_DEFAULT_VALUE BIT(13) #define APPL_CTRL 0x4 #define APPL_CTRL_SYS_PRE_DET_STATE BIT(6) @@ -1453,6 +1454,7 @@ static int tegra_pcie_config_controller(struct tegra_pcie_dw *pcie, val = appl_readl(pcie, APPL_PINMUX); val |= APPL_PINMUX_CLKREQ_OVERRIDE_EN; val &= ~APPL_PINMUX_CLKREQ_OVERRIDE; + val &= ~APPL_PINMUX_CLKREQ_DEFAULT_VALUE; appl_writel(pcie, val, APPL_PINMUX); } From patchwork Mon Sep 19 14:36:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980529 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0869EC54EE9 for ; Mon, 19 Sep 2022 14:37:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230135AbiISOh1 (ORCPT ); Mon, 19 Sep 2022 10:37:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbiISOhU (ORCPT ); Mon, 19 Sep 2022 10:37:20 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2043.outbound.protection.outlook.com [40.107.237.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D9BF32B89; Mon, 19 Sep 2022 07:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZMYBIyL9KN8AhSwV0hGOLBnClYnnSD72NfBqKsiU1vp7FAxwcclHmSpwUo6NBOYhZ/fTpEh7O74LWSXYmGx96EaAezqkorHiewBQonGlJ2daWWqAT/KjWMr+vVuMdDoDzqlJME9FroUXCVCfvUxdTIEfRyxzrCOuSY2hQa3k4Vwq0Roho9Txe0NUOpkpzvfss4wkaPYHuR3DEd3RAZa6lGhZzdfyqIWR2U79I/wlycfO4yYd6OVM2lQilnzZi80uOgogf5xni1d695nYmEOKHgL4mmZEowmnkf8MGNsvaFGi0XTciREjkUJoT2HsCyo7DYqbwGhK9JtwzkAr8j0Aeg== 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=sVBebQ49Srt+cVV9jMHtGZ9hGiIsSsQyUgx3EP7CK3Q=; b=JWoIPfpJPDzG5OMyjGtEumaKOD4RL9D0CNrk4z9g/V8HgH7Z2YiLIjs41n4FnzODZKwV5exC5nW/atJw9Uqkc9v3fzFepLWccKsNVGyJ6aL++FmsxnZ4Yg3Hl9UXlFpwwcoGlV3pJyWxQ2ShnoG+WpQG7ugiDjSfZKqcQ1SDARw6oO4IR9NeW89JCbMN0cyNAAIs8NX90dpviqnrQWCkNTge7qHkHGozvcyeP3pf1kk1GWm29aHiLCxB4oAM84yQXURP5LHfgxumqK6hCDo5lfv+QAEyBm1WBSMiRb9d0TITien7XRlRZOQNpKaKnyfWn8xE9n8O14u6oVq5q5xhZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=sVBebQ49Srt+cVV9jMHtGZ9hGiIsSsQyUgx3EP7CK3Q=; b=sGM9rl07tFcwkjdBfjARllZyo7DCLLu5IMiTfGG9tI4DbqMuEWhqB8zDyZoil7MdWRKEGCIskwkbDAi0CiqaG9P25p9m5HhGgFjm751kYamgzd1uXg2vp5hwip1NtbgCPfJSr6ICjHkxAl42ojBPryNMbHSPDtb+a5wkXWWa7V6Gf7zjDQUcHDOTp6/adqiTkApBlw6jl8hmjPX5/Vl5lUjQPZN5bsqFjpQzd0GaxymV+/ides6h9yhtsLiJJ4kvEyRWmTM+hdhngRDbMprG/ay9tqPHE9U//if+q4DmYzizJ9T94nyyqT1FmStBgSqg4Suhkm/OdqaKleTAg6qKQA== Received: from CY5PR14CA0007.namprd14.prod.outlook.com (2603:10b6:930:2::8) by SA0PR12MB4558.namprd12.prod.outlook.com (2603:10b6:806:72::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Mon, 19 Sep 2022 14:37:16 +0000 Received: from CY4PEPF0000B8EE.namprd05.prod.outlook.com (2603:10b6:930:2:cafe::5) by CY5PR14CA0007.outlook.office365.com (2603:10b6:930:2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 14:37:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000B8EE.mail.protection.outlook.com (10.167.241.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.11 via Frontend Transport; Mon, 19 Sep 2022 14:37:16 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:36:59 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:36:59 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:36:54 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 3/9] PCI: tegra194: Fix polling delay for L2 state Date: Mon, 19 Sep 2022 20:06:21 +0530 Message-ID: <20220919143627.13803-4-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8EE:EE_|SA0PR12MB4558:EE_ X-MS-Office365-Filtering-Correlation-Id: 82aca797-46fa-4cf6-47f3-08da9a4c72e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FjalXqeLe0269Jpl+NshmXvdpRc8IcXjJ5TaJJIs2lTVKNLOtnWX4vQpxjrBsakNv0lossMMU8Gw5+PLaYr0nyww6Oi3gn91wgoY+s1OWa3FNduCOP7bBVRLkokjhH6GGBbFm0W8mwukNFoTMwevjuBcdCfuuE6S51qq0dzZnSw2XHcunNOdUBoNAUZTLqvUmRNbUcF5RcVuK0EewOzfvtgXt3WVUOuzsQ98TNjS1flTmMsEc/6/DWmdDijWzX5IohQZXFA/OJJIJjp7tMDMzGVK6c4NBUwd0KcPLQvioM7zfjQmvIVxSzE0jKCGbqlcdV2EpaJ65AG9ysJQU8MbCkij/hjaS1znXCvOcI8yc6by15HhjtAJsMWndilsS6sFm+nYOcIOyvSyeaVMycGo7v2WLPHspwRnlJYqg+ifzzRczeRGjtF5722hrJszOk7XNBAyCmMjvLtNIzW6z1bXBQx/txG59nApOtlU7+wBMAswAikCOHYAfFGorG6W1BznTy0Cmc9zI+WJOGJx9N8JRmLJjylsPLVHrRbtEIpzhaHdzYFUxohXZHgW++zgk90NtbI4qr4B4jWXgPQf1oqyLTetpFcDYkHy8A5ZCQiGoiluOtviis1bcfvhMb/35gdFwDEZswR2G3Il8o9HwxZn8wW+7yi6lfV5B/7eS3qF0jbguoYdRZVi2P1wGNyqFfg4DkwLnAUU9wLeJ7r4MnyfeFBW1J76k7JqE8IMYsQDI/s8hV7KGnZDcixV7QASJ8egNAXsp4fvksYRllMl+QX1O/5hOmRD7EhssmHbPSzB3qA= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(376002)(39860400002)(346002)(136003)(451199015)(36840700001)(46966006)(40470700004)(36860700001)(8936002)(86362001)(83380400001)(5660300002)(7416002)(426003)(316002)(47076005)(36756003)(70586007)(70206006)(186003)(7636003)(1076003)(2616005)(40460700003)(82310400005)(478600001)(41300700001)(336012)(2906002)(82740400003)(356005)(921005)(26005)(110136005)(40480700001)(54906003)(6666004)(8676002)(4326008)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:16.1139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82aca797-46fa-4cf6-47f3-08da9a4c72e6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000B8EE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4558 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Current L2 state polling with 1us interval is too aggressive. Based on the experiments with different endpoints, LTSSM state transisition to L2 is happening between 6us ~ 40us. Hence, update the polling delay for L2 state from 1us to 100us for a better utilization of CPU cycles. Fixes: 56e15a238d92 ("PCI: tegra: Add Tegra194 PCIe support") Signed-off-by: Vidya Sagar --- drivers/pci/controller/dwc/pcie-tegra194.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index d053e52b1778..de477192c4b8 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -206,7 +206,8 @@ #define CAP_SPCIE_CAP_OFF_USP_TX_PRESET0_MASK GENMASK(11, 8) #define CAP_SPCIE_CAP_OFF_USP_TX_PRESET0_SHIFT 8 -#define PME_ACK_TIMEOUT 10000 +#define PME_ACK_DELAY 100 /* 100 us */ +#define PME_ACK_TIMEOUT 10000 /* 10 ms */ #define LTSSM_TIMEOUT 50000 /* 50ms */ @@ -1556,7 +1557,7 @@ static int tegra_pcie_try_link_l2(struct tegra_pcie_dw *pcie) return readl_poll_timeout_atomic(pcie->appl_base + APPL_DEBUG, val, val & APPL_DEBUG_PM_LINKST_IN_L2_LAT, - 1, PME_ACK_TIMEOUT); + PME_ACK_DELAY, PME_ACK_TIMEOUT); } static void tegra_pcie_dw_pme_turnoff(struct tegra_pcie_dw *pcie) From patchwork Mon Sep 19 14:36:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980530 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E42FC6FA90 for ; Mon, 19 Sep 2022 14:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbiISOhg (ORCPT ); Mon, 19 Sep 2022 10:37:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbiISOh0 (ORCPT ); Mon, 19 Sep 2022 10:37:26 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2073.outbound.protection.outlook.com [40.107.101.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FBB32CE17; Mon, 19 Sep 2022 07:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kPkKzL5B6Rrw2Lh3S921xtF5v0GBC9uxiqZ3mHiUtnzEgvLm2VTsrVhRGHYdoB0LheBgHknY9hYW5SdlKr8vFbT7H6t1j6hI4m22dXMT17frewyPH+JeuGbIc1Li1lB74VaGtMxJzO5F4uJ0ZO9krsY5/H2709qI3m59oV+H3aQz9P0w2v3o9cfrKKOYiFGsLEXV/gwVbf+VsJW2KlpuqJOzFq6Aq3enFR7qDcC6zofNEDzHaWxkcaa3Mxzp5+1GJzJmHy2DJfcE7b1RKPo47la2e4KpkjJ3vH12ljN5O3TLr6wYQhCY1draVtJk64aTfjIMziem4amTq3qnSrBdjQ== 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=P8n0kLhHcUZbLMPCf87Ar+KuOHZRIVetp07CXqiub/4=; b=GUYf5N0JcnXW8ovEtaZGUauWjDkgK78UMleIKA5V5BP0gICUaMQiseW6I8dyOJh3RoSd0fwXSgjRuWPpy+EzWkbwo4PdzTyMD9Mz2KEu8LRO3xWDE2nw7k0SGGMPWpaR+vbFXCe2YP2c9bYs2ZyzIX+DPxeN64vADeWwOcnPoU1Fsd3Qtg0Tkr1PrU+HGTxhzklxIR79AHg5YI6CVgmK+ImQMbrYW7XiFYNQyvtzDErhu9EtG42D1bmj9CqgK/dzZlLtsrWtVvMKfY2RxwXDLpBVypdIqKBuxh+GVJBFVAHb1iMlBqsWuFBbaZcJbuyXdf28tf56snaViftW/ThSwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=P8n0kLhHcUZbLMPCf87Ar+KuOHZRIVetp07CXqiub/4=; b=rtLDnjLyGSiRfcHQ67WXQy9NuQH0FlGfiX7/L4MxQaPASRVwe4ePYEDK1ca8ynUoVa2Z6XkHPNwsleYJvwyli9neUthk86rO8ExfgwS4Eb69F5jox4/mRoGcLwQPxkSUTh2/pqfIDCTvjZY9csVMKnnXJ8UCedaw+hXFalIjc/iL5EX04uwJHCOdD20Xc7iTthBhQvjovJkeZNHfUgfuZ6ntl+18z0MEzhJwqI4he4ZjqomONXZRkQvocaPHYSRHpAywdVWvbbQ1aqlslf5E0wOqBZLDS6aPyD8ZLl+wsqflHtgJDP3Az6J++g5Qxsbu8VSXvcIguoJbCcVc9wySiw== Received: from CY5PR14CA0001.namprd14.prod.outlook.com (2603:10b6:930:2::13) by MW5PR12MB5623.namprd12.prod.outlook.com (2603:10b6:303:199::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.18; Mon, 19 Sep 2022 14:37:22 +0000 Received: from CY4PEPF0000B8EE.namprd05.prod.outlook.com (2603:10b6:930:2:cafe::c8) by CY5PR14CA0001.outlook.office365.com (2603:10b6:930:2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 14:37:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000B8EE.mail.protection.outlook.com (10.167.241.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.11 via Frontend Transport; Mon, 19 Sep 2022 14:37:21 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:37:05 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:37:05 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:37:00 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 4/9] PCI: tegra194: Handle errors in BPMP response Date: Mon, 19 Sep 2022 20:06:22 +0530 Message-ID: <20220919143627.13803-5-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8EE:EE_|MW5PR12MB5623:EE_ X-MS-Office365-Filtering-Correlation-Id: 5415fe60-70a6-42b1-583b-08da9a4c7664 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K9olpM6m2RMw/DC0FHwxhQuPby2SfRKfFMyiqguPIy/Nc8lCtpvivMHOZRy829fgtMspWYxbwuICqcskxk75tdmfbIrhF2UQ0mgx1SsTNuLKbY5iBZqKxzJiJPz6FMA5cY4qv+2yRwgysdTlbz4HLJlkqDgJVpp6AKvcmv7/jNKZ4GY4Wy5fSuWV8KhvrIXi6tnZ3xhirt7FmKP+7+uyI3df//W81Xq10kluLrl0X/gwIFDmmU0x5SK83cReZ+i3ZTICmMKyA17bPSiTwkShkvWuvdc/emMX4iiwlJw5QOaMzCV15NjmAiWwPRK+yOgXdpgpXjQV05y5/UMC2d0dLQePaaa2jr2Cr1SJDB6VcbrV+jGvK8N6u4xM4BOV/hT7TbD8Lx3VJoXErqJpMmSCt7uCDMbBSgcnlKEJJayCFmjXRIT9JU3WgmS4yfGzkr67fWbWFJA3+js57+pIdFK8o1cPa5LKEQ6WN2aZ2YvFchWgr9d9geRqNoAaZWVmAUQ2QZgAamYkw3Hov1saRtjU6fOjjAK8CAPHhDjYy7nqmqOTC84XHgYPNDKG4PS6oPb1VbcOOcDorWX7XYbCAZ/s5brrGev1NTEw3s2Uj6eDwTKqwE3X2DsCLRNA5qJDiS5nm01CAbM0OhgbS6LlOd/gLMwmAx/i2KpvHY5KW27xnUwdh5Gel3wpov3uXVM7Y2Ygr3VKfAunHNvrfIzpOH2v+F276GZlXLeTOHhMAxILQRm1NmGRige51QbH7jnsGrthyoQxUzg6NhuPBVd2oaeeerpITUVeeEKtnrRpZ/XBJEM= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(39860400002)(346002)(396003)(451199015)(40470700004)(36840700001)(46966006)(36860700001)(86362001)(47076005)(83380400001)(82310400005)(7636003)(921005)(356005)(82740400003)(8676002)(70206006)(478600001)(4326008)(5660300002)(41300700001)(316002)(54906003)(40480700001)(110136005)(426003)(7696005)(6666004)(186003)(26005)(2616005)(1076003)(70586007)(336012)(40460700003)(7416002)(2906002)(36756003)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:21.9732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5415fe60-70a6-42b1-583b-08da9a4c7664 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000B8EE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5623 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The return value from tegra_bpmp_transfer indicates the success or failure of the IPC transaction with BPMP. If the transaction succeeded, we also need to check the actual command's result code. Add code to do this. Signed-off-by: Vidya Sagar --- drivers/pci/controller/dwc/pcie-tegra194.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index de477192c4b8..65c2c689fcd5 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1203,6 +1203,7 @@ static int tegra_pcie_bpmp_set_ctrl_state(struct tegra_pcie_dw *pcie, struct mrq_uphy_response resp; struct tegra_bpmp_message msg; struct mrq_uphy_request req; + int err; /* * Controller-5 doesn't need to have its state set by BPMP-FW in @@ -1225,7 +1226,13 @@ static int tegra_pcie_bpmp_set_ctrl_state(struct tegra_pcie_dw *pcie, msg.rx.data = &resp; msg.rx.size = sizeof(resp); - return tegra_bpmp_transfer(pcie->bpmp, &msg); + err = tegra_bpmp_transfer(pcie->bpmp, &msg); + if (err) + return err; + if (msg.rx.ret) + return -EINVAL; + + return 0; } static int tegra_pcie_bpmp_set_pll_state(struct tegra_pcie_dw *pcie, @@ -1234,6 +1241,7 @@ static int tegra_pcie_bpmp_set_pll_state(struct tegra_pcie_dw *pcie, struct mrq_uphy_response resp; struct tegra_bpmp_message msg; struct mrq_uphy_request req; + int err; memset(&req, 0, sizeof(req)); memset(&resp, 0, sizeof(resp)); @@ -1253,7 +1261,13 @@ static int tegra_pcie_bpmp_set_pll_state(struct tegra_pcie_dw *pcie, msg.rx.data = &resp; msg.rx.size = sizeof(resp); - return tegra_bpmp_transfer(pcie->bpmp, &msg); + err = tegra_bpmp_transfer(pcie->bpmp, &msg); + if (err) + return err; + if (msg.rx.ret) + return -EINVAL; + + return 0; } static void tegra_pcie_downstream_dev_to_D0(struct tegra_pcie_dw *pcie) From patchwork Mon Sep 19 14:36:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980531 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81878C6FA91 for ; Mon, 19 Sep 2022 14:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230195AbiISOhi (ORCPT ); Mon, 19 Sep 2022 10:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbiISOh2 (ORCPT ); Mon, 19 Sep 2022 10:37:28 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2046.outbound.protection.outlook.com [40.107.93.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6C8B32DA3; Mon, 19 Sep 2022 07:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lIe6LZlb/9CMLBzu6GDaoYtPqQDF1/3dhjZ1lG1mNka2TFYg+u0AZrdbXr2LlOkD0nT7gbEkiLEeZMxBb9iVW9Tiid2rsqSo7F1IX+1bS7bYOG0QWeQ7bfET86wwMN60W5bfj3kz/xev4fQBlP5wcJ7htp23PqbBONfDpmnKRYhjI8ek4NOaoJoIXqtP1OrEShWQwTeblpOl5lSs/qDyqvc2OD2YEs6pEf4LBbujKBy4pL3q+A5orMENJEZLQ/cGvvtb8mHUq7RoOIC2zXQm76G+B9d9jb7yB/EcxHThjLJu9xRNjhWncApDfZBayx0tLzbaRtnsczClDC4uKAacBg== 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=zaUGzJWgxubPULxhpKeOFhUJ/BBEMitqnXBEZaI8gY4=; b=Lmjt+fguCwRGyFky9P2L1QRcNyv09Ffg5M3cawyhcQqTmzQZxGLwrj+FdGZvJP+sCY8FZBxQ7K5dC3hrb8wsW6zxG2S5Mmakq3qHggxMdGjBgTSpfPjTNXOwiIaVHVY1ta8jcTpjHp6MuNftypbCMaYJL6iy47K4+7UR9JPWLvnWe2S0X7u5SnFOMrpLwc4N6ob+IY3weQaq6iaT9Ll+dl+17l4gl28ql30p4J4KHUveEw/Vt5FPniBzitDv8poSP6ErtK/I/ntpp3S3wqc9jtdhfOyN9nEUi7gNSTwWX3m56ay9d1ZC8yJfJsqjstuiYWcEJPaBoG56cSliZ3553w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 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=zaUGzJWgxubPULxhpKeOFhUJ/BBEMitqnXBEZaI8gY4=; b=Z5GpNZY8p5WqzdNiPkVjBSUc0nDv3WcPHqARBziWS6Rkg7pZYEQlvBqFKfItGuq7EPHmZoiX6Di8tfdThV47/YjNXw+jdud28MCepTygNtpsNx966Nq9EUl1oF4OoGElvlHG22IHCaAydqKtFSuEB2jSj5g6zyUFCmYAXIPcS+uXntCO9mvyra8znlHqW9msHEJDf6UUsSnpt2zXTyRvu7Tr5u3lE/OIzxYwyyfEJjoRWolikW3HCNKX6qzxnvNKVnnQLgebQTzCOiTykUm0kfyS+MV8naZLGOqQvkjyBHBBwmvWsPZUli37FrZY6xJ+BgL2xQY7S1TataR6BRhARw== Received: from MW4PR04CA0341.namprd04.prod.outlook.com (2603:10b6:303:8a::16) by DS0PR12MB7581.namprd12.prod.outlook.com (2603:10b6:8:13d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.18; Mon, 19 Sep 2022 14:37:24 +0000 Received: from CO1NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8a:cafe::f7) by MW4PR04CA0341.outlook.office365.com (2603:10b6:303:8a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 14:37:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT009.mail.protection.outlook.com (10.13.175.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 14:37:24 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:37:12 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:37:11 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:37:07 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 5/9] PCI: tegra194: Apply pinctrl settings for both PCIe RP and EP Date: Mon, 19 Sep 2022 20:06:23 +0530 Message-ID: <20220919143627.13803-6-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT009:EE_|DS0PR12MB7581:EE_ X-MS-Office365-Filtering-Correlation-Id: 36ab88e3-1230-4084-8fa1-08da9a4c77b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8D2ZhjBCQWnJ7g9ixtsGae2XObhcqG5SsqBP0byfrpBrtl1M5jYHhQgsWx2DT5bwIY6tCKsewor21GfmZek2w7m7/yo8wXrqsmDV0XH9j9tixaj+LmbhBi3/+RhVAxmrKUbxxjZovlMwWIAlAQxWksh+cwxXMig19C3sKMxVG7eajglhhpfLZY70cPoMFJ4ygCFaMRHkDhCDUXAjfAdK3QHjbt0S3Z1QshU5zENvjMIJhVw0IHBFSaO5pWg2zctAclZ+mb+U3rMFj5ATRsISkYQ112yevoBCVIynJhPoVlbfG5KOHWKOwhuvBrv5/gOo58/1PmM8ysfWlMBGnc4EeT57uHpjzJiFzqbJQOTrBcHQC9pmdj4SpWhg6dUguKg3y2V5OUMsR+T4xYzfScNiF1cVYM4AuReFTRwTyNZ6tYqVaerDWUx/DHv5jebnxnFDEQ8BPSdhNfsL8WmHqJ298cNh0CbRJELjV17meOfgZUhT8dTAHIpwRub8Vk2rx2xhdefS005kc/Lzi/y8Fn9EKhWa8NWR5XY5JhTCo9YsjS4WMz/i4nRq8A9YVqt0VXYPSoqiX2EtY/t/6Jh9LKC+oO/hwKxU6Miv5JkqXqRYMxsU5XrWpePG2eKNzK9lqXJ4l0+f2rN8tR57dlLbg7lTkDNxKpC+IhWXn/P4kEOZCm3ssER2t7qfC77Bzg8liywy6wtnYU0tS5PnmB7ubGY4rpcWdF9jTnNkeTBmKakqhNtOeJr3wtAvw+iucoicjQ8ze0RG8st5YyZCi825AUOGC8nX7xaHSYRtiXjTQkQ2koo= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199015)(40470700004)(46966006)(36840700001)(36860700001)(4326008)(36756003)(478600001)(110136005)(70206006)(70586007)(54906003)(41300700001)(7696005)(6666004)(86362001)(2616005)(7636003)(8936002)(921005)(82310400005)(26005)(356005)(336012)(40460700003)(83380400001)(7416002)(5660300002)(40480700001)(82740400003)(8676002)(316002)(186003)(1076003)(47076005)(426003)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:24.0788 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36ab88e3-1230-4084-8fa1-08da9a4c77b1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7581 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org PERST# and CLKREQ# pinctrl settings should be applied for both root port and endpoint mode. Move pinctrl_pm_select_default_state() function call from root port specific configuration function to probe(). Signed-off-by: Vidya Sagar --- drivers/pci/controller/dwc/pcie-tegra194.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 65c2c689fcd5..f96f60c49dcb 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1659,12 +1659,6 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) goto fail_pm_get_sync; } - ret = pinctrl_pm_select_default_state(dev); - if (ret < 0) { - dev_err(dev, "Failed to configure sideband pins: %d\n", ret); - goto fail_pm_get_sync; - } - ret = tegra_pcie_init_controller(pcie); if (ret < 0) { dev_err(dev, "Failed to initialize controller: %d\n", ret); @@ -2122,6 +2116,19 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev) pp = &pci->pp; pp->num_vectors = MAX_MSI_IRQS; + ret = pinctrl_pm_select_default_state(dev); + if (ret < 0) { + const char *level = KERN_ERR; + + if (ret == -EPROBE_DEFER) + level = KERN_DEBUG; + + dev_printk(level, dev, + "Failed to configure sideband pins: %d\n", + ret); + return ret; + } + ret = tegra_pcie_dw_parse_dt(pcie); if (ret < 0) { const char *level = KERN_ERR; From patchwork Mon Sep 19 14:36:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980532 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C90E4C54EE9 for ; Mon, 19 Sep 2022 14:37:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbiISOh6 (ORCPT ); Mon, 19 Sep 2022 10:37:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbiISOhg (ORCPT ); Mon, 19 Sep 2022 10:37:36 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2070.outbound.protection.outlook.com [40.107.220.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D72733340; Mon, 19 Sep 2022 07:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SJLhNzUmT8WPoZa1nxiNgCE3OgZNWTthmrpVb2DvgtkxKsRKJruYAqaqAUJ5tbv8kT9JMtYyyFec+VOLOlb1mvSGUcGPYTy06OR9xR4WRlAFnSSsCdUS188AAazquSLz/3MY9pLp4lrJs91hnLe9b9NZPv479VIFmbyyARNXrm3cT1XnETLbD0Q43dnWN6+uv70O7sUYFcuqAIEbeeQ1/86+ZNOCd0cRqIrj0IZ1UnPMKI0+fl/XOK4dxnvQqqJ3clFI28YMWWuqQjN1+ePRnAHPjVTxeNAwyDiVnL5dc7up4PWRzGXG/8zeYr2My6O0ZoWVYRAjeAzau0zEUAJTIQ== 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=TFlWkTNu9V41TXZGNNEmku00Z68ht2wRGvk+UbdMVbg=; b=cMAvZACL0yAkw1u8yDCNQLnArnLRkaOCVg4VRKttOPrWJUy+SbqzfH+6gu1roO+JFM7pRZrv5mJi2/xXKx37g20sgMqrfTBCnkpZXXkN2XWezCB4+kPqTAu1T7oQ2qDT/8xzZbzplKwhr4ktmq6l9EybnrrM66D+SMjr4b5QymHwtDl14AJIzU8qT7yuhaw16/yO8tSjCjAEXp4tGx3ZIm1TUpUWuHeXEg2OZg/3cOCbm0Fz3ig5D4Em6+3as81dYOrUZPTB+y45jpCrv4QosiVePc20knoKcr9AafCYexI9kIn73guAEPUGljvpBt/q/aV7VINeGPqrpQyQUet8dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 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=TFlWkTNu9V41TXZGNNEmku00Z68ht2wRGvk+UbdMVbg=; b=YJQZmKqB/i+W2Ij/QrHAaOTHCt7AG2YWfRbeiNUsRG6GbFR7Etr/EPKEFp9ohBH0PZOCL5NNwPp+l/4WEXSsDV4fHRGdIsLDG5lhFuJlh7qkQ5Skviom19rI8C7lqYgL3e4DwMWFtfoH45S4nmoqJ/X2+dWhQ/Bk761i549a7FB9Mz5vTs5SSRNI/kXrRJk4SM2JD2C37Y3eCYwa6B16lZCNTWkaQ/ThOOa/J+USjiEqYH83EsDW1z1DfVSPdTD5rwCy/uXncWHIRlr9AAdQN1+HdSkKV2BlsrvF7Y6kP7J95rgZDktvKlCQeNYVUCffpQ4YLqpNWKnAlJ89YXGzjA== Received: from MW4PR04CA0116.namprd04.prod.outlook.com (2603:10b6:303:83::31) by DS0PR12MB7679.namprd12.prod.outlook.com (2603:10b6:8:134::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.19; Mon, 19 Sep 2022 14:37:30 +0000 Received: from CO1NAM11FT092.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::ec) by MW4PR04CA0116.outlook.office365.com (2603:10b6:303:83::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 14:37:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT092.mail.protection.outlook.com (10.13.175.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 14:37:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:37:18 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:37:18 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:37:13 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 6/9] PCI: tegra194: Refactor LTSSM state polling on surprise down Date: Mon, 19 Sep 2022 20:06:24 +0530 Message-ID: <20220919143627.13803-7-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT092:EE_|DS0PR12MB7679:EE_ X-MS-Office365-Filtering-Correlation-Id: db22cfc1-12ed-457b-fc71-08da9a4c7b95 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0lnD+J89fOYwm8nCFylnp3HS4WAt3mP1safN9DqYW22gA/i3XHdAPprCurx6xqHjFfGKn1KoIUi9MWwEj8xN+PKAnpFtPWtF1Ucpa5Km94YorQVBhKmNnwAKBl4DKBkNAnjA8/9YCYLN+su2+CjnM4+iaOAm1F8Q5Bb1AdwwPmqz3fiwFHYC/GLFDNF7Qk+o3ylo51BRLVy+VT7IBRt0fbh7x0voOvpnDnHG3OYKZEiotiWhzb8R6nupqb1npbyCaqnF2SHwDBlBVKH7eCG1J1WL5pUxUeo41ogg8G31zjjVQXdzOzoqkzIpk1EKTeKjlHEMlmIfDz1GYQV3TkhCPZvIFeFWUlDTIUSBGFK6M54ydrbBV4DldthGzwJVl4KDIYD/NB4t/tK/NcrxbTQ6u9joI2rDxmg12ZYta5e3VMJbvvlWwme4BYixGhfOneU0sa/lD6aJqGhsclLlGw4Gyik3aCAw1bwS0beb7O6uIGIhYgD4QLXapHMrzgoM0Z3Lk771ujRfblEwoNQT4+f4o/3yw/T/vAOPIGPmuuS6kcHnbCKyLDuh+u0RqiyFvSo+0GHJx6pzJd3fKg0DtmhhxlgA6KIphNb23KfkRDRIS9cECYk3/CMzB4M2WIhM9RMZv7iar/9fFeHbttDwzCphkQS6k0EjVyJv/bf6G/ZhYc8XjE3Pu9MOe4okbQaEewaMm8aazAQcE/ajXhboPDbR0+wXDXUz+IgawwJPaZWxDj5+clLp6/F8gmQ78Ge3SJcpbblwGlKCTpXh2QkKSvaRzUnzrMFBxdgRbeKvvamCJnU= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(136003)(396003)(346002)(451199015)(36840700001)(46966006)(40470700004)(4326008)(7696005)(921005)(2906002)(36860700001)(36756003)(40480700001)(86362001)(8936002)(26005)(356005)(70586007)(70206006)(8676002)(41300700001)(7636003)(6666004)(478600001)(82740400003)(110136005)(83380400001)(426003)(2616005)(82310400005)(1076003)(336012)(40460700003)(186003)(5660300002)(54906003)(7416002)(316002)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:30.6403 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db22cfc1-12ed-457b-fc71-08da9a4c7b95 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT092.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7679 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On surprise down LTSSM state transisition from L0 -> Recovery.RcvrLock -> Recovery.RcvrSpeed -> Gen1 Recovery.RcvrLock -> Detect. Recovery.RcvrLock and Recovery.RcvrSpeed time is 24 msec and 48 msec respectively. It takes ~96 msec to move from L0 to detect state, hence, increase the poll time to 120 msec. Disable the LTSSM state after it moves to detect to avoid LTSSM toggle between polling and detect. Signed-off-by: Vidya Sagar --- drivers/pci/controller/dwc/pcie-tegra194.c | 69 ++++++++++++++-------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index f96f60c49dcb..e38fedd42034 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -140,7 +140,11 @@ #define APPL_DEBUG_PM_LINKST_IN_L0 0x11 #define APPL_DEBUG_LTSSM_STATE_MASK GENMASK(8, 3) #define APPL_DEBUG_LTSSM_STATE_SHIFT 3 -#define LTSSM_STATE_PRE_DETECT 5 +#define LTSSM_STATE_DETECT_QUIET 0x00 +#define LTSSM_STATE_DETECT_ACT 0x08 +#define LTSSM_STATE_PRE_DETECT_QUIET 0x28 +#define LTSSM_STATE_DETECT_WAIT 0x30 +#define LTSSM_STATE_L2_IDLE 0xa8 #define APPL_RADM_STATUS 0xE4 #define APPL_PM_XMT_TURNOFF_STATE BIT(0) @@ -209,7 +213,8 @@ #define PME_ACK_DELAY 100 /* 100 us */ #define PME_ACK_TIMEOUT 10000 /* 10 ms */ -#define LTSSM_TIMEOUT 50000 /* 50ms */ +#define LTSSM_DELAY 10000 /* 10 ms */ +#define LTSSM_TIMEOUT 120000 /* 120 ms */ #define GEN3_GEN4_EQ_PRESET_INIT 5 @@ -1606,23 +1611,31 @@ static void tegra_pcie_dw_pme_turnoff(struct tegra_pcie_dw *pcie) data &= ~APPL_PINMUX_PEX_RST; appl_writel(pcie, data, APPL_PINMUX); - /* - * Some cards do not go to detect state even after de-asserting - * PERST#. So, de-assert LTSSM to bring link to detect state. - */ - data = readl(pcie->appl_base + APPL_CTRL); - data &= ~APPL_CTRL_LTSSM_EN; - writel(data, pcie->appl_base + APPL_CTRL); - err = readl_poll_timeout_atomic(pcie->appl_base + APPL_DEBUG, data, ((data & - APPL_DEBUG_LTSSM_STATE_MASK) >> - APPL_DEBUG_LTSSM_STATE_SHIFT) == - LTSSM_STATE_PRE_DETECT, - 1, LTSSM_TIMEOUT); + APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_DETECT_QUIET) || + ((data & + APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_DETECT_ACT) || + ((data & + APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_PRE_DETECT_QUIET) || + ((data & + APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_DETECT_WAIT), + LTSSM_DELAY, LTSSM_TIMEOUT); if (err) dev_info(pcie->dev, "Link didn't go to detect state\n"); + + /* + * Deassert LTSSM state to stop the state toggling between + * polling and detect. + */ + data = readl(pcie->appl_base + APPL_CTRL); + data &= ~APPL_CTRL_LTSSM_EN; + writel(data, pcie->appl_base + APPL_CTRL); } /* * DBI registers may not be accessible after this as PLL-E would be @@ -1698,19 +1711,29 @@ static void pex_ep_event_pex_rst_assert(struct tegra_pcie_dw *pcie) if (pcie->ep_state == EP_STATE_DISABLED) return; - /* Disable LTSSM */ + ret = readl_poll_timeout(pcie->appl_base + APPL_DEBUG, val, + ((val & APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_DETECT_QUIET) || + ((val & APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_DETECT_ACT) || + ((val & APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_PRE_DETECT_QUIET) || + ((val & APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_DETECT_WAIT) || + ((val & APPL_DEBUG_LTSSM_STATE_MASK) == + LTSSM_STATE_L2_IDLE), + LTSSM_DELAY, LTSSM_TIMEOUT); + if (ret) + dev_err(pcie->dev, "LTSSM state: 0x%x timeout: %d\n", val, ret); + + /* + * Deassert LTSSM state to stop the state toggling between + * polling and detect. + */ val = appl_readl(pcie, APPL_CTRL); val &= ~APPL_CTRL_LTSSM_EN; appl_writel(pcie, val, APPL_CTRL); - ret = readl_poll_timeout(pcie->appl_base + APPL_DEBUG, val, - ((val & APPL_DEBUG_LTSSM_STATE_MASK) >> - APPL_DEBUG_LTSSM_STATE_SHIFT) == - LTSSM_STATE_PRE_DETECT, - 1, LTSSM_TIMEOUT); - if (ret) - dev_err(pcie->dev, "Failed to go Detect state: %d\n", ret); - reset_control_assert(pcie->core_rst); tegra_pcie_disable_phy(pcie); From patchwork Mon Sep 19 14:36:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980533 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D1F4C6FA86 for ; Mon, 19 Sep 2022 14:38:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbiISOiK (ORCPT ); Mon, 19 Sep 2022 10:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbiISOhx (ORCPT ); Mon, 19 Sep 2022 10:37:53 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2068.outbound.protection.outlook.com [40.107.96.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C421D2D1D9; Mon, 19 Sep 2022 07:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h5gexPYIBmcDznPpb7/aMEfXRJ0XG9HTYg06oC/mChwayQVcyyqyQgLjdHjLK2/CKb0HmejZJ1qkRWEzJcBcEDsVV91H+p1SD+yNgA+x7wQrKS9pfz4+86Q5R354ptOqmPv5iZo7mXVZephDb/AXeOENeGjrdQBDYzsurbP3lpomCgju29JgTdLPcLspxsXxvFlysW7Z/xReisYBCFXgcyQj9D2/hz1Vj8xAVWxRidBIGlQ/2mnT6bzG5hObwxbPTz3yWAJms9k6r1FrPWMQtavjZxkZ44fo44heGJqRc4AL/tsjCv5wvrwHvawpH5F9f6CYK5qcOga0VnfdBu9A1w== 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=tiEWsj+YiHB9L3CBMDKpcgIRxlNDTdm7uNs1Ay51CS4=; b=iWxSKGI2rq1pQI2tr27FaPhqPSmVW78pCe4dxk3Ou7p0fnAWWS9aMV7gajxdAC4GlPoEwa4qBnv5T0YlQpAzShz7KTAdsEdAysPsMEtxeL8xkMoyziDigW0ILDcM3Cj/KZEQ/jU2J4npAnNSVxGTHAI+o9LOzA36MItn4F348XJoq+jUTgo1S4pyb/eXEHYi0trtDvTjDZAyvwyx3YyCbgKEcPuACt2kC8iq7bqFKRhO3MCuaNxhqe/niDO0v2N+jYOUgEr8H8BfhVkw53BHgGGfWTFsClihoxjURtH2IG8OuFi3rz3DXqadbKaIOxHVPAwf2rsNJg/Nfep3RXJKiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 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=tiEWsj+YiHB9L3CBMDKpcgIRxlNDTdm7uNs1Ay51CS4=; b=cPUzrLknniN8anJGrGnsv1IxJAWZo+7xgOwWyaK/uankNqbYVnpxr6/KpHkSq8oX4RJFm/kSYdTay1vEdVFT2tcydtrtBLwUwdhVOeKHdrUdRvILN15SQwlqcW32Pmr9eVdlIhqMzSTUHS/8jQewXxUjGxkggBaa68LPbBZeUDb0L2TztV33Ppvb1b+PaaSpo10FJkqBgqRxPRjO8stQgvDZLb9s83NsIHRBL2oDtYjq1QzZx9tj9CluJ9tcNr8LBWBnBH25NCEuo+xP8tBjrpsnCHwFXEw9GXrE4q3L8ooSk2Fkpu0kJ1QXo8A/NQY6YNboj0nCjsyu+nE3/OXXtw== Received: from MW4PR04CA0098.namprd04.prod.outlook.com (2603:10b6:303:83::13) by DS0PR12MB7511.namprd12.prod.outlook.com (2603:10b6:8:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.19; Mon, 19 Sep 2022 14:37:39 +0000 Received: from CO1NAM11FT092.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::90) by MW4PR04CA0098.outlook.office365.com (2603:10b6:303:83::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 14:37:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT092.mail.protection.outlook.com (10.13.175.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 14:37:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:37:25 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:37:24 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:37:20 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 7/9] PCI: tegra194: Disable direct speed change for EP Date: Mon, 19 Sep 2022 20:06:25 +0530 Message-ID: <20220919143627.13803-8-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT092:EE_|DS0PR12MB7511:EE_ X-MS-Office365-Filtering-Correlation-Id: ac3e12c3-62d6-464c-e392-08da9a4c8087 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ruofb9VR2/O4wmUBo88sMT+5U3IRjNo4TLl/OVdMPDiqdq8Zf7Gb6gGL7Ik2d+xcW3GMSZshMLa73l2vy1OFfoejrFLHqdI85F4qi83Itz7VYo7Bq3l+38dlMPfVHodJn3w31iEyaltOPmvBwytKoeNA6wAHVa0WQK7fi9dDK0waHa54uq7G9HX4DasywqHgu3bruv2jsY+3UIsMCQt6g56TSKg57GdtMXKWtMz5dg1fLy9yPytOSX2Om7093EsMEx5F9e+h/BTXgMLyE203CDJf6mR9BhdK9RVNuKE+XvQuKjq8A6hiZKQggYgiq0K5dzWf9lo1FA52f/pydCcuQNqbD5+MYxuH3VNeCMSDMfQNr/H2dVK9filBB+GYKhInTZ+5fIuhG1J+mhehIZIiDmDsstTOGRuiHCk2mYzFPR5jIRcz07pH9IvFJAg2F3L5MNRfBI78egVXYdVWJgKl9HjoGoeuMzD4kGIn4Zi6PwCBusH2+lO6sw9ITiy5n/ANUhqI3cHn8Koa/boetONCety8wavD04ouI4dmHw0QW46mSds1LdMlgx3Fg2DB1whwe+2tH23u25sy504DGy8FkXcoZ8XrD95GDYHQC7jsvzMJKI4uINGRlJG0G9GVxYz3Kz/HvQ6l6pcbG7FTmgxGEKyP19FZIHSbp0MP7LFWfr/qUbWQrnFhjEB2Xw4seJQmS09qbhRVfzKPJDvLwwC2Ih66YNi8UzgjMlSJkNuDsCIT2fVtwyw83BohcpLEuNeGDGLLWr9AvnAfpHlzexzQrrQR3sqcFYYaDBuSAxFOIkU= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(376002)(136003)(39860400002)(346002)(451199015)(36840700001)(46966006)(40470700004)(2906002)(8676002)(26005)(7696005)(82740400003)(478600001)(110136005)(40460700003)(921005)(7636003)(356005)(316002)(54906003)(1076003)(7416002)(5660300002)(186003)(336012)(83380400001)(4744005)(47076005)(426003)(70206006)(41300700001)(4326008)(70586007)(36860700001)(2616005)(8936002)(36756003)(86362001)(82310400005)(40480700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:38.9365 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac3e12c3-62d6-464c-e392-08da9a4c8087 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT092.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7511 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Disable direct speed change for endpoint to prevent it from doing speed change by itself post physical layer link up at gen1 and also to leave link speed in control of the host. Signed-off-by: Vidya Sagar --- drivers/pci/controller/dwc/pcie-tegra194.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index e38fedd42034..35d9c3ac3028 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1872,6 +1872,10 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie) reset_control_deassert(pcie->core_rst); + val = dw_pcie_readl_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL); + val &= ~PORT_LOGIC_SPEED_CHANGE; + dw_pcie_writel_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL, val); + if (pcie->update_fc_fixup) { val = dw_pcie_readl_dbi(pci, CFG_TIMER_CTRL_MAX_FUNC_NUM_OFF); val |= 0x1 << CFG_TIMER_CTRL_ACK_NAK_SHIFT; From patchwork Mon Sep 19 14:36:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980534 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E8CCC6FA86 for ; Mon, 19 Sep 2022 14:39:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbiISOjJ (ORCPT ); Mon, 19 Sep 2022 10:39:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbiISOiL (ORCPT ); Mon, 19 Sep 2022 10:38:11 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2053.outbound.protection.outlook.com [40.107.223.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11B5332ED8; Mon, 19 Sep 2022 07:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N7DqxgRVfBMiJIArFHL31SF0q4sCDkcafnXHNOYx394D+SF8TFjsPuWJR1mliN0L6XGNXnEheraThXQ82tDZ7ZCC1NMaB1I7xg2OYpASYj5lwS0Q1vz76y8AVAbvSAX3itGIP2UjP/Iud4i3ui+49Wbxf8qwMb5qcUgZ7yMl44ub/dbLsK372YcU9praWjbiUiR4VERI9e95knVcKGf8JFbi/FnFGB/sVPbNdSQC/27aLJvgnzrWYkp2dgJiOawS/PVm9sr+a2jEnx/PVUbfBR/9qZhKrh/I56TxTLjQBwJdC0XgpqhpDLDXSrVuJXrN2JM7UQnxuFdLOcBk3q9nyA== 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=FnAtwekcHHDRLavcRXog0C9Oubk7okQrTs+/jrqPwcA=; b=MkjfwDdzX8GN5hSXnyqyBEIJXB+TYDitGEJJoa637VkwooA/T54Jfhypxd/OtOG31oN0Lz8doRuiMtMSnPxGFUhPXcNem1ZfKgH0kv5RipcfifB6KLbRuGawEy2vajT76MHQfbGLQ3XsUSy9b1y44CfzhdGv+CSBXUpl1B+9NF6r9O1CipAegXm/aZs7d0w9DG7FNzRaxw8XYDEsR62CZn28+hnbgRVAyhGSmsm7EcBvrUlp5x+LG2JSMzM4sP6EzAXrDeYQPkQ+ChfbxRl8n5E/vyKJoczvKVbpENE7l7N/QFadE2f43A18BvruBXQJq56bt9st54HlWWwq+s50+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=FnAtwekcHHDRLavcRXog0C9Oubk7okQrTs+/jrqPwcA=; b=TPTYYjXF4bPfeS/8Pc8u4O5JtnKfe8xB1Bj2dRtGChZERHiekW+5DvFoyLDIxntaJbwW/7yCSACFbi9HFC27/gjunTu1HjRLPv6BmC4Ze1pXlgI4oeZrq6aWC7OVenElAWzy0YQ315H817AgZXtaw4CYb2/aqUIoi0GGeuFgawFaahY0xgLmvIt/DOp8GJZxh9Ns+Lhu+Oq/zC+jRo1CJst5hIYbfgyQ4HrYQGsoZE8b+ZK+Lx1XZuE94fCJ/rHkJL3tNyFbteT7jAfePZpT1LKL/H7Yf6x3HDaZEyjlkXRcLMPK55nUosHfseBD9FbConge7Wbvvvq6smtAwrUQWA== Received: from BN9P223CA0018.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::23) by DS7PR12MB5912.namprd12.prod.outlook.com (2603:10b6:8:7d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Mon, 19 Sep 2022 14:37:52 +0000 Received: from BL02EPF0000C405.namprd05.prod.outlook.com (2603:10b6:408:10b:cafe::ae) by BN9P223CA0018.outlook.office365.com (2603:10b6:408:10b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.16 via Frontend Transport; Mon, 19 Sep 2022 14:37:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF0000C405.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.11 via Frontend Transport; Mon, 19 Sep 2022 14:37:52 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:37:31 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:37:31 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:37:26 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 8/9] phy: tegra: p2u: Set ENABLE_L2_EXIT_RATE_CHANGE in calibration Date: Mon, 19 Sep 2022 20:06:26 +0530 Message-ID: <20220919143627.13803-9-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C405:EE_|DS7PR12MB5912:EE_ X-MS-Office365-Filtering-Correlation-Id: 420b6c38-0515-45be-3523-08da9a4c8883 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p1PIbaYo65j6rE1UQyDj/rn7kdWoPrMkVo1Nf+wR75F8TzXXlbgFaXlx4Zp8AI4hj6FZGJdFqcIgb1L5IMmCwj5FIFIw4L+8MUzd+/pV8ZdwB42IEDzGWhPi9ZEB26kOi9/5DP8VgSirL03SR8fTiAlgnNZWCHHYZWlkysCqT4NDOmWvyUEKJYFSoGCa0XOe+ZOBjCvVOaKbQlM/Om9rW2GePXD2wosIwNFSF/0X2VMbcQQVyqDEYzB8++KJMpycRbIBP6DT0Q7qMPXW+Y7GahfVzaWfvSv/fRlyvkjNlhXSN4CtzbyI9PE7Wr2wYUPqZoHdUF3gu9dzrVfQbldlso7E94LKGG/+jA5GBXNTJkXJ8H5V1fFHiFWykUqYc/LC71QmkCEMxRQbrrwkfMOW1a1bcDKU9uqGfZ1+cZ1jCVBy/euKJ4oxM8LHEOcocQVsP2tbDwQhwnt3H9JcPkMGoda+FhGL77/+drYfNkiKDwy+G92CWR2jgPpXkMMI44UsEEVndEnDUYwfn7NjdQLaJVoianJcEaWSy0eSgrC+cL+7T5IaRcM/JhjTwYejlEvANIfhp7Jrr7Dr8dJLoFWSQwr79EXJvvB3+2g6a2Ctu+dvsjeJAqNyHLFV8Q+ENo7hKKJzyI+wCVOLqpHv9cVGw5mAQuCajT0PBAlQyPbTsHNRtmvOyLbJ24qrHuiM82KJb1pnUS8QdqtKwyH4SiHUb1rIxrL1C0WBZSNBdGDmt02I8OfhOKTs9TAjfGXbYqJnsYyybzF8LWaORy5LPGWaSyuFYuyXBab9o0bAC2i+gac= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199015)(40470700004)(36840700001)(46966006)(36860700001)(921005)(40480700001)(7636003)(86362001)(40460700003)(4326008)(82740400003)(110136005)(356005)(41300700001)(70586007)(82310400005)(70206006)(54906003)(2906002)(316002)(8936002)(5660300002)(7416002)(1076003)(186003)(47076005)(8676002)(426003)(2616005)(83380400001)(478600001)(336012)(26005)(36756003)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:52.2338 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 420b6c38-0515-45be-3523-08da9a4c8883 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000C405.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5912 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Set ENABLE_L2_EXIT_RATE_CHANGE to request UPHY PLL rate change to Gen1 during initialization. This helps in the below surprise down cases, - Surprise down happens at Gen3/Gen4 link speed - Surprise down happens and external REFCLK is cut off which causes UPHY PLL rate to deviate to an invalid rate ENABLE_L2_EXIT_RATE_CHANGE needs to be set to bring the UPHY PLL rate back to Gen1 during controller initialization for the link up. Signed-off-by: Vidya Sagar Reported-by: kernel test robot --- drivers/phy/tegra/phy-tegra194-p2u.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/phy/tegra/phy-tegra194-p2u.c b/drivers/phy/tegra/phy-tegra194-p2u.c index 1415ca71de38..fb710e89acac 100644 --- a/drivers/phy/tegra/phy-tegra194-p2u.c +++ b/drivers/phy/tegra/phy-tegra194-p2u.c @@ -15,6 +15,7 @@ #include #define P2U_CONTROL_CMN 0x74 +#define P2U_CONTROL_CMN_ENABLE_L2_EXIT_RATE_CHANGE BIT(13) #define P2U_CONTROL_CMN_SKP_SIZE_PROTECTION_EN BIT(20) #define P2U_PERIODIC_EQ_CTRL_GEN3 0xc0 @@ -85,8 +86,21 @@ static int tegra_p2u_power_on(struct phy *x) return 0; } +int tegra_p2u_calibrate(struct phy *x) +{ + struct tegra_p2u *phy = phy_get_drvdata(x); + u32 val; + + val = p2u_readl(phy, P2U_CONTROL_CMN); + val |= P2U_CONTROL_CMN_ENABLE_L2_EXIT_RATE_CHANGE; + p2u_writel(phy, val, P2U_CONTROL_CMN); + + return 0; +} + static const struct phy_ops ops = { .power_on = tegra_p2u_power_on, + .calibrate = tegra_p2u_calibrate, .owner = THIS_MODULE, }; From patchwork Mon Sep 19 14:36:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980535 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8A0FC6FA91 for ; Mon, 19 Sep 2022 14:39:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbiISOjK (ORCPT ); Mon, 19 Sep 2022 10:39:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230233AbiISOiO (ORCPT ); Mon, 19 Sep 2022 10:38:14 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2041.outbound.protection.outlook.com [40.107.244.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57B1133340; Mon, 19 Sep 2022 07:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QayhDmnA9ApvqeJeCIGw/gL1vnxEepmr3Z67GMJ1Tk4XfVqD6WLTFakh/CeUNqKtDb+dI/fcgUNMJ0fRC9wsoRZ2b+Dy1I53wGhut8jpguzgLAPZCVc9viFP/r79MgKmnkwJNDdHUHyg3R0WEj1qHjNMB0ilHa+Tq3EwL/8vzN8phfrjpDJMv2hlxr3dbhDYNUzGntxIdUVvHtu9kub9cZov/1Q8VhETcw3MozOPnydsiZQVTmdCYSdoEV9wswdEG+xXS6/mi0rJc1+aH0MqrxjgjcuNQpdEuMEcfer8YaC4WFNTcSK7DFqVYSqR8843hLF5p0gclqlbfu920Zc/MA== 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=aNEuoAkK/d/mqFwLlNd/9+V0aRMbVSREyD6fli6ZEUo=; b=nDnnm9Y/lOwkzeLCK49gd6fCz46QMyei7Uh4gq4OUsF9ZPKt7WdWmobzhFgRgeCr+grq6KRgx9nxitAqrktNQyKzhlENCWlFqqxZJq8I+MQB2mn/MWDEDogNuJjrpEC8CYHxW3Hct7OG14g0rjBurUksbIrIvth+fjF/tKzeCA2fjQp4hidrPdCmIybwjtA+Az3mbeKqyDoLhqoLFYBwkNPgmtl2SF6OYc73kX3t04OdHcLGQh9TneViphfhgjFxvpdeBUp0sFPlICK/pKIqyhyrLoEmKC6gGPlUSy92NnXhTxKvkuAvbrYVRQOhFVx+2IeQ9BSvxMWytO1YsHdC3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=aNEuoAkK/d/mqFwLlNd/9+V0aRMbVSREyD6fli6ZEUo=; b=klUZah37TsTmtoiPrjNFdhI1Q0C2GVJEhPvVQIQbnugWd2Yh7p7rDUlGO+G5kXY+tB2paDP1ITlzAEhCFxzjbDs4CWNKVfqhR5JFCugegvGvF3iGBCaByXKi0Tvb7ufztBcBlMh/iLrQzctNaiImXIEJ9FOckNeyJCoDTgLMtIdDzCKBrPlyywtxoh2a/AHjv3K+ilvgwydpMNm10jIR2A4u9z85aInnLW88C1HtAvtR0lk8b0zb0Rhife7T70LvlaiOpB5AvN56SQf+LrevFhNeXvP8nn2Ia7cN6FEPwK6tVlWZ8Yo+to8caweCFqvJJxYcuaFgxaA78xQI/G0xtw== Received: from BN9P223CA0026.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::31) by DM6PR12MB4467.namprd12.prod.outlook.com (2603:10b6:5:2a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Mon, 19 Sep 2022 14:37:57 +0000 Received: from BL02EPF0000C405.namprd05.prod.outlook.com (2603:10b6:408:10b:cafe::57) by BN9P223CA0026.outlook.office365.com (2603:10b6:408:10b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 14:37:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF0000C405.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.11 via Frontend Transport; Mon, 19 Sep 2022 14:37:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 07:37:38 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 07:37:37 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 07:37:33 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V1 9/9] PCI: tegra194: Calibrate P2U for endpoint mode Date: Mon, 19 Sep 2022 20:06:27 +0530 Message-ID: <20220919143627.13803-10-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919143627.13803-1-vidyas@nvidia.com> References: <20220919143627.13803-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C405:EE_|DM6PR12MB4467:EE_ X-MS-Office365-Filtering-Correlation-Id: 4dfc0250-5797-406b-def6-08da9a4c8b12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /UmuSG5VZmFKeTkCSVqiutj4X04xCHFXmqIlLteLWvAUhrcbCiw0OUrnB5+vCEzFCJozeBZqvemop9Lz6Rz+iGb6cD4OZ0As3X8v85aihsRjdQmWvVhyYpmvyAEPHwK73Ru7SM9lRxmai/+yOsu0SuIufNb9Vh6HkrpVgUfwE398awAEW4tILr5BdtKCv9zTZ9TTomlKQL9bYeosY5kySGmetz6HUzRhzHfizlr2DSBHl9XiQasAaCb2hO2jeFwyb2NHHklaCDpmeUFp1DZtsG9Sc77zU8sb3E4FTCUGWsVFN4RLShQKKfQTzKghBuXBKRMQSJBFEnDWUS2Wykp4a1BTXReEarQmxpA9mcUVIOuhfkuU5GxTJc0d0TrHFAJIu/jXieKiFMwSvStzvFcPHzmRIQviO3L9VfH3+0EFxAysvJtonztPCeHJwSu8d+IjRfcrWboDdbZM29/3trU7fnasm/bf2P9E8W3hXGQpyNxFt60JFf24NRldUGmRIxf0/mEwGhzxJp5iwW+WsdsPXl6cbrE/RKziad9zl5P5XksFegdBTyOytjvUz87Yd5ZTalYPIcMfcMsmApMXErsKam+Fdi6BgXxxRbLr2P1NitIt7uCBwYKXsJgn6UfYS2RnLRA8/QM1Ow3lcPn7g0Q3GVSu7MePslkkKWAIQJ+F7ievhL57tQQguqbzCn1QqgO/T4vb8gd+7vkDxW93oiqCFsZfneXvK+iQ8CQz/N4A6RMv+H+4lFAQHXjsuF4pmJilJDbip7OEfoAi5dnflpTcuax/8TjGDQJDFS2A9ugwuTc= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(39860400002)(396003)(136003)(451199015)(36840700001)(46966006)(40470700004)(7696005)(921005)(40480700001)(356005)(336012)(2906002)(186003)(2616005)(1076003)(47076005)(426003)(26005)(7636003)(86362001)(40460700003)(316002)(54906003)(4326008)(110136005)(41300700001)(8676002)(70586007)(70206006)(478600001)(6666004)(36756003)(82740400003)(7416002)(8936002)(5660300002)(36860700001)(83380400001)(82310400005)(4744005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 14:37:56.5776 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4dfc0250-5797-406b-def6-08da9a4c8b12 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000C405.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4467 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Calibrate P2U for endpoint to request UPHY PLL rate change to Gen1 during initialization. Signed-off-by: Vidya Sagar --- drivers/pci/controller/dwc/pcie-tegra194.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 35d9c3ac3028..67dd97f3cd6e 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1078,6 +1078,9 @@ static int tegra_pcie_enable_phy(struct tegra_pcie_dw *pcie) ret = phy_power_on(pcie->phys[i]); if (ret < 0) goto phy_exit; + + if (pcie->of_data->mode == DW_PCIE_EP_TYPE) + phy_calibrate(pcie->phys[i]); } return 0;