From patchwork Thu Oct 6 13:06:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 13000290 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 0C994C433F5 for ; Thu, 6 Oct 2022 13:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231165AbiJFNHH (ORCPT ); Thu, 6 Oct 2022 09:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbiJFNGz (ORCPT ); Thu, 6 Oct 2022 09:06:55 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2042.outbound.protection.outlook.com [40.107.95.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B572A5734; Thu, 6 Oct 2022 06:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lDw4Dcg5n6DRQIXott2G/RIPbn3Eq3klEqkxmmy3MlWmjbJebQj9Z7KCWgVO3Jty7Le8UsIRcmo3Plt2tCxgXrzQVDrvUjg6niHfMvzm1EFHj0YkMaaKaYAR2U3zRh2lAnlXTHoFGar8lej52wbsHCevPvuhXbw+vYotaU5efIUlGYobap9Jaff3Gfgl5GQXRV/YyGejeiVWizdmmGmQnmtszAFrogAkapRPGB0/wz0lxgoRPSBZoAuW/+hCutNxEWNzsPkz8d+L33Ouhh8dhH662/vmymNpz5tOzgbNUh0J8AuSg1uStJGpgkxlOQ1xtl6uxQUEcRhvwIxvmQMtdw== 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=ySAXZuQxT+OaejFFBcyvnzs7QYtblFhBELXJC0YqmDY=; b=lBZLT4W3LOlmDoksTok5J9ZB/rTBxxjSEZ7z3jLTatl/knKsRo92yUlpzHhSJBPUJPrXFox0WQav2s+icWp8f5GJH8zXRcOiNl7YXi8jwfzcvKMipCRgAR7ukXQLZSS1m+BLsm06CJaDS27kzr3QQS9bF73sukE+wCiHb3c/7CxelMmHRoD1UNR5+yFyFOifG4+/n/Ke3C6dmOSV40zw+BjKsE0hh799ZII9jAzrWr6Zdv9UAyRP5hPc/mEvrRCzGV7usnaEubqImNoyLK+l8CHlBOdOlySxbRlgGSbfk1jNz856Bomq0iOl0DUvTo+BJ1qkUOm/ta4232bKVoub7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com 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=ySAXZuQxT+OaejFFBcyvnzs7QYtblFhBELXJC0YqmDY=; b=Sr+UCXaOIAwB7GO2RyvReK268Mgn1V/8NB5X9/Goxpq8pqPqcWFNIOfZP4A7VWV4lCpMtpWwa0OlMloMyzUOVJ3cbiAjmnKVq85AHgK2lcWU727b6MK7WOF0MwVHFBDC1zywz1Sc9p8ig+yo+cqlq/ANuulG8JO+WSbr7GNoxulZdA2qZkf21rwboTQr6RcEzY1pm/CpFu9wOgTgpDmu5mQZMP6elmHXAGHKmn66p+BtGb7eK+CDqyqQ+eC36PabuLcWkMH8W1mBirSSB6K99e/+4RViu38Yt1QDFbrj/ZRU3F67EaQDzChjsrDEVvhpqdJiuigX9dQsRqD7MeDptA== Received: from MW3PR05CA0011.namprd05.prod.outlook.com (2603:10b6:303:2b::16) by PH7PR12MB6665.namprd12.prod.outlook.com (2603:10b6:510:1a7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Thu, 6 Oct 2022 13:06:51 +0000 Received: from CO1NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2b:cafe::9d) by MW3PR05CA0011.outlook.office365.com (2603:10b6:303:2b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.7 via Frontend Transport; Thu, 6 Oct 2022 13:06:50 +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 CO1NAM11FT027.mail.protection.outlook.com (10.13.174.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Thu, 6 Oct 2022 13:06:50 +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; Thu, 6 Oct 2022 06:06:28 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Thu, 6 Oct 2022 06:06:27 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 6 Oct 2022 06:06:24 -0700 From: Prathamesh Shete To: , , , , , , , CC: , , , Subject: [PATCH v7 1/4] mmc: sdhci-tegra: Separate Tegra194 and Tegra234 SoC data Date: Thu, 6 Oct 2022 18:36:19 +0530 Message-ID: <20221006130622.22900-1-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT027:EE_|PH7PR12MB6665:EE_ X-MS-Office365-Filtering-Correlation-Id: ace4b991-020e-4661-868f-08daa79ba225 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dlIx2B8+ypxAjI8FrWfp6eLGltb4WwMIzbUJV/rH79Cz6QlxHdfi8cQHMxrAZQw+eeSDzBMsDiyMB8ZUc59QjEjzep6PakQGkyLW0LEDpboqyzjUF8vnZSdRvUZGL+P3PInGfImQiO5GM3oaJp+z9AvE6PVI1eFFNjwTRDYHQ3ReOyN1nZ+G/trpe2JXNsSg9brgQzo8atImM5YuvJC30ozKhn3xcBigKpYbHyP7ifo7BVQIana9nzW2flCTcmV165Fjo4J1ttrrAdafcTxqvpt7gTEcduMkS6OhhSMIFuDfJ6czUx9P89xkdYXAx0GYbeoVSRjTDfFpM2XecgsytkQRtVPYvcKC+9nLO5So96VMJVbgLIiviqrD0ngOj3QF4r4OAAa1h59DHOyRQJBMV6CGISMM2i63CR4foHJJntrRC6QRQyTpHNA/sY8xwx+BqEb0f4WLwgIGypgf6nUSPKf+7z70+XD0fq2Txex7UvX+MHGzHkhU1iMex2JQ1lqBEN8aH4qJbqmeWB/+kkf+aJqaK783zgakqEZgMCcCictwYUajS8Rz6/Zm2PTu0A19be5iVJIetNSBsVwTOXNusGR/HIWESP5p2gCuwlutIkOMLg+frOBpqqP/ThUKP5T/hf35UvB7mbalblVRSrm0vetHCzaLsPDJFKe8sQRGaAOv6hSTsuipNF5R4qG53qBphT2hiw8TOjfgMHbHJ3LFxxVUnrTPLeRRNHZmXGALDJOmV5462zDs/xfuC2UL40iTsuoi3zPDYIZkUhFW14WQeQ== 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)(136003)(39860400002)(346002)(376002)(396003)(451199015)(36840700001)(40470700004)(46966006)(5660300002)(186003)(110136005)(426003)(356005)(54906003)(1076003)(86362001)(336012)(26005)(316002)(2906002)(40480700001)(4326008)(83380400001)(70206006)(8936002)(70586007)(7636003)(40460700003)(47076005)(36756003)(2616005)(82740400003)(8676002)(82310400005)(41300700001)(36860700001)(7696005)(107886003)(6666004)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 13:06:50.6609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ace4b991-020e-4661-868f-08daa79ba225 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: CO1NAM11FT027.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6665 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Create new SoC data structure for Tegra234 platforms. Additional features, tap value configurations are added/ updated for Tegra234 platform hence separate Tegra194 and Tegra234 SoC data. Signed-off-by: Aniruddha Tvs Rao Signed-off-by: Prathamesh Shete Acked-by: Adrian Hunter Acked-by: Thierry Reding --- drivers/mmc/host/sdhci-tegra.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 2d2d8260c681..a6c5bbae77b4 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -1556,7 +1556,21 @@ static const struct sdhci_tegra_soc_data soc_data_tegra194 = { .max_tap_delay = 139, }; +static const struct sdhci_tegra_soc_data soc_data_tegra234 = { + .pdata = &sdhci_tegra186_pdata, + .dma_mask = DMA_BIT_MASK(39), + .nvquirks = NVQUIRK_NEEDS_PAD_CONTROL | + NVQUIRK_HAS_PADCALIB | + NVQUIRK_DIS_CARD_CLK_CONFIG_TAP | + NVQUIRK_ENABLE_SDR50 | + NVQUIRK_ENABLE_SDR104 | + NVQUIRK_HAS_TMCLK, + .min_tap_delay = 95, + .max_tap_delay = 111, +}; + static const struct of_device_id sdhci_tegra_dt_match[] = { + { .compatible = "nvidia,tegra234-sdhci", .data = &soc_data_tegra234 }, { .compatible = "nvidia,tegra194-sdhci", .data = &soc_data_tegra194 }, { .compatible = "nvidia,tegra186-sdhci", .data = &soc_data_tegra186 }, { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 }, From patchwork Thu Oct 6 13:06:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 13000292 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 D2136C433F5 for ; Thu, 6 Oct 2022 13:07:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230447AbiJFNHR (ORCPT ); Thu, 6 Oct 2022 09:07:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbiJFNHH (ORCPT ); Thu, 6 Oct 2022 09:07:07 -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 78A35A6C01; Thu, 6 Oct 2022 06:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LqhVs+2S4yPTjdRbpsBl7O70D8TAVvyeiEDvNjy9At8KP3A7NWJlYxHFqZMizQzqiNrrxPxrX82MWuoMXCjm+wMYJMo2bYy3UtgHTpQTOVqYOiu6+nc35m4nPIGGKd7petmEeaaJatoSv8cMB0g1UuPMxtuTtBfoeF/+eX2+ggQimDjy0ygDuVYc25Pyq0d7sO1/CFbifV9Kds6CyiF6Z67mPv+IxR2xv6YgwljlmeW5Aoq8i181lejT4+UiXtN9qll0aaxR2hDHA6N5LHV4DLbigLlr2k7X4AU2nxnzENOo3H1onL1mC1kwVdbHFGcOJUhL7GytS6PwsMXLkiKQFw== 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=/L+zg0QWeFm5RjDStDHR5gmMU6hfJIeReAVxjsHgq4U=; b=lLqNE3Jn4UKcTy6TDx7u0p5X3ObMGe/mw7aZlrnSf2KJrkDsb8Zt/TVaE91qSAHshg9+rfPPQlVbfcdQG7FjM8JA05eJ49ggBZG4Wh1H9IBnF3Ubo2KM4U8/mXbYf9gFRlG68Ez2F4apDUPcgMxQJo188UGLm2R81UoAlwiokKKfKzyDo5hF0F/gZvanmQ4OzrbEQbgozrjcxNAPBggHg1UDGFto2h9VqaK7fiIHXf3ige7nxygdNj3cZ9MqpHhz4VQMresxpv86QLRmkqsyQbS2tbowOOM5bwIGg9TfsZygXMzoP+kX5aRYMbZh9jG1qwsIBjdW4SNAVxYX1lihUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com 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=/L+zg0QWeFm5RjDStDHR5gmMU6hfJIeReAVxjsHgq4U=; b=qQhzM5CNVUsLZK+G89Dj94kP4ThE0i3hyQUtqViCltT4ixwLZNEvxHBjg8olKDN5xOmxsys3VgPXnEvzF1f0L0jiVIxIevphPzrkbBDOzuJuxtULuRM4AUm61UklCYJb+dwAUewrUJuzKp2HzcNoS7X152nmQ0LwKRjVzz/uRNQ3o7My9w3CMUy9LzjoHQHutZPgkPF6Asf4qNdfSGktwQ8Tl9vP4Er5RbsRYBgTXFazMlYIkst8W+DS4XG+zMl6fz0FY70lBAPS2xuOMVWubtOigDk/ppHhOmaSuRHoYlFy4O2sB5TEz5mGvDjrs6Ou3movdAlETKs7sFQwWu+hJw== Received: from BN8PR12CA0027.namprd12.prod.outlook.com (2603:10b6:408:60::40) by CY8PR12MB7241.namprd12.prod.outlook.com (2603:10b6:930:5a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Thu, 6 Oct 2022 13:06:58 +0000 Received: from BN8NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:408:60:cafe::42) by BN8PR12CA0027.outlook.office365.com (2603:10b6:408:60::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24 via Frontend Transport; Thu, 6 Oct 2022 13:06:58 +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 BN8NAM11FT047.mail.protection.outlook.com (10.13.177.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Thu, 6 Oct 2022 13:06:58 +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; Thu, 6 Oct 2022 06:06:33 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Thu, 6 Oct 2022 06:06:32 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 6 Oct 2022 06:06:29 -0700 From: Prathamesh Shete To: , , , , , , , CC: , , , Subject: [PATCH v7 2/4] mmc: sdhci-tegra: Add support to program MC stream ID Date: Thu, 6 Oct 2022 18:36:20 +0530 Message-ID: <20221006130622.22900-2-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221006130622.22900-1-pshete@nvidia.com> References: <20221006130622.22900-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT047:EE_|CY8PR12MB7241:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b0ff919-d1ca-43eb-d9e0-08daa79ba6c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bdPTKAaTz20q2IWFkLC4LLV+jZmLvCD2XeGBSMEwRAN+wwe3vXj1A5xsFNvQQ1On4JZ4dnYvGkmbEroUjYfSC03LLbUwS7MMyn5Kr7ef+08GzXf39FdZSwekRA93ombSROB1twyQu7+jmeNjcwykAe/6YJdau0xjYh6HLIbk1uaMdMvwSp56jmPlgbs1F4aMpJhf50Zym3+p7ZnS1joyLhX3fEF8qoLUeXfw/YSL4g+3Tyo/ZiGRECYAC6Nt3v8Iee/ySJ5ft4ERd/AdA+FKSepAh8ik32FgJxdWGbMFCDn0KKJ1D3y3h8WqO830agmim16M5vqxly7GMkcE+y/yBhFVNkz5fXNdRvbwTnfZFstKyLA1JyKWDUoUiELkBIEwXqoyE5SwepMfMaPVZkKSNrig0MbYYvR2P3qEWo8eBDSkl3o1BYTIUf7sdutVKQCOGODL8IGS2aODO/rG6PJaSh7kVnZFEiEJ2DqC+16vRmtHSko1Hst4ayup3oHqgruPoksdbJZ4Vq52AnzFKna0v9boZFnzYIAB9OuivLK5KuzK2bqmZbOfQ8dACRMp2X3o7QE9K/ot192UooCuENahFdlQ4MaKvP2xk65zhpFzro3Q3M5QvDioorF7ikBLqYlZBqqHpGU3CBjSzet8Ux4u3uSuQTBIDCoqXR8NZ77G7PpjDSs4fAC+uShn8XhvSsnhPDZm7N9zWWr4iQwqOwZuucEU0mrVQ8MF0f6vAx/SDTZjoLZ9PzxUW9hcowXiJaFRkR1GyznXo9OxBMoZqa7ADg== 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)(136003)(396003)(376002)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(1076003)(186003)(2616005)(356005)(2906002)(82310400005)(316002)(70206006)(6666004)(107886003)(54906003)(70586007)(40460700003)(4326008)(110136005)(8676002)(86362001)(478600001)(41300700001)(5660300002)(26005)(336012)(426003)(7696005)(7636003)(8936002)(40480700001)(36756003)(47076005)(82740400003)(83380400001)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 13:06:58.4421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b0ff919-d1ca-43eb-d9e0-08daa79ba6c8 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: BN8NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7241 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org SMMU clients are supposed to program stream ID from their respective address spaces instead of MC override. Define NVQUIRK_PROGRAM_STREAMID and use it to program SMMU stream ID from the SDMMC client address space. Signed-off-by: Aniruddha TVS Rao Signed-off-by: Prathamesh Shete Acked-by: Adrian Hunter Acked-by: Thierry Reding --- drivers/mmc/host/sdhci-tegra.c | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index a6c5bbae77b4..e88294a6912d 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -25,6 +25,10 @@ #include #include #include +#ifdef CONFIG_IOMMU_API +#include +#include +#endif #include @@ -94,6 +98,8 @@ #define SDHCI_TEGRA_AUTO_CAL_STATUS 0x1ec #define SDHCI_TEGRA_AUTO_CAL_ACTIVE BIT(31) +#define SDHCI_TEGRA_CIF2AXI_CTRL_0 0x1fc + #define NVQUIRK_FORCE_SDHCI_SPEC_200 BIT(0) #define NVQUIRK_ENABLE_BLOCK_GAP_DET BIT(1) #define NVQUIRK_ENABLE_SDHCI_SPEC_300 BIT(2) @@ -121,6 +127,7 @@ #define NVQUIRK_HAS_TMCLK BIT(10) #define NVQUIRK_HAS_ANDROID_GPT_SECTOR BIT(11) +#define NVQUIRK_PROGRAM_STREAMID BIT(12) /* SDMMC CQE Base Address for Tegra Host Ver 4.1 and Higher */ #define SDHCI_TEGRA_CQE_BASE_ADDR 0xF000 @@ -177,6 +184,9 @@ struct sdhci_tegra { bool enable_hwcq; unsigned long curr_clk_rate; u8 tuned_tap_delay; +#ifdef CONFIG_IOMMU_API + u32 streamid; +#endif }; static u16 tegra_sdhci_readw(struct sdhci_host *host, int reg) @@ -1564,6 +1574,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra234 = { NVQUIRK_DIS_CARD_CLK_CONFIG_TAP | NVQUIRK_ENABLE_SDR50 | NVQUIRK_ENABLE_SDR104 | + NVQUIRK_PROGRAM_STREAMID | NVQUIRK_HAS_TMCLK, .min_tap_delay = 95, .max_tap_delay = 111, @@ -1775,6 +1786,25 @@ static int sdhci_tegra_probe(struct platform_device *pdev) if (rc) goto err_add_host; + /* Program MC streamID for DMA transfers */ +#ifdef CONFIG_IOMMU_API + if (soc_data->nvquirks & NVQUIRK_PROGRAM_STREAMID) { + struct iommu_fwspec *fwspec; + + fwspec = dev_iommu_fwspec_get(&pdev->dev); + if (fwspec == NULL) { + dev_warn(mmc_dev(host->mmc), + "iommu fwspec is NULL, continue without stream ID\n"); + } else { + tegra_host->streamid = fwspec->ids[0] & 0xff; + tegra_sdhci_writel(host, tegra_host->streamid | + FIELD_PREP(GENMASK(15, 8), + tegra_host->streamid), + SDHCI_TEGRA_CIF2AXI_CTRL_0); + } + } +#endif + return 0; err_add_host: @@ -1861,6 +1891,10 @@ static int sdhci_tegra_suspend(struct device *dev) static int sdhci_tegra_resume(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); +#ifdef CONFIG_IOMMU_API + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host); +#endif int ret; ret = mmc_gpio_set_cd_wake(host->mmc, false); @@ -1871,6 +1905,25 @@ static int sdhci_tegra_resume(struct device *dev) if (ret) return ret; + /* Re-program MC streamID for DMA transfers */ +#ifdef CONFIG_IOMMU_API + if (tegra_host->soc_data->nvquirks & NVQUIRK_PROGRAM_STREAMID) { + struct iommu_fwspec *fwspec; + + fwspec = dev_iommu_fwspec_get(dev); + if (fwspec == NULL) { + dev_warn(mmc_dev(host->mmc), + "iommu fwspec is NULL, continue without stream ID\n"); + } else { + tegra_host->streamid = fwspec->ids[0] & 0xff; + tegra_sdhci_writel(host, tegra_host->streamid | + FIELD_PREP(GENMASK(15, 8), + tegra_host->streamid), + SDHCI_TEGRA_CIF2AXI_CTRL_0); + } + } +#endif + ret = sdhci_resume_host(host); if (ret) goto disable_clk; From patchwork Thu Oct 6 13:06:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 13000291 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 EBA72C4332F for ; Thu, 6 Oct 2022 13:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbiJFNHK (ORCPT ); Thu, 6 Oct 2022 09:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231142AbiJFNHG (ORCPT ); Thu, 6 Oct 2022 09:07:06 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2081.outbound.protection.outlook.com [40.107.243.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B346AA2AAB; Thu, 6 Oct 2022 06:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OfF36C8XScvFjX04hNTXAsCMe7INiLowI/tI4t6wint9rbTRj6UYLGCsJuqZeD089by2UMA3dRCs66SKFr3jkAoo8eEmMg27wtQI6N0ziDdQ3V5JhYtBlGyqKlOqKbSGAv6GPnkyD/MRlLA0JgPTKvdqq5MogBRLMDOT/WcD9K03PKKOkxkuns/odP7cn5o94r6tdjB7uZO7w/LAlrm+dsd6bmo5QY7wvRo6UKdX/dcRh81krqYteWqYi9nisZt4QUfJxJ7ERH0/F0eKmnkdCpJaB51IGWxYfRScTGaWIFyj+dVdKbsRLbD2YUVoNC1wHvZArX3w316Tz/Ho8pD3qQ== 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=JIeZ1LT7TqnvY3Uvh7MH08omej2EHzrFcpvfiDM38/A=; b=YEDgShDyOMtNynPdKI/NW/KsHJMRPLhMjl3SP1yTcPo+u+1KQyv82C323euFsUuooQyOrP0ZkK8gBdaE2k+x1nmUqfv1t5oxGJJGCXawAxpCMYKIny0ip/mov8IFCA4OXEHEsrS4bBX687lEc22/9rkQ7CGdJY8tDDVAQbCDtW/1h8nX27vmcp9Xl26ZR+hvH1PiDiaxp9P5BJ3Q0pwioAfKhdcvikBE2aET/Z06l6SEnVq3SoCpPQGIBvo/vDEy3vgZnl3m19wLoLxqAD/e6J3oa1xEIU/1x7CK/I0+xHGr1shS7By+HVdyGASJYd1juZJzWMzBGLClvq9/OeoqQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com 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=JIeZ1LT7TqnvY3Uvh7MH08omej2EHzrFcpvfiDM38/A=; b=jkc9Y5efn4tr25JohGCG+dq28JkQ6rr14Y3AnW6uPzgg1waixZ4zvS0krtQoU5xqdXQexFYy+MI6rceMkAw9bTBA0N5oTp7n3Ut7yIYGCBoFmqnQmqtHbHA5pcCPEvBltuOnzI18Aiqs71VAGL5OgxXqIt3kVql6/zxq3CfchBAW/b2TT9Rw5FbN0mlYypOh7saCEWh5SPkztU6rUCFxxiMPMqIOj6p+Yyk6CJZF5wBF7J92dm5+xhd+mK0ZIooM9p73WWMlYi+glQ8xmLlGRHelPuYQjExxEZ7OmgbqFtRCREOTUhd+jgBSaQkYJh+LqYhdp3pNUKehQ+rsLU52CQ== Received: from MW4PR03CA0125.namprd03.prod.outlook.com (2603:10b6:303:8c::10) by DM4PR12MB6183.namprd12.prod.outlook.com (2603:10b6:8:a7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Thu, 6 Oct 2022 13:06:55 +0000 Received: from CO1NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8c:cafe::c2) by MW4PR03CA0125.outlook.office365.com (2603:10b6:303:8c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24 via Frontend Transport; Thu, 6 Oct 2022 13:06:55 +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 CO1NAM11FT045.mail.protection.outlook.com (10.13.175.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Thu, 6 Oct 2022 13:06:55 +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; Thu, 6 Oct 2022 06:06:38 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Thu, 6 Oct 2022 06:06:37 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 6 Oct 2022 06:06:34 -0700 From: Prathamesh Shete To: , , , , , , , CC: , , , Subject: [PATCH v7 3/4] mmc: sdhci-tegra: Issue CMD and DAT resets together Date: Thu, 6 Oct 2022 18:36:21 +0530 Message-ID: <20221006130622.22900-3-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221006130622.22900-1-pshete@nvidia.com> References: <20221006130622.22900-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT045:EE_|DM4PR12MB6183:EE_ X-MS-Office365-Filtering-Correlation-Id: 75a9f06c-300f-4325-0c15-08daa79ba4fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QBEy/Qo87bnsjULZ0H6E5FD228qJ+UO+LqnuQf57D/2tZoCwCGuHPYS4LxAEWmJlvmatSZPpummgrBemVQyUXwSBUG6Wgc4uxtaaxBqQ5eLh2GCrGw7YwQh7JxCL9VtSvuJ4+22/pyWIZ8C+XshXcB/qgg+PY86PWr6BNXZx3mLOVHXTs2F48KcrOVBTIpmWCi6H3j+nBLOK5EeTSlWuxPU6pOCAldSus0b/1ZjNlFTLAHEr1E4ceR8OSA/dCCO+zf4Do3z6cj7h0kKaG2dRIlEIUzTc5jqMgZkCLsdVJqHwmDFDagCceJzWo/KjBJN0v2WEBF5x4bUzLRyP/IGccw90K6uqWSlMy7OiXLXlbRHsskMteTrbe/CgLMmi6PerKFxknB2D2nFv8rvW3GN0GZ9XKLruvrsdbLqMqS7OF3zEKxBUcGLWI5tVoxGLI6twzpv70H+AD+4PTszSHi/oOYkuDwKNRY9hXJfG02ORiNU4t5AoYP8AgHYleflHkUZJOOQRYiaK5k5Hxp/TUz55wCasI4woJnJO1Swy1iL98eh5YjwYH8leHrI/XVFny3fhpsZLk3zlaMTH3FdRx9UP648SqRKflSVQjnzVtfcEM6DiRB5ZdWtdwlC3QK7buDTp13xhirnSFWKvnLW3v4S4BzgCiMvXyON4j7SLrLIyrY2z5HsL28CbI6A0E/iR6dFglI1+nHQV4//r1Fw9svODZeRyRv83WsGk/0DekU0BRTvs0Cml9XAqDQ/OlFf3dMnP8rLis+XZnDzpdyjno/u9yA== 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)(346002)(396003)(376002)(136003)(451199015)(46966006)(36840700001)(40470700004)(70586007)(83380400001)(4326008)(70206006)(8676002)(6666004)(26005)(86362001)(40460700003)(107886003)(5660300002)(7696005)(41300700001)(2906002)(2616005)(47076005)(426003)(186003)(1076003)(40480700001)(8936002)(336012)(36756003)(478600001)(82310400005)(316002)(36860700001)(356005)(54906003)(110136005)(82740400003)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 13:06:55.4313 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75a9f06c-300f-4325-0c15-08daa79ba4fb 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: CO1NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6183 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org In case of error condition to avoid system crash Tegra SDMMC controller requires CMD and DAT resets issued together. SDHCI controller FSM goes into bad state due to rapid SD card hot-plug event. Issuing reset on the CMD FSM before DATA FSM results in kernel panic, hence add support to issue CMD and DAT resets together. This is applicable to Tegra186 and later chips. Signed-off-by: Aniruddha TVS Rao Signed-off-by: Prathamesh Shete Acked-by: Adrian Hunter Acked-by: Thierry Reding --- drivers/mmc/host/sdhci-tegra.c | 3 ++- drivers/mmc/host/sdhci.c | 5 +++++ drivers/mmc/host/sdhci.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index e88294a6912d..3663c5d0efe0 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -1535,7 +1535,8 @@ static const struct sdhci_pltfm_data sdhci_tegra186_pdata = { SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC | SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, - .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_ISSUE_CMD_DAT_RESET_TOGETHER, .ops = &tegra186_sdhci_ops, }; diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 2b5dda521b0e..8512a69f1aae 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -270,6 +270,11 @@ enum sdhci_reset_reason { static void sdhci_reset_for_reason(struct sdhci_host *host, enum sdhci_reset_reason reason) { + if (host->quirks2 & + SDHCI_QUIRK2_ISSUE_CMD_DAT_RESET_TOGETHER) { + sdhci_do_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); + return; + } switch (reason) { case SDHCI_RESET_FOR_INIT: sdhci_do_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index d750c464bd1e..6a5766774b05 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -478,6 +478,8 @@ struct sdhci_host { * block count. */ #define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18) +/* Issue CMD and DATA reset together */ +#define SDHCI_QUIRK2_ISSUE_CMD_DAT_RESET_TOGETHER (1<<19) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ From patchwork Thu Oct 6 13:06:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 13000293 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 32CD2C433F5 for ; Thu, 6 Oct 2022 13:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231160AbiJFNHS (ORCPT ); Thu, 6 Oct 2022 09:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbiJFNHI (ORCPT ); Thu, 6 Oct 2022 09:07:08 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2058.outbound.protection.outlook.com [40.107.220.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D4DA599E; Thu, 6 Oct 2022 06:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WoInPB+Yv4njzBOSSIsU5wwjo6tSRbeXZqS4nwo4BZqNGClGK7SAGHfhX8e41S/FFyjXkXhjOsjfvSPFvXTAB4+/GqX60+R7u+REZQIa+qgMHie0qflWYUWmeGuqrUBaj1p13bS3eLXJtyRQf3qrzF5Y5en9nkXbeGGVbuKzCzL9UE/UnHeJPVZMgNjZtIf7YFzkkjOSzVs6oEle77vmlPSpUDhbOwikrGlF6B0JfnloUO0ccfDKSKXyHWNb7D//nHqOz0MA1zUxk1McUC89unw+gV19DpVch9wE9qrhqV17I+r3gBpvt/LicH6y8z16gGSPz4Ruizf9cTRNoQDfiQ== 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=tnZ4xyvpS6vy5pVf/9oMn0ElhmveCx8I5Uha65hb+2Y=; b=M08Qf2xpYqsT75mk2J7/+y+hv28eayN9ZBs486Za9VDDNxqRBMQE7GtKdjV0CbY3HxoIlZSS/YmLMJPmccYk8/c+rL/iwxxy5MPZSa/79csAzF/w8igZwAAqrXGFKpZPMy/i95Z9CDOC0bbAGuwNakYJRDdeh0LmyjCAa6ypjknKXd7WKz9LNokrhx5P/uGreY5TstJpD5Iyhi/C5lfY39VLMC98JCJmFsDQkcw9gTIzdZmSsfRgjtPzLiTFo1YENovMHM7NyC1I62Gu2CywZjymvUcx3ulUUsOTcLyU/8TWcrayMOQ1LOXZZ6/po51zvhmOy2ummhxCywEF+VG4Dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com 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=tnZ4xyvpS6vy5pVf/9oMn0ElhmveCx8I5Uha65hb+2Y=; b=Y9eoWjWpgMpD/xWclAMUIjiLRp1VxlzuTdUfIGSnbtIrqL2CmHRpIPiwvGGRdDzpznCiKQy1J7axc9iBlJCa/w61CpNS3DywMQhCPoQ4j9YhpbqXROIWPmVTI2gGC4mCfZODKHciiTTkiP2BPod+q0pzVHW0+NUc4FO4DnJHDyNgebhpUcX9cZaZCXR3J/nCBJ/knmgysZcbwciCIqIUdsVuzGhoZfQabdnp9efu6aKzsM/PaKaQQ9JuJLOf6rlF2i9jiL2DIo4tOXDeYku5PFSO1PCIzPtfMD8jTX217XsU+sEcgcaxyBV8UIeOYFmJHku+gTSx1Ie0Hch9PeJUYQ== Received: from BN0PR04CA0151.namprd04.prod.outlook.com (2603:10b6:408:eb::6) by MW4PR12MB6730.namprd12.prod.outlook.com (2603:10b6:303:1ec::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Thu, 6 Oct 2022 13:07:01 +0000 Received: from BN8NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:408:eb:cafe::15) by BN0PR04CA0151.outlook.office365.com (2603:10b6:408:eb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24 via Frontend Transport; Thu, 6 Oct 2022 13:07:01 +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 BN8NAM11FT004.mail.protection.outlook.com (10.13.176.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Thu, 6 Oct 2022 13:07:00 +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; Thu, 6 Oct 2022 06:06:43 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Thu, 6 Oct 2022 06:06:42 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 6 Oct 2022 06:06:39 -0700 From: Prathamesh Shete To: , , , , , , , CC: , , , Subject: [PATCH v7 4/4] mmc: sdhci-tegra: Use actual clock rate for SW tuning correction Date: Thu, 6 Oct 2022 18:36:22 +0530 Message-ID: <20221006130622.22900-4-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221006130622.22900-1-pshete@nvidia.com> References: <20221006130622.22900-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT004:EE_|MW4PR12MB6730:EE_ X-MS-Office365-Filtering-Correlation-Id: f1169c69-2aba-4750-b1a2-08daa79ba846 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4COCASO2XnAlK/gl708k2mJrBF9Wu8Bsu6bDf+5J614rmnbh0FfTNn51gncyAs+0zNFM/Q0vOzm7i3Q4o2dPxoh65JDzc+/tYVKP+EpLQe9zLNUhoWL9jqvNSY6Tsesb3WASGLhW2uxzc2wO2bvepcwes3bHJBXtB35ILIW5Ta9etaTRXg9cYJfBAaYXGAzZAwdZP/dFl++hrB1+aDiU80gifpLCYuKzpBoVH6oEZtbDCuAD2eYaJd4Q0qrHc9+OuYGSbKS9IARjVwhOAJfyeeQkD50IwudyVlLYh40vS9M4fUNo61EJd2xvBV/cvpMOsM5eLrf5cLiSxy7rSev/B4UD5fXqoUoJuTss/5/LTRWFBNSs8A6D7FPSNNemVg2E1XWfoljlNlqI+bfTJk7d7ilrb1jkx+3EaHLi20qe4PgxYDQs52bCXGvhEJxlWB53riZO5XyUwPeyoTkZXn7qvRtJ7UcjxR2/u1yEkEg/Ag/DTE8wXTItISOPy+6hvrVCXbRCkIsLnH70kddPAMjxBAd4gSndkenggUk0HN91/9ZFNONzJIiOHjkGMJ3RZPYS5HzF0P3VJuF0t8Mrqsh55zqi+K0MRHJQdtDNdye/hPJkVyHXLIxATSK8yjsrfjffY32QQyo2qtmBZXFaudGVqMDdPRJAsYmGOtZ3w3RAvASe19KuGMQd8tKRquWCQvfCYrrBrb+Pb5L1p4kDCoqmLZBbBNnFI4COSZQC9nMUicdv/7Orp1WeRLweHD4eLZWOwgSo0Wkok8icErIKRHrjww== 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)(136003)(396003)(346002)(451199015)(36840700001)(46966006)(40470700004)(2906002)(83380400001)(6666004)(47076005)(82740400003)(426003)(316002)(7636003)(336012)(2616005)(70206006)(8676002)(1076003)(186003)(70586007)(54906003)(36756003)(356005)(40480700001)(86362001)(110136005)(4326008)(107886003)(40460700003)(26005)(41300700001)(7696005)(36860700001)(8936002)(478600001)(5660300002)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 13:07:00.9290 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1169c69-2aba-4750-b1a2-08daa79ba846 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: BN8NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6730 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Ensure tegra_host member "curr_clk_rate" holds the actual clock rate instead of requested clock rate for proper use during tuning correction algorithm. Actual clk rate may not be the same as the requested clk frequency depending on the parent clock source set. Tuning correction algorithm depends on certain parameters which are sensitive to current clk rate. If the host clk is selected instead of the actual clock rate, tuning correction algorithm may end up applying invalid correction, which could result in errors Fixes: ea8fc5953e8b ("mmc: tegra: update hw tuning process") Signed-off-by: Aniruddha TVS Rao Signed-off-by: Prathamesh Shete Acked-by: Adrian Hunter Acked-by: Thierry Reding --- drivers/mmc/host/sdhci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 3663c5d0efe0..ccbb26a66284 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -783,7 +783,7 @@ static void tegra_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) dev_err(dev, "failed to set clk rate to %luHz: %d\n", host_clk, err); - tegra_host->curr_clk_rate = host_clk; + tegra_host->curr_clk_rate = clk_get_rate(pltfm_host->clk); if (tegra_host->ddr_signaling) host->max_clk = host_clk; else