From patchwork Mon Sep 26 11:50:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988691 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 E9836C32771 for ; Mon, 26 Sep 2022 13:28:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233752AbiIZN2A (ORCPT ); Mon, 26 Sep 2022 09:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234106AbiIZN1f (ORCPT ); Mon, 26 Sep 2022 09:27:35 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20600.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::600]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E327C1D9829; Mon, 26 Sep 2022 04:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aISENHdsZjpT3wmCQApwiynAuSGzr6eNPYcw0CeQQbrP3ikBHIs6TKFU+i9uAnFzHtUMX4uiUYl9qaKEKrUJhfIbo2E4fbMVr49GQPG4EvEuWcaVbT9LHsagBmO2qzQlriBJm5N52kUkcNZApqOdsJH16cPsIp5I1VR3FL8/yrFGUoLnR/5Y0wtouBR7JA3CgaY5EzMtfbODTjj0ZcD7m1UoY2TTkWTTRCABPXFYLsG2rC32/rlOr6zSpeRs5ht9Vqktjp2F6kGUn2DhwyPoE7NIs8lw2uX5PCf2sZiZtd8gCHi7r+l/5eHaTQnvkYr2nsDkD9Lg+W5mKz6XDl1W3w== 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=N7jyd9c8Z/mWeykzYgXiX6AmqcPg+Jyx6oeJz6RiZOg=; b=Vexp7tb63J9J/A5it8SAp/pD2biT3GE4ZsXbCXZJfFGIrLTH3fyRALVyac3Ep/KeZfFEMoLDY5IXgJxaLif5BoGuE61awqRwM2thA8wJSjfp3EOL+sdnWlPkYMgdjzsq7IIyXumTPfwGlKcrM1WV331z6fabpyWEaFUBpnIxKG6jufoz0YifZI6WMLM9yhmIbl/gnEpjdD24ZwRn6nSOZ3HmbrsOxvsuvf+kbp/JeeYQ9jWIf30wxBPI4udiVueBEEiAioR//J8M6s7nEfivom69xAMAPOjxSdyudYdIqWOfjbDZ9cBgig+p8LnsJrZnEnkdymA0xCv9zGh2R7Pkog== 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=N7jyd9c8Z/mWeykzYgXiX6AmqcPg+Jyx6oeJz6RiZOg=; b=IEWyGMONmwrH5hMxIuBG3B1pq3KIUMlHywJJEOMdHCMW9MZR0MRPjBqEoM5A/7Q9ku6w92MTEW5w0Gs9UAqRk0NiPwfjKai8e8507R5BQX5fMYsSN4XubisZvaChDmCTDTmpNAv/YIobmElJJC2CIPnG60CZzGr9TWnFCTPASPFlm8xZCZYF/Rsr7mWBhFSgIY5HaFP4ZfOwlKWMG0vFrnElq9nbmtA5d3Us9vapToGkY7gMZ9LUgjDUO9tL8QMVoIjIu/MwtLhYo65yiXTqqn2vqs+wgFNFtW35TXFQ6tOoE6FFZtG6bI9JkIYWJygBUq4O0WEo8/uUzM0DbWjm4A== Received: from DM6PR17CA0013.namprd17.prod.outlook.com (2603:10b6:5:1b3::26) by CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Mon, 26 Sep 2022 11:50:59 +0000 Received: from DM6NAM11FT098.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::76) by DM6PR17CA0013.outlook.office365.com (2603:10b6:5:1b3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26 via Frontend Transport; Mon, 26 Sep 2022 11:50:59 +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 DM6NAM11FT098.mail.protection.outlook.com (10.13.173.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:50:59 +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, 26 Sep 2022 04:50:53 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:50:52 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:50:47 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 1/9] PCI: tegra194: Use devm_gpiod_get_optional() to parse "nvidia,refclk-select" Date: Mon, 26 Sep 2022 17:20:30 +0530 Message-ID: <20220926115038.24727-2-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT098:EE_|CY5PR12MB6179:EE_ X-MS-Office365-Filtering-Correlation-Id: fa3c006e-0337-444b-77ac-08da9fb56104 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wjunhXroR4DwHWWWhsPsnvCGPK+uxPJ8/pJT7Yke4+froriSqWGLOi73oBTbWk2BuR01aREgbTEH1LYa4aMyPHQqoHa/XrG6RLfthhCsEdOlRcb2W/XodbzafuaIeVfF1ct0JWfQeMNFA+qh8XeHyZt3a79OPeiwpk9u9Yg8TFTXHS1+5MgHVQUDZgSvyy0+EQrqaSABaA6doqENgt4e309xwWEJ13ZMkH3ExmB3tJYHBS7DcqsiD7w2L557URvxcTxx01i/YZRvkNvNdW/yKGpQntqc0nMtgGjS0OBn8L5YJQvfikAxJE/8QNo4536DqYHZ2tFtRgjGHdL6IpAuK6Pfz6d+ezhib2I3FeU9B1sQtoBd2dF9zIv3TnSNBUlZZ5P412xRyC9lTry9r8GRiCGf3qNCTXIOcReyvxBy9qXrwAxFIXpmz7LON5+NddUbKp+QKLIampK6kSYfs221K8iM4mY+uJCUN20Wu1YQBZIBu4oSN8JUQJRcwieQIaTaC+lLCViRJCkech3PuDS0keETMoBDLiiKz51w8WQAylD/10kaZGuL/kmI74ZSvpynhMwu445ou5SBA8sTL33/P28hB4iz3ccijH2EilQmGXOQorZMibqLYB2FHsXM4RQ0fUrDIXvTQgbLPwmWVzVx2G5veJMuoeStjgnhUnE4Dpbt5hsUniYF1fm1NxTHex/mNtajc4bAR2FgdZUcfFdsHQ4hFdcGO4ydBI+QiHN2z1EL0mnqKBC24jfPGcq8eufBln/SG64OiH9ObwhtzxN5AWdIvJhIAvZzqN5a7bZ14FQ= 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)(136003)(39860400002)(346002)(451199015)(46966006)(36840700001)(40470700004)(70586007)(7416002)(70206006)(4744005)(82740400003)(8936002)(5660300002)(40460700003)(36756003)(7636003)(86362001)(2906002)(921005)(356005)(26005)(1076003)(2616005)(7696005)(186003)(6666004)(336012)(83380400001)(41300700001)(478600001)(40480700001)(426003)(82310400005)(8676002)(4326008)(316002)(36860700001)(110136005)(54906003)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:50:59.0520 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa3c006e-0337-444b-77ac-08da9fb56104 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: DM6NAM11FT098.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6179 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 --- V2: * None 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 2600304522eb..941fdb23e02f 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 26 11:50:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988698 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 A466CC6FA86 for ; Mon, 26 Sep 2022 13:30:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234883AbiIZNao (ORCPT ); Mon, 26 Sep 2022 09:30:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234746AbiIZNaT (ORCPT ); Mon, 26 Sep 2022 09:30:19 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2072.outbound.protection.outlook.com [40.107.102.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D4121DB55F; Mon, 26 Sep 2022 04:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QTvlX1BhhOixaKIXIJ4SSNUuQbecXLIxD6NYgjKmz4kmdwdgNxcFabfOqFHi8cwXUsF61K9uou+ZOkxnNwLFZCBp4t11oNMCK4+HWLHdwTFpTfARq67cKQNMjeQoIoBLC51HPNXezj8mfTK9v+nBAf7yezH6Drml+CEY54TFbdA+GD57blkF6qvYyj0zsalb3cHe6SI2+QWQbMEB4XhUuneZFEing8OGsDAxFJchKvGZQtZq8xwUURA7+yN3IGe4Pc5AX8DzZtAcyreK6HSxw5AMIX2bOBBHhf1E7yNeIc+NYzmNfbs8FySBxQyjys+BWVWt6luT8fFj9OqUP7Zz7Q== 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=DjnIl4xY2Djj39g5ptnOccC7Avtx/AF6DIaqhQtI+pA=; b=Hj6NdL5aR6NcThEGrnnvZPuxmjbWvFHvTbxVFoTCdsbOs4WdPCC8aBmexTDtlZB6M6IDBwnszerxsxlUFKJr2xrdkQfVgm1MsmSwkfq3/UagTWWthnCmmADl7j0Kf2WZ5r3ZK7Lh8ZDmdhJlLv/IKx5SW9V08s/Nlji3uFNomZf3bGSbTaSx4UV8kyhU7063JBUpQDxE19fwv2Mmr6rLzPEHSMSEVZ5dDwW/vNCJOYufUQ9jifEBIPLYzLZL1w62DPXQnaKk25+3J2nZsSg8wF2PJQUYM8jE0g/CnREuYnBGeNM+6Bd6LCWqJoPqIiW3ECWtx4pmkomq5A+FLiGmfQ== 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=DjnIl4xY2Djj39g5ptnOccC7Avtx/AF6DIaqhQtI+pA=; b=Tetxw8JzfXUG4OUeYhgts5euOGlDDO0sZg5ysIhlo/64Nz35QtHBs8V223P0TLKAXObbf8k9+snRtAxCs06894vQV9rHAPJ6GwCHRClLnvs69gbhzHM5tW1OfHr7zkNVVIGPMjiJYbHMVtZwjBLMSHfPO9D4YqBKRj0JF7dbMzm/vovgBoDkXllqePzLpZTKtwgjr8l0ng0VsEb/FEGc3FBDMUHCg1XaEmIdrkdkYVkA0NSEHhnwM+hd8oqIm1pd8TaZ5D9oNtLUbFHwCvF1aysyO7OSTyCLEttHWQGkqcgvUqLUvChe5AG0aFL9P9jcCbOIb9cPsk5PUgSJs0OYYw== Received: from DS7PR03CA0004.namprd03.prod.outlook.com (2603:10b6:5:3b8::9) by BY5PR12MB4259.namprd12.prod.outlook.com (2603:10b6:a03:202::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 11:51:05 +0000 Received: from DM6NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::23) by DS7PR03CA0004.outlook.office365.com (2603:10b6:5:3b8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Mon, 26 Sep 2022 11:51:05 +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 DM6NAM11FT082.mail.protection.outlook.com (10.13.173.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:51:05 +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, 26 Sep 2022 04:50:59 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:50:59 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:50:54 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 2/9] PCI: tegra194: Drive CLKREQ signal low explicitly Date: Mon, 26 Sep 2022 17:20:31 +0530 Message-ID: <20220926115038.24727-3-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT082:EE_|BY5PR12MB4259:EE_ X-MS-Office365-Filtering-Correlation-Id: 24c7c34b-8d9e-412e-920f-08da9fb564ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7OwS9TgB8y5vPecBx+JFJIe0ID2ABa968ZGuDqJABe5wCa1HTv1ZVaVhqiZl75AC0F5KdWcnPK6NVaFwmKF7XjkIN4avGgJQPh1o3dE424nb00PIP6jLH4OdoRa5yrykQozjgpAiWnGHTqe6kpAnufZIym8xFMpzXikyIUYEfkGn0B4QbOPyAyY6k3Q71R8O4w5wfncLqflBV3d8AIoZt/X3uUryzdwA+hAPAoRh9u6Sbg1SP2je7gqvKuS3sajuzw69jAVZAVE2HOiIyBTYXqAzo5KFXUdv9gh99mtmdO57KKQuZsY2gGC0DibwSOcpJc6diFPd4W+WWfbBjT9yUXVOtrFengW3F0LB8zxOaAT1cmdlB/gXmeO5fe9HFED5NWBbJuXcLUVjh0LUbprUxTCn+f62siLVl7nxpaK+4MbErhEWnL++7Ryc6DcwQb+D/XNUmkCqpCGZ/xRuEeipJkAp4/xXqbzgv7MnhoXwIbqSRaxKaylOyoiEmf3Pdn/zC4T+i7KC7e0QWP05CouifdCV/pCNkBI7yaCq/pcEyaNLU5I4CELG1/oO4w488c9bSHK0YoAhhTeThUpCfQ0gnlHU+DAVMsGiQhnG2rW5CF7C810SpLnUgWjX86C21GAB2DBO/TbYSQauJoKrwqKqEeG2R5uVeC95OBzNmsQla5vVD+EWTl2psnSg67oU6hQDnI5Af+qQiig/cogY6j/Z9b4B5VkRIwX9E8jDHjqgmTtXB947oA5OXrrj8k14um6sKP3VAfqTDk7F//afPnbuZdkmxjHSLSKQbOPNkNGoqQ4= 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)(39860400002)(136003)(346002)(376002)(451199015)(46966006)(36840700001)(40470700004)(7416002)(26005)(5660300002)(36756003)(2616005)(2906002)(70206006)(70586007)(4326008)(8676002)(8936002)(7696005)(6666004)(41300700001)(40480700001)(86362001)(82740400003)(36860700001)(426003)(47076005)(1076003)(186003)(336012)(7636003)(40460700003)(82310400005)(356005)(921005)(54906003)(110136005)(316002)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:51:05.1646 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24c7c34b-8d9e-412e-920f-08da9fb564ab 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: DM6NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4259 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 --- V2: * None 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 941fdb23e02f..7721f920dd74 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 26 11:50:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988706 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 90DE7C07E9D for ; Mon, 26 Sep 2022 13:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233769AbiIZNhG (ORCPT ); Mon, 26 Sep 2022 09:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235483AbiIZNgh (ORCPT ); Mon, 26 Sep 2022 09:36:37 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2062a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1310CEA206; Mon, 26 Sep 2022 04:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BEhoKBfZzF0XdcD7zWDmfVLehcroY3vPqdJPyj7kKPN9CMswIKD94LhW2UJGyzAAc8mqmOrLomrzVoKSBhSyFMlahLThnlzAU7E4cwHC9SeMTIqMp0dBVaaRqhQnd4R3MvwtbdUSmjV8lL2a2KYTQtIKDXvG4JSQFZM3eNV2dT7fQIr5iSw6MQolIC4Mt6uY3YlKCQSVQkAD7/3pgIM5AEZIeVxbNFkkFBhmOC3/epwLNmjpU66OO4IMuLCmjSD80oRwepjY0OyyLiMBq4vRBUj+ZjEK/DxAvz7noVHsdn0pPacStVsovnAwNXZz/GEJNo5R7jvqW+dglrWOlQwjUw== 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=Fvh9ki/u0vykNOoBH3Hl74sNJuHZi2qCwUtJP5ysjj0=; b=K6mwaek6kNm7KtYb9FgX3UQr906/y+ZnNN3aoYKzHEjjOrxqcpfSjkuCxyyQG55oT+eDeuzaYU+AhwYlkWHhk+3USLuAyyDQKr1MTCflccnH6bR6hIO1ZvvEFQXsD8Ip6nKBsN4UrqcIxNrMSqg2BxOAwZ6gDXicOi8D57M4J/6mwB0Dni3GRWH4GJfOQ5e9dyT4uvEXlkWYvKfj1krPWa5Rm8cAlBDzo+rQPH5FeGecHb1eXPnx3RJyeiHVOLAIrheW/Em8siiS76sqe9dtKGxwhWbAEEsm/tPBYhdB4cL4pfudFV7wQhQN/2twuTz0KayUVW4eUoXigAkL1WnmCw== 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=Fvh9ki/u0vykNOoBH3Hl74sNJuHZi2qCwUtJP5ysjj0=; b=D7VQJEUAXj1kTnVuPvYMrTbqgQ2A1+l4hDoUr04Rqh24TYf0Uu6yJkHn3TrT6aqDPKeqLdCYFVeYtRYbx0Vd9cbQR09SwBHm3xiiZzFa8QHypVlWNoHPI7T8TM1PLMwW8ZDU9zCzIq9/LVTB9h8qEsmTyD+MqajkCeZEB9ZWaiENtoQDeKdkfjP15DR8tSiq3q86Ix9bNFrElj0HKTwyQgec216xXP1JddR9oV7BhT9mBe6cqPZ5CBk2yg8ieQ6DS/a6Kwpr8Cr+RFYrtXOMIYrNAD9dkDerRmL/m5m5WYdULS5OWHutyHe8WwGw9VwylB10fk2+DoRvlKcvcW3whg== Received: from DM6PR06CA0032.namprd06.prod.outlook.com (2603:10b6:5:120::45) by SJ1PR12MB6051.namprd12.prod.outlook.com (2603:10b6:a03:48a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 11:51:15 +0000 Received: from DM6NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:5:120:cafe::9a) by DM6PR06CA0032.outlook.office365.com (2603:10b6:5:120::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Mon, 26 Sep 2022 11:51:14 +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 DM6NAM11FT017.mail.protection.outlook.com (10.13.172.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:51:14 +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, 26 Sep 2022 04:51:06 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:51:05 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:51:00 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 3/9] PCI: tegra194: Fix polling delay for L2 state Date: Mon, 26 Sep 2022 17:20:32 +0530 Message-ID: <20220926115038.24727-4-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT017:EE_|SJ1PR12MB6051:EE_ X-MS-Office365-Filtering-Correlation-Id: e5c4d0a9-b7fa-4fd6-fd06-08da9fb56a52 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gIWvtGvubWUtM3Kb0Gny7FlFLUdsI3AVbdMAunSvR/2h9zJjFkzoDZToQa9+/QHotrfVRGT8ZUHHWKRa9yv4iW7zLjoe301Li/GKTbdFVzgAGw/0nK0XJMkFfmMbNu8f65SaOkB2/xH+jtuB+sq+MrdlnWN1Pq9hacwobxiVbYkmYVOsjV395YGzylgkfabmSEFWhFbZQo3bAa09pwhYH6WNQvSSmTjYOLJduUSBBS1X0yXOvOdQ+uTPGFpW3MZrGQy7cIUfj6+qSZa65dbp+ERHigBKAW4CdPUmiOleMTjS8+sK3MOuBWL7wVZiFrd0gBUKsWsDqJFs9vGCkDR1xSMLVv1rhA6Prz6V0p3Qomd6SWUaJoIBK67TSDOk7SD70gnSzmVjRPie7qzkZE8Ew3OTEZFKHHWt6SDisXX4YqAnrcPR8dPgcV0Mg4Wc19CjnMvoE+G0nnqG7RmUBIc54zXwPfJFh6DdClrqo1rcIi4r7dZSwbyeyrIUVhTWQK2Sg3Fb5NQ++iaD9VSpg8iA+vL57TCtzamcedrg1wRCsvzlzLMkEV9AD36URyiW559BrkYgLhHeLKl6/0hbV+XcfZ5GkPWdtuajZlhRLKBrMc7uy/sjTlcNfC1jh8eJMI01OW+D5JyqsemchuiUu5lp8kraT12FQQIuGSbWbTP2itx3kaafpmhaxcv3lnit7MSemnoXyywZ3l/C542KvzyOgpkpEhq5gcFHfqp2SyLbLqVMX+c1Q6efciCOgu20EQFc7QlNU1TD8rI4UlfUJ8IwPz7lX5/O7dQwjPAHRHqAedE= 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)(346002)(39860400002)(396003)(136003)(376002)(451199015)(36840700001)(40470700004)(46966006)(40480700001)(110136005)(54906003)(70586007)(86362001)(478600001)(316002)(70206006)(8676002)(4326008)(6666004)(82740400003)(36860700001)(40460700003)(41300700001)(83380400001)(26005)(7416002)(5660300002)(8936002)(7696005)(7636003)(2906002)(921005)(356005)(426003)(336012)(47076005)(82310400005)(1076003)(36756003)(186003)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:51:14.6660 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5c4d0a9-b7fa-4fd6-fd06-08da9fb56a52 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: DM6NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6051 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 --- V2: * None 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 7721f920dd74..7d6e54a12eff 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 26 11:50:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988693 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 B31F3C6FA83 for ; Mon, 26 Sep 2022 13:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233549AbiIZN2V (ORCPT ); Mon, 26 Sep 2022 09:28:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233513AbiIZN1s (ORCPT ); Mon, 26 Sep 2022 09:27:48 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2063.outbound.protection.outlook.com [40.107.92.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815157677F; Mon, 26 Sep 2022 04:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EWVyDxBrAfJ0H7Nr9oxrr896BzfjYRWyI5sRIeqxrkWpy6u0nw0ibwmcJQwpr5VaabR+wsMUq5qyRYsiGY6ojsYpDJhJWScn1b+OfXd8Ce+8TYcRiZE7kLfuvPHHd8pN2HA7G7f8JjsB0ICLPrjCAHkZBCyDGrfycXG+8uc2ZYOAtZBQFExwfn6eB3OBv2TbJK7ughQKRcSqN4Vgaxo7nlbncRsh9/ny/8QqRZm4AgiAR76kTEQYbEJ1qOO9O/0C2R0vfQZmKti4woj90igpJlgVYPxvOXOHdlYoQirCSQb6FyjfKCxVocqQN3DAfCUYYXy5Ky1XaYbh8P7b4dOIxA== 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=OS4tAl4e4GdO0ByBukVOwers8V1PitXMTTFaTisp6rg=; b=HLss4Nl+9lE/+fnk4nE7S1rFzLmH8GjwF2h/JB9CjNhL11RCYc6bWjVnkni7xXibz9gfAJoDXmrRcSdF3CVauXY+AUP6LxqvoAFVVXuIaJ+Ub0eMEAMuvc0zCcLwIr9IpHvEF1je14ZQqQcMmP+YKF0c8ACK+gXxp9ECju/8ZXsYt0h+D8sxvPBCDQymtdIaKHI77/ONXG6UE22VHE2nIEt62jTnoJ++wwbiEK+jaS4qW7yT83V9e3v9Zy/LbA8tmXU7yQRG+MXDg2kldKFN9FG4ainR2HmnU8RfjRDn8KN3w3JsmYCDXniyIb/Pg1psmFyrh3nNiWWHR9Sz0/h/mQ== 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=OS4tAl4e4GdO0ByBukVOwers8V1PitXMTTFaTisp6rg=; b=gcs0gYhnLoOHf/H41PUuHaoD2cG/iDhp9M297Xrla0oJTcvuGyue1ODcYtOZ8L8k+GsSDjOUhl99i1AwpF+Jb22cbExRRJ11oNVnQ54lYOesiz52D7i2ptTXmW/Vg3sAyqWzItYMR+NyjqBni4W+AJVrpEGT15q5AXg3Y3Qy5idFqIs3OBrhjznp+081/Meh4geYM00OA3ryOGA/Jev5pY9wbRK0UT6f2eIi0HFg5MHxO5X/Lob0dA//oTGEmFaqxcFjiWqbgTLZpWeY+bFa+aMj/dcmA9wJsKrukEyy4TE6hdUZjTKmsYpSuIacH6nEA6Cyl6xUv1/oyRwiUor1dw== Received: from DS7PR03CA0334.namprd03.prod.outlook.com (2603:10b6:8:55::11) by CH2PR12MB4167.namprd12.prod.outlook.com (2603:10b6:610:7a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Mon, 26 Sep 2022 11:51:22 +0000 Received: from DM6NAM11FT070.eop-nam11.prod.protection.outlook.com (2603:10b6:8:55:cafe::b1) by DS7PR03CA0334.outlook.office365.com (2603:10b6:8:55::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26 via Frontend Transport; Mon, 26 Sep 2022 11:51:22 +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 DM6NAM11FT070.mail.protection.outlook.com (10.13.173.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:51:22 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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, 26 Sep 2022 04:51:13 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:51:12 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:51:07 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 4/9] PCI: tegra194: Handle errors in BPMP response Date: Mon, 26 Sep 2022 17:20:33 +0530 Message-ID: <20220926115038.24727-5-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT070:EE_|CH2PR12MB4167:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f869d32-93bf-4c61-32e6-08da9fb56f18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wx+UI7xsDOsCC5XPmjfaZJ+36U+afKuSDHIS4hUaFf9UxPMjUcUTPDT/QaZrSKU7xm7WD5pqDsnvdzqMBQ+URoKip/RCf5R+TRyHvjW2vIy3wyU9oeWFcOmT/l2k+Q9feIAypezyyb960KsF8tozPMe3xb2ax8PHQsDNLX0PTbzu90vbUoShja87rF/wNka3Ne6NLt7XiUHH8XzRrM2O2fZ3+OR5mEg3aL3++TaeJYOdZClrgT8XmSRdu+t2BSMh18hMXIBNQdR0VCAXPXMvvtFKGqiTfvw4oRLP9Rk5lA5FK91x0sBszdZNK5nKxVBvCLkrVgVZ2f3gqMfEa9462lhyUqmdI+hMZfihdUExys+0pmxyTXU8OjQ6mjC2dr4hsTuUXVYr9Gl1S20AOkFOSjpnaJ48OpGvZeqxmSujPkIfDkCN3X6f/7GL7NcOWPxTaksIO8moCwwnw2ntMnxG779d0z3b8uIIkyhreATW62VPTW2dpeo6VeayTDkl6hL3LVhzo3fIkafclgebe89VdanG74bsaruRCNkD+a2JCNoKpVgvOPXGOUrBeYhBOEvkaN4NbetsPqaHKvJ9ibRqioFQBjGqTnMM2YkvDeBRBdhF1r120tli7qdb+l9pfWpegccL0zxK0AN9rV0yIC278rKFD9LUsYLGG0ymNG9GAX8mXlgRcQiOFucddhbNTMb6WJurvvPHIJhomkfJEcyU9ffy2pFCvnC8PtMcK/U7BMgPWINdtGnFQiYGctzsuwcE1K7P/COc32KIl4ahiY73XIu3N/30hQe85M5b1Ii2xoY= 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)(396003)(376002)(346002)(136003)(451199015)(46966006)(40470700004)(36840700001)(316002)(5660300002)(26005)(70206006)(70586007)(478600001)(8676002)(7696005)(8936002)(6666004)(41300700001)(7416002)(7636003)(921005)(2616005)(47076005)(83380400001)(356005)(82310400005)(2906002)(186003)(1076003)(336012)(54906003)(110136005)(36860700001)(426003)(4326008)(40460700003)(86362001)(36756003)(40480700001)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:51:22.6381 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f869d32-93bf-4c61-32e6-08da9fb56f18 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: DM6NAM11FT070.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4167 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 --- V2: * None 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 7d6e54a12eff..0268eacdae48 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 26 11:50:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988695 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 A47FBC6FA86 for ; Mon, 26 Sep 2022 13:29:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233482AbiIZN3A (ORCPT ); Mon, 26 Sep 2022 09:29:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234733AbiIZN20 (ORCPT ); Mon, 26 Sep 2022 09:28:26 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::60c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0869B866C; Mon, 26 Sep 2022 04:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SepCcrK9ZzflApzYs2sR30NyGYnf+z28wuXlwiKV/5XR+R7C59dVJanTMhhqAapBU3DwkPsxG1BugjL90yaYN0WBE7ARMkaJVGVlEoEiVQWpUD8xJ58195AFtKDNPPmUIN/Z0hy7szORNk8/htPrw/4lAkjdqHVXG+hO4MffiOpeBSIW/fF3keR8L+0EGoqhDvgH7C3Ts6Est2Sskw9h5ZfYYC2fAPVz+xHaq+9vjS2YndyWJXxgJGL00IFN32cLDKEFKyCds9A2hnLNIf/qu+JFnFmNs7JbRfp5jIbAjR2jcVZ/PJzBaMgg+2EtDW2WotcX6ffhuNcuMofdPEqhRg== 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=KAwdRdVc8Iglp6vRj+XW7KecFX9JibROcgI7a/cc8i4=; b=iRwTf0bF7QkHEVj45mK5YyNO4ju4/FPi9zIChhTHb/+yB211IwOOZ8BeQEV5ryJN1PdZ8bebOPM8U/e2dbhALwWLJOaooAb2u5B42+pD4tmL10QAo+WCvMgWkeRBBHLp2a/CLvhYrFv6Ai6jGKpeH5pjUplrwJprQCfJCM/xTaUqi8iJs3VblYTJ91xT10piXvEDVRmPxWLlofMLLUuyrF08L0ccBPIBg5ne13Kb2ZOvzR8bQBhPic4K8gOpL6ND4O79SvdRjjz9rptFFQc84h1grNar+xs9Axk8zHqLqqBNsM3mm2y2VuKVJqj43uVQaA4P1ITIcQuuLClJVFKfwQ== 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=KAwdRdVc8Iglp6vRj+XW7KecFX9JibROcgI7a/cc8i4=; b=texEm9ofpLWYruXTGwyHrQrACFkIi9M0Alx/aIJDHtJpxi9DWnMGLPEfVfb51tVHqjadqmU/0lP1hpEU8KVSlBqRHXLaoajINat2Ts90CjK4hoAgc+rgY/J9q0F6O/zMCGnLup9/Rqd4y2hO5MSqKc+1xXY5MxniXmM5u4YbR9+brEcdZMmDcPuvIJL1O5KeczEwCbVXSLtG06D8HXo+q0q+XY520HkCqYuxLzN375A01uljyZY5vrQa2YfW0Q8MZ8iJCX14tetpvHccczuhu10TICAJDAIVlhoZGJdgWD8mVWo7dg7RTWztDKMO0L6epFqCiHDkhxji4HV5JY++dQ== Received: from DM6PR11CA0014.namprd11.prod.outlook.com (2603:10b6:5:190::27) by MW4PR12MB6779.namprd12.prod.outlook.com (2603:10b6:303:20f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 11:51:30 +0000 Received: from DM6NAM11FT110.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::3a) by DM6PR11CA0014.outlook.office365.com (2603:10b6:5:190::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26 via Frontend Transport; Mon, 26 Sep 2022 11:51:30 +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 DM6NAM11FT110.mail.protection.outlook.com (10.13.173.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:51:30 +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, 26 Sep 2022 04:51:19 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:51:18 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:51:14 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 5/9] PCI: tegra194: Apply pinctrl settings for both PCIe RP and EP Date: Mon, 26 Sep 2022 17:20:34 +0530 Message-ID: <20220926115038.24727-6-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT110:EE_|MW4PR12MB6779:EE_ X-MS-Office365-Filtering-Correlation-Id: bf0a5653-adb1-40e8-8967-08da9fb5739d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GBTPLqfDeaf32tNXLlYE4H1ieTkHZYqXEugctVUzJ6oMNDQ7Rf9BZhodUM72VSPR9Lh3SzV1SIyd6lQLnKtcYXLOC7mYKgQyTOEy2V9y/KdyE/4r02LN78wyOWB8LTxjTy9umQwY+mb2rMRQkP/0S8CQlaB/5cLHOqVv3F1fdbauN04osuCM9n+b0YgGgb1akum7rSL7TlXZ1q2F9bpt6bBex6M3IGmWZ83WflaCu3k7W7xNZda2D1BIyOYTC7/DmGGpdepkQ/sW5JvzpehWMAE/6iS7vs7mmluSJ9AoFZJnz/9VMPOg14u0VOAMIhKRdgobeVYkm0TEBLc5mBL9uJ65tk4q2M7x6JxufJ+PMQNmn3YPCQ9FoH7wU5pK3AgspzPFRDULODqnwE//JyCagn3Tbe/7WOIido31b4wLMCfph7eTdXzI9CcHAMjrq7U5FjHON/CWD2nB6uknE/+WdpigsQCcJnp2zDJuHwMlEj2Lcjc5A88r2GYnPXqjMz2KPUajFtN3FAm/1/RAIZ/jC3E/KuSL4rWDn3/DDxXMw+F43D0XeWFgz27LHSqInPiRloNn0Xox+BUAumofVserRKI/tcoVoGTlgwIC9S6dH3JsBt/sqMUXTG1mrlOH4RS/dpd7CUsJuCK4JRu4MhKrdTHf99wcTVADrIJnuxVtTfzSxr/mb8yngDlp+wYzWYK2109O7Thfk6J2iZQ3Yui+7IdZbfKvCiP6iiGLJsfz6KPG9sEAIJSysyEBQErE0/3RvLzhWKWo1o9fY9eNUAh+iO3g3Ct/p9maZfXlz4Rrz5U= 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)(346002)(376002)(39860400002)(136003)(396003)(451199015)(36840700001)(46966006)(40470700004)(36756003)(82310400005)(40480700001)(47076005)(6666004)(336012)(83380400001)(426003)(41300700001)(7696005)(26005)(186003)(356005)(8936002)(921005)(5660300002)(2906002)(7416002)(86362001)(40460700003)(110136005)(54906003)(70206006)(316002)(8676002)(36860700001)(7636003)(1076003)(2616005)(478600001)(70586007)(82740400003)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:51:30.2385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf0a5653-adb1-40e8-8967-08da9fb5739d 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: DM6NAM11FT110.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6779 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 --- V2: * None 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 0268eacdae48..4ba2a17d92d2 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); @@ -2120,6 +2114,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 26 11:50:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988699 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 199F8C07E9D for ; Mon, 26 Sep 2022 13:31:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235184AbiIZNbk (ORCPT ); Mon, 26 Sep 2022 09:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235188AbiIZNbH (ORCPT ); Mon, 26 Sep 2022 09:31:07 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20600.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::600]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9CCB1A399; Mon, 26 Sep 2022 04:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mluapaKuMQtm5BaYpK5Nq/sEL8wvfxsG4OIAY4xXWpgcuZ+9xBL7Dj7uFOs/9E2eIsfU/zCERjyawne8jCxzQjI8UCw5OI9AjxEs8MejOtlNq4JYNTKc5GpzqoQlyIU9YJnmLU2VhyQSX3W68Ym7Qf91F6l1en/j+UFJgJiX/7V9n4uSIV4+ZWMHpVcgNdmZucohEIZd91bPnl3I7Fz6K9Qm4ZKtD9ue9aJK7bolF6f6jrPqw1NV1VNOu+ngSuPjC25UW1uks482sI9e/RZuHiV+1T1bYSIpqsK1S5uBwTn8UOmu9plHtjzKz9jIWIHpvZhEpg2CO7B2K8dwPz9Xyg== 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=+RfYSIbmZOKJMK8FY5G2n0OJBNCOcjzm8RqyqgsTbrU=; b=lTEv0iI6+lcLruYfm0b8HVq7yZZWQZ5ytmHinycydVRYV1i7u3Y/UFnROc+5+d5KotfIYDOBRl5PdkRLBkAfBqGbr4i7Th3vlokWV38qiwqkE55MS1X20ZjIUWqkUob8lXurfWQ6nUfTicCDku7djiHBFFe5Wyl8/YlTzx7e0VFtWJhmV7gBXmayY7HHq2fAM2TGgZ//EvBNkgPbCU2hDU8hcJ72WI9cnKNmIrnTmJBh+kNwaph1jAd6UOf+NiPLHBFni/c0zM9DpAg1btQbx+Bxew7dU4lhgtHt2du2xPDikm5d7d6xzwlCr80r2kBt86lqVNueMiBcbSUcaL9Olg== 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=+RfYSIbmZOKJMK8FY5G2n0OJBNCOcjzm8RqyqgsTbrU=; b=VsFktSF/cW1JhgWN4drVzze1B8jgXESatEMHvmFTK6QfxAxdgezWtX9xcLgB5hMIrQ5ueRq+r8SC3tq0wLwaqeKrO3i3D0o74Vdju8qlpmYY+6Wyvp53VGDuI+ywCzad6InRFwefwkrLfjP2FabKyKkj80jzbRf6c7yDjJIMZFCh4xxqE+CK/c9+q4zfDa4BvJAd3vTTvxj6Gda5leeG50SDiwy4KEULI/U4ig2vGoXLBYbErwdNG5D34Uc274MlAudzW84itsfEXKR0YGyRl8MY7y2sW0HIzIjL9mWtjQfbsNEsrgWGVX6hWsSJ4yw3FrvDlBZs9+755qxGX/vnvA== Received: from DS7PR03CA0022.namprd03.prod.outlook.com (2603:10b6:5:3b8::27) by IA0PR12MB7604.namprd12.prod.outlook.com (2603:10b6:208:438::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 11:51:34 +0000 Received: from DM6NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::7a) by DS7PR03CA0022.outlook.office365.com (2603:10b6:5:3b8::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Mon, 26 Sep 2022 11:51:34 +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 DM6NAM11FT082.mail.protection.outlook.com (10.13.173.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:51:34 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:51:25 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 26 Sep 2022 04:51:25 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:51:20 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 6/9] PCI: tegra194: Refactor LTSSM state polling on surprise down Date: Mon, 26 Sep 2022 17:20:35 +0530 Message-ID: <20220926115038.24727-7-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT082:EE_|IA0PR12MB7604:EE_ X-MS-Office365-Filtering-Correlation-Id: d7289470-1b37-4715-122b-08da9fb57630 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fnJtJgwTZu9fNq5EDb8y8BdJpjLdKeOJdUHpBK73fzyKoHfxM6nvLtWG++OjoudEfoph9UyU/dHuvrUlm8IPByzfpHsL+d/0ewH6bedLq3TiyDgV2OGY6Bow8cEAI1c8TiiqvIuKIeyOKB4x9XOzB7LIpoo1HsNo6beIW2uH2IcuHjqugpA7HrrD2aWn5Gy0LG8B1oLAzWRWws4tnragxcxNZ4DYJ87vQxdF7XOn88QC/Wre/nGJGynu8j3O/zaUevsTTHUONC7LUP8pwQ4l3FTZWzgY3O4r1i0FTw5C98jGUbLzmd9jaRuxob+A1PFmzZwpXgyQXG9i4W2qK8i1giKMbjwIAiBEp521lnLlg6lGWmorH7z8u0MuO0MgxcpKD12PxllDs2JWuMimFI0l5xGVbhd1n9MlrWppxX5+2scqdiFMeTRa8l2dwkhujGcYcRGuxFzaKEv3T6rVMPVlX4ZDxQlhBljHEK8Z9D/3UcUgdIUnza/AM/+oRKrgRaOa6FyNBKAs3KJAFNWfO9Vn7do5n3/FYgKxvqcQIXBZrj0TpCVbDYOajWlOt/EMfXtXgYqr3mdaTvzy08KLFw97Uc9C+zjAbuFzjRcJNHemGOjr7sAtWllGDvLfGNL1FidziShQE50Nx3TSkiXnehRtpTm44XQVpm2efNhojGKmzaAD0b4dukLPXIKG5t2k+p3F390z8XAZAKryR/T8bwIG5vmuI9KQ9X9JkUYxESqSSiO9DiI81diLvlXRjm7Xcdi0KaNaIOTWMdC5HiCXCtRAq1lRX7YvJ4GPKVVttzLZG9g= 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)(136003)(376002)(396003)(346002)(451199015)(40470700004)(36840700001)(46966006)(7636003)(921005)(82740400003)(5660300002)(7416002)(26005)(36860700001)(336012)(36756003)(2616005)(86362001)(1076003)(186003)(54906003)(70206006)(70586007)(426003)(47076005)(40480700001)(110136005)(316002)(6666004)(356005)(7696005)(82310400005)(8936002)(83380400001)(41300700001)(478600001)(4326008)(2906002)(8676002)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:51:34.5542 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7289470-1b37-4715-122b-08da9fb57630 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: DM6NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7604 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 --- V2: * None 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 4ba2a17d92d2..702c55deb747 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 26 11:50:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988694 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 0EB21C32771 for ; Mon, 26 Sep 2022 13:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234190AbiIZN26 (ORCPT ); Mon, 26 Sep 2022 09:28:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234423AbiIZN2G (ORCPT ); Mon, 26 Sep 2022 09:28:06 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15D5D1D982C; Mon, 26 Sep 2022 04:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aQQzvr2XgLP2z8kwPFGGPQu994xnpw7dthUIn/EzT16pjjtha9pf6jRbR4e0OFph5ILoxN8Tfmb3VgXqeiUeh7wIq2oGnGDhuYL+yQmpePBHCVsk3uCz2DV8N9Sr8SKmIDx0o8rJYRJDaeacUDJfYCufX0ys89WCu177v6NQzwQvMLGvr0POw+3Jmgx3+r8MdoAHXMTC21zfvIYBITREHoaJJPh24WqaDcDZGSPvFEP5SOS6Sye0nmFdvTH6BFQb/0rmjMI/ojhsGK3Soh3PHrGx6Nit+SLy8ChHJNZV6+IofbBxEvLFQF/TLHBJJFv38gb7miTrXKd21a8j3Ns77Q== 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=y+FKelymuYp/gnfAEznaV4rnLYFrV4/9oEDPJXygwNY=; b=Dqf3jd19VP5f4upu5Y7Wach9sFYF856pSWWOHk9P/aelHhhbaWKqz3dejcX+1fl+4vQpRbvzG7hS3iqvoiCegjzrJqDpcA/0yXSBPvZH8lY/VqqCW4PyWSWjZ099mZhWSHU9M7Lnf1XuUhMz0H8gAj0PvsCNvw9p7VylDdZtvRqY8p8xT+bcAX4O3N1VU73rnvVJfE4H3TWdTVCZ90Qep2eGeL421tvLURYpiBrNzdpfbFCZx6oy7vo0UAaTBJ4t4VWSfPqF95/23/K7npWaa6lqKXiWkMGRP6FtYdEKalI1WgilJhDsPGs2BYDsyFTljW/ea9EvyFpBWMqyyHPViQ== 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=y+FKelymuYp/gnfAEznaV4rnLYFrV4/9oEDPJXygwNY=; b=ZxD5UQIa+kSAiF8GJ2atECW+rCjoCtcTd3Ucwwt7/e0JVv1YGwfQdL68jUNRxKYqCJ3agpBnOpFm5cKqeByPLgVK797S7nWOimL+/IsgmS+yKLSTZRoOB2KYyrS9oYPXm7bS6jiGum8wxjmyiLiWvep3VDhP4y5Cv+IZEIugHP7yA73ARhA18cwiwPwA3qUE0dGAU76Fyci5AVnq95aQooicELPNwFJnqzULwR4wA8aixPqNYfHIOmVTTyen10dbhBMit7eTY3cAYFX8hSLzwja7hmcQvTFYQPDJKVKpmENH0xaa7auvMQ+TjqiZODC17TWkeXySmbd2MLwqLJiANg== Received: from DM6PR03CA0048.namprd03.prod.outlook.com (2603:10b6:5:100::25) by PH7PR12MB5902.namprd12.prod.outlook.com (2603:10b6:510:1d6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 11:51:41 +0000 Received: from DM6NAM11FT096.eop-nam11.prod.protection.outlook.com (2603:10b6:5:100:cafe::6a) by DM6PR03CA0048.outlook.office365.com (2603:10b6:5:100::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Mon, 26 Sep 2022 11:51:40 +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 DM6NAM11FT096.mail.protection.outlook.com (10.13.173.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:51:40 +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, 26 Sep 2022 04:51:32 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:51:31 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:51:27 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 7/9] PCI: tegra194: Disable direct speed change for EP Date: Mon, 26 Sep 2022 17:20:36 +0530 Message-ID: <20220926115038.24727-8-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT096:EE_|PH7PR12MB5902:EE_ X-MS-Office365-Filtering-Correlation-Id: b6914b81-ed7d-431b-29cc-08da9fb579da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jzqA05hbPCLOXdevA28bdLUWb8KV2N8JWoFnf7ePdBcNYIXMirYr3gUvLptczT0KG5JZb/ng+rbE4HadK/6IYpRHYvW9NSQom06besZZxjSWx1s4jqTS2AHpw6L+E9M6Bd08/iEUPuaai8eV5utwn2zf/qY+IqEVuAIIYVZGlgx5HFKMaNL4WwrEz51lXUHFvbVrKs7wb/TZVKnTxlN9tluOLvtSQP1ySxQkaVB1Srqb+aMFh5IkdJvi89ypHBXu6C1sqPyBCOGYH5fYB0s9o280Q3nXeWkYqbkShVkGCbekwomXE87izE5MZiSHghpJX+RyqknZggd7c/dgpIm4RPgX65Pj+Xqpg850LTEjFLGNJOhD9sVBZcASBectTWFYAWQWjU5NUHNn2o6hCxDOEypIdlQANh0/Ja7IAZUNTsq9wbHKIfw3n19+N65zEgAycVwDvlXGW0v6tGN+LnWtbvKSYysf8yhQAKqD6kcjg9vzsiLCkjWGELyM8tZsNmSZiWoat0aRM9XO80MESERhBQiwPmg0GaTUJciPw+ir9E+pG3HwzDYxC2qU8rAu738Rn8WgrF2M2l9ugqJpmwyIFEeYNrKK7Vt2Grvwfzrr4AyMqP2sjjkpf4VNb1coGMVWSfZ2/uxWfs4MPA1Qgxiw7xog89k/nr2bXMMi36x4Dv5RDFhFn7dSV71QqYxP+CGGlIHHKfRhRn7Al6FI5wbHDx4AQ69Sm0L+Z6xnQN+kCcj7Uv2o6VLgjxIUC+F9zfZ3EehKlaSDuO9d/XtAg+OKcWlP4nkhUQxHDwrTwjzBmnM= 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)(136003)(346002)(376002)(396003)(451199015)(36840700001)(40470700004)(46966006)(83380400001)(82740400003)(356005)(921005)(7636003)(110136005)(36860700001)(40460700003)(4326008)(70586007)(8676002)(70206006)(86362001)(316002)(54906003)(2906002)(5660300002)(8936002)(7416002)(41300700001)(47076005)(2616005)(36756003)(1076003)(426003)(336012)(186003)(7696005)(6666004)(40480700001)(26005)(82310400005)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:51:40.7021 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6914b81-ed7d-431b-29cc-08da9fb579da 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: DM6NAM11FT096.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5902 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 --- V2: * None 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 702c55deb747..3e4868ab8416 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 26 11:50:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988696 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 D6D99C6FA83 for ; Mon, 26 Sep 2022 13:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbiIZN27 (ORCPT ); Mon, 26 Sep 2022 09:28:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233546AbiIZN2V (ORCPT ); Mon, 26 Sep 2022 09:28:21 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2086.outbound.protection.outlook.com [40.107.101.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9CDC1DADF1; Mon, 26 Sep 2022 04:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O7ddc307nQf7nFFZecvdwgPx0HPo1/YFCkm3hs7iTu8pDPjVCWtQ12J9K64JgU5zAMcpBm6g/fH7u63Nm0x7hyodCmBeSnuMmCAFVDQR6X8mP9x9fITAFM/pt0UFlygLIZS1nViVDHqntI+JlTpN4GX3r92hErM6nvpPQbRXb4Ke5UCf6L6g5DcIDi4xmafAmAx7dOcs5hPIXgBeUN47Z6JtlwfcXImmrjFBymoow+wlgr0ZjKBYhyBQzspZA9gV5wOVmec4f8Q0IOBdDMn3iN3sVOodOk3hSBgvoiMnQDyUef/DvNlvapPRWKD8jwuTMZdsoGggK0M6SQQ+1o1lsg== 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=sY7f0tMIym9e+2K4kWMqdDUQn3UPs6bkTKSUBRttXFI=; b=Q9EwJitQUK3u6L5HWm6YLhpRWOc3Qdh/Gky388UWiBpRKFZJw52VM0vW8h+Z1PCZGI+VajNhoDFULo3fdIheW7uVms8ERya+MOaD52KxJWESv/9QvamaEhpxmJHCEUx1tyL6vQ87kXg0ruS5fw3etV+wlfxJbKNvKCViwVEHQKWIoCGiVLboH3+zuQB3bI0muzcHMyzj1ko+32IqUe6wsalKyGFaChcm5coRbJibGtk08EsFS82E+YlRhKDG5zwXuO+gl8Wa2XhpMIfEO4xTGVGUBnVfmJgxODVXBqjmlR1iaUKlyI94I+QqIwzSI5gjlCCLTJ1mAxSV2b5jPpBvfQ== 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=sY7f0tMIym9e+2K4kWMqdDUQn3UPs6bkTKSUBRttXFI=; b=Og+UC3cnAR/rdLH49OSIoMigEiO/CEQEKzlaCAjtOsyDarVUUO98GuJif8ekz0hRth/TFVEBnrdfj2UZX520W6pmMRqTolxph/VuXlgRihuN78nhjLS+DSowcOr9PPisCrg/CIwEljOFSM6Ue3y0s+ErihBCnYFw11Mno8Tbl0sgjjK+tqBKkN547flcHOHk7eTmLnqx8ZU89VmosU1F+nQS5DZkirCIXVX+W9qNIx92MLOngHj+0kkUdZoq9X9l5BhCSG2UIazZc5VDb6YAOktgTY0EpL0ueMGgdsGnALLOK0TuONBgKgLCLICHws8ma7zx1gj1YyHlop25pgxBjg== Received: from DS7PR06CA0020.namprd06.prod.outlook.com (2603:10b6:8:2a::21) by DM6PR12MB4482.namprd12.prod.outlook.com (2603:10b6:5:2a8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Mon, 26 Sep 2022 11:51:51 +0000 Received: from DM6NAM11FT106.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2a:cafe::f) by DS7PR06CA0020.outlook.office365.com (2603:10b6:8:2a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Mon, 26 Sep 2022 11:51:51 +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 DM6NAM11FT106.mail.protection.outlook.com (10.13.172.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:51:51 +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, 26 Sep 2022 04:51:39 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:51:38 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:51:33 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 8/9] phy: tegra: p2u: Set ENABLE_L2_EXIT_RATE_CHANGE in calibration Date: Mon, 26 Sep 2022 17:20:37 +0530 Message-ID: <20220926115038.24727-9-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT106:EE_|DM6PR12MB4482:EE_ X-MS-Office365-Filtering-Correlation-Id: c15cff72-7583-47ab-74d0-08da9fb58002 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LvakI2x1ifXTEpfdgoXw3+Cy9Qr0lCXCJ/jstjlRV2Fx9PZM+G98R7fdPykbi+vaBvZYHzXRAaCEjMc22ccYGpF1rYVQwP8mHwfdveTtVAVifrivjdJEMvigGaWI4uUIbyh0DdE2gmCUrc6ixkDxhhnOVJztpckb11JMqqZdDf2mBFOCWzEmmG0dvCcoiAHiS+n88fMQugtPztwcBVXq8Gh18eocFczsiSZRxNruXqhdDRnPzFlqxQAtjpv6hcd7tr0fD4le7hZjjRJb81x5w04xiJiukIY++Hc+xaDZR9WacO71fwcpI/CiyNNAUKYKdf7mOqOr+58nrqMqYH5dAs1RjyaGXnSHQtXLU97kL4xG0pFPqsJs1BrrarGBr6xpdP1nn8KyXQW0w1lKAuByVQ2oEDRF5nj6YY69gCX2JLUGICaUkM//OASRZig/jpj4H8j3N63I+S66vfNJ9k4Y8GCn6FtHynp7WZ8YC5KR1pD/LhlskJmwOj/HU+1NHCDMWSEasOg9yPxzReIrE/pwhVIJpAoOhZtRKRcLDx0pPqwQJiDARdRKXqkcd0rGSLie7twDKD5IhDIpaOO4+Unzn1zQWFr558oKj3MX+ZKDUY1nnp+Xj2W8qv8tdqQ3XrQZJY6liF90EJGIOJabZhMGUIqKQdNOLgnlzysZCL3x/ycX6ZngVlDOhg52oSLA7lOzJwq4olMo3PAwQZowo/QDHLepf4t12ljInxpH6HRK4kNHRLXfLm3yDS+OSZkoqpIfxvZfmrgva7qumhR6b8fzjyOlobMkVgCghJuIGeKTn6g= 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)(346002)(376002)(136003)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(47076005)(316002)(356005)(426003)(921005)(7636003)(4326008)(110136005)(40480700001)(83380400001)(54906003)(82310400005)(86362001)(70206006)(70586007)(2906002)(82740400003)(478600001)(7696005)(40460700003)(8676002)(41300700001)(8936002)(1076003)(186003)(2616005)(36860700001)(36756003)(336012)(7416002)(26005)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:51:51.0325 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c15cff72-7583-47ab-74d0-08da9fb58002 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: DM6NAM11FT106.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4482 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 --- V2: * Addressed review comment from test bot and Vinod 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..633e6b747275 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; } +static 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 26 11:50:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12988697 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 BFCA2C6FA90 for ; Mon, 26 Sep 2022 13:29:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234467AbiIZN3C (ORCPT ); Mon, 26 Sep 2022 09:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234933AbiIZN2k (ORCPT ); Mon, 26 Sep 2022 09:28:40 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20626.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::626]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90F0A1DB545; Mon, 26 Sep 2022 04:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PrQo8jJX5+uSxqNRgFXSQPqvXo4Bu4YkTDelOSvwRDiOdgTPTLp1KCK50+0jabAZ2mS/5Vmm9sCxS2cv2abJT0ty3aaqhJJ4DbBJxd4RFOsp05RgNpzU9PG36xsqtBAE2PMCoH8ANAb7vlLuBOz+p9WyTO7yWDYTuevZI69NIAN60t6jUNzyoZCEmSQ6iVvs20G7iPJ5k3ZEHN3yzYlZWX0Umo1kb+t7ZwLE/KvY0BsCQOcuvQpC37cYv0z6UMtEwrQnPxhY/yIlo0r3E7PY0jYdX4+iALLODGi3cpVkDyFms7J6XgoWpumuKHNRHAbZAExrQnZItSG0NV9hUKNAfw== 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=LKmaV6+jF1xw8mvpP63nGfHuSHfDEvqHRRTHfVhsRmY=; b=WVdwzv3OylD6H5OysJNepphnBWjzhmvu/GnnNGTXRNUzt4mk4KJM2sfrqXGWS0UB5ciIt0jvjdMgLwHYNYUpK+P5cJ9PbnVcmIrGXw4QlGsZjBseLlsoHcA5aQLYctuBh3QSOypDTUDnDBXbfGpjFGx2QYqQ9xR7Zn5gGEglx92cdJPTjZsETpExkTCXW0ASr7W8ZdS38q4nEjo7Dwsnlai+9UWQRNPyGkLrvu9tFCipBC0wbKjUg+328JVwDZ7nchLTKv1YX1ZEwNhA7kcMy7TJgyZwU/7DDN6Gx2hElnCA9TTfxznYGEW4IG8J/qhQryHl7LhA/jl27XRh7UanfQ== 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=LKmaV6+jF1xw8mvpP63nGfHuSHfDEvqHRRTHfVhsRmY=; b=pL/3r0CJwt2P1IImaC3t6Vq5g9a/rP45mcMAMWYyA1qXTd8ddiO54u6bwoSfCe1EzAfLdIPVziN/GYP2E7ZBLnSZ2aXe70/5cNW8HFlK3E+cmlfrLtOVnGLrvDqH7YaFJBWRY3JKObhSA78IjZiKrxwviIAjAyyBVx5YXG8WVW2+E1DYDqZuG3x0ZfBOThNZPTFJZNqGHdIdf+oYnDY6vgCy5iyqFHGq/UCRHZ2Rc4etqFRwEu8cR8x+rOwYpN3ntSkq+5DwnOAfgPRiJRGwDb+7xie85mJ3sqdTCMJ1Tk/8+a4F8w73iFJ68UjVIFoYKOlQTgU/mchMUv/lIdR33g== Received: from DM6PR06CA0060.namprd06.prod.outlook.com (2603:10b6:5:54::37) by CH2PR12MB4969.namprd12.prod.outlook.com (2603:10b6:610:68::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Mon, 26 Sep 2022 11:51:56 +0000 Received: from DM6NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:5:54:cafe::ba) by DM6PR06CA0060.outlook.office365.com (2603:10b6:5:54::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Mon, 26 Sep 2022 11:51:56 +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 DM6NAM11FT038.mail.protection.outlook.com (10.13.173.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Mon, 26 Sep 2022 11:51:55 +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, 26 Sep 2022 04:51:45 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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, 26 Sep 2022 04:51:45 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 26 Sep 2022 04:51:40 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH V2 9/9] PCI: tegra194: Calibrate P2U for endpoint mode Date: Mon, 26 Sep 2022 17:20:38 +0530 Message-ID: <20220926115038.24727-10-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220926115038.24727-1-vidyas@nvidia.com> References: <20220926115038.24727-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT038:EE_|CH2PR12MB4969:EE_ X-MS-Office365-Filtering-Correlation-Id: d03c46b7-4764-4a8a-dba3-08da9fb582d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L5Lvs5y0SAvyYGf57NeNY6CsvqWA3zHAjyDFQeOcz0be6P8SdaKun70Kd5Ge/1JKMdkdr5AZ9eoo/tOvC7HU1G54XtwQw5eQCm0MIQnkP7fOy4KQIlOOq+FJF9EQ3fMVh/gj8a5x8JIYdSVvBURQUGEObTQcBxVBzcNbM0onURX3amGs0cWCC/lFELd7hm+rdZB7is6WmUwKdmJ4Hu4v/vfh8proa1bZQCXxdNvzPyyAvKvdOAXzM2i9LgUdCRLt9nFwbW7yUrIxMAnTKbrxPJLjtb6r9evpIAeg55j68KV6AH8GSdn0o1sHINX1jQLBTu/Pa/oeE+/n9jlyLAduDhtM4DPi1AOZ4EF+gkZM08wUOxzfgjBzuGpQfjfUQSkh3FEiP6kUmT8HwnR0STaHjaSJIC8mpWbiQicMT9M60/hhn2STzZtyLmkY4zXY/Wu6MzpJH2G+xuvLek8ZhaHyqdVU7dd+ZVIV9RG8z1vI+uyqHDXm9kK9GluKE7lNBk77dosQfC5nTiWxkLoYiZ99/RLSRVHjsWkzHlUNTGZrY9DPo9TJz7Kr7Eqlplg1ugOP6epAD983fhOY/pY7zfgAt1hXg29Owf03K60EciUWsszLu0IRIUO6QwcVsV7+tIMm7e3mhNpG9dy/YjFRz3QYaWco2hv8wiQA04eSrXWdRTprnoYKQSanbY1TpO03nJPUEFTDk47Qy/7qCoiRsyLY1ubCx1vK4Wtb6amxtNi+Y/+O39V6bu3fXo4tZm1/HGttLVU+274QMZkiBVSzqEqQOLQIp8AgF65WkRuAGv5dEjw= 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)(136003)(376002)(396003)(451199015)(40470700004)(36840700001)(46966006)(36756003)(8936002)(47076005)(86362001)(336012)(426003)(41300700001)(1076003)(2616005)(83380400001)(110136005)(7636003)(4326008)(8676002)(40460700003)(356005)(316002)(5660300002)(921005)(82310400005)(2906002)(70206006)(70586007)(36860700001)(7696005)(40480700001)(26005)(186003)(54906003)(82740400003)(4744005)(7416002)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 11:51:55.7865 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d03c46b7-4764-4a8a-dba3-08da9fb582d7 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: DM6NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4969 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 --- V2: * None 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 3e4868ab8416..cfe32a98b2f3 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;