From patchwork Thu Nov 3 04:38:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 14638 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp315556wru; Wed, 2 Nov 2022 21:39:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hglV1bTf8bUYar9V0v8XPdaTO+i0C46/VmGEQ5OqKq5oTUeaEitxv8tPUawY/L/xet3mH X-Received: by 2002:a17:902:7849:b0:186:68b9:e1ae with SMTP id e9-20020a170902784900b0018668b9e1aemr28334174pln.139.1667450377832; Wed, 02 Nov 2022 21:39:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667450377; cv=pass; d=google.com; s=arc-20160816; b=0Umv2ziWau4JsSNCZgVu882G6t/N1I70txNUM+7g1cnkXoY0POsRBkzlYFabpNhm2v Gk00AjEKhpfhf6OOEAaqyzx99ue3e7XGMgKYd5zAwZCtQ2cq0aN8vkmXGDZB6insfwxD 6iuqIPAUoXkyuGHVJh3u0mm2wBWig7fOF2Gmw1oIhr86fLlBHeggrdew7cpeiqGTxNSN DH9Zb7U5ZLKZQpr/jkoQgg49fHKn3xLIUM40RgCUK4P1gFgxXUALuSE9i5pKvPxpUFlg o6gJisccwnnnCTnDG1ylcBWIfXtiWvFi+FDFBJzoE92BEFCQVM6m0zGiw42n4smfpVsO IBcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=WOe3tdJRd878bJJt9S8xdg0gSuSIR/ugq8eLK5r+2OY=; b=qQOwoRAl+xGZlhafqO6yMHCAZxUpF6P+q0HDlyEbkq6ER0H/6qwMpRDguTXIiw6XXN 4P4kr/lTW1yxorzIPLvE9WbTlHNQn2OawNYibPar5V/xm6QiolCI7/zzWcWl7LrcsngR 57/Z6xr9pjllvw/TXbJ5dfAZm4mEn+28q3W6hQpxn0NlEG39E1H/egF2mgY0kwrw1SHk /W2NZ3lS+jI3qIxEH/yDJfqVacDS4W8RWSvKkMCrG4odDequSkd5FOuECj5cfgllWNq/ 7GhoW/k+W2qPL191RVbVMhMWgvyuDVBtFYzD4rbkOpYvnikv4tKKSVglSZLSaDx2JPeF 2NsA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="b9YGY8/E"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 14-20020a63000e000000b0046ee85f1477si18942651pga.712.2022.11.02.21.39.24; Wed, 02 Nov 2022 21:39:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="b9YGY8/E"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230175AbiKCEjQ (ORCPT + 99 others); Thu, 3 Nov 2022 00:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbiKCEjN (ORCPT ); Thu, 3 Nov 2022 00:39:13 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2045.outbound.protection.outlook.com [40.107.92.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC72113E39; Wed, 2 Nov 2022 21:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hw3Y0Rz/NzVtvvjpPSXfGoakyEUZ6Wxej9Wf2he/G1ZELJzUghmWRjtTvuPngedCvjCVE09mz/z6yn9fUt35wlb9ZxYPGxmfzKUR3eme3pnZS72YpXLfPoUiN7pOa+l8sOMIxjKujY4uxWR+B66VdWE6WIxNlPkYf9uaokFM7VhB7vUMzmDiRV/rh51Q7cBZfHgI4fSyEz/xb4J1Y67FlSFQAxDQqd7ggkCQQHU+G6/49l+pfpvNP79Qw0sgd1VmYT0NyZ31IPnz/3wRWoClHI3CTibiIMOP3Ok38Qu1tIWXwu+/0HByICbWwWhBEcnWw/8AB+j+vEHlnup+yPnSOA== 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=WOe3tdJRd878bJJt9S8xdg0gSuSIR/ugq8eLK5r+2OY=; b=VP32l3j7o8tdbxOgYASxJp6Y/gyddG+ZohLsA42KQoWWpKKQ9tQZggLizN+mwTo5CTrwea7COjAOWcGQmiSaujdRqAz3TOLaVGk8r1FWUiQz0arorXMOLd9P9Lvr7NvrK1WpNLUwpvQs4j9xDP9t8nKYtOdaAr2e61tPAAF5ew1rTmMJKTZNsLPCnRXn3Lf0uHE241Y25QD0uM0l7wdYty8k8QtNtBmZHWCSbxpz33c2Io69r3jZF8K0D4afQqVn3Kw+2PNvn3iwng8AtJHqvjq2zkcLVIUvB2TjMXivYtBvtbPT1sqwQfN9yIOL7L0iEVaiCDSxPAyoweWE3UvXKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=8bytes.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=WOe3tdJRd878bJJt9S8xdg0gSuSIR/ugq8eLK5r+2OY=; b=b9YGY8/EFvUVfZ3Jb+ap4YseYYwJsVBwmJG7jKxQ/vJlldcY4m2RJS9yoewbRJKxXnwOeGvu9wvv5ieNvSfhug9Fw9N2Dkz8lOrvsWBWJNo0ns0kdYMRDPiLvcEYMwN38hKgbihJi3nBZq1gvTWi24GzlgrngQx2SFLHybg61n12mP+PfMVyHsZY4LPULuZPQDPefxL/q648RpLced1YB2g5BAeg44RP/eV6rjHDKBjK8203ZLiEdfr9zx3X/Xdkz7U4jeg1PR4kbYac2M1OlplxItLhT3vUGSeUETNsAj+WLXlmwddw0Tj8p+UKVkCzKWQCkii+7oYYi/4a3cKPUQ== Received: from MW4P221CA0016.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::21) by BY5PR12MB4068.namprd12.prod.outlook.com (2603:10b6:a03:203::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Thu, 3 Nov 2022 04:39:10 +0000 Received: from CO1NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8b:cafe::42) by MW4P221CA0016.outlook.office365.com (2603:10b6:303:8b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.21 via Frontend Transport; Thu, 3 Nov 2022 04:39:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1NAM11FT019.mail.protection.outlook.com (10.13.175.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Thu, 3 Nov 2022 04:39:10 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 2 Nov 2022 21:38:59 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 2 Nov 2022 21:38:59 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Wed, 2 Nov 2022 21:38:54 -0700 From: Prathamesh Shete To: , , , , , , , , CC: , , , , , , , Thierry Reding Subject: [PATCH v10 1/4] iommu: Always define struct iommu_fwspec Date: Thu, 3 Nov 2022 10:08:49 +0530 Message-ID: <20221103043852.24718-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: CO1NAM11FT019:EE_|BY5PR12MB4068:EE_ X-MS-Office365-Filtering-Correlation-Id: dafdc173-8727-4487-e8e3-08dabd5559c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HeieWi24wSWr18zRt3Z1hcyyQR1KvP8fIGhX2YodgJU//WbKfdbk9qNnphLZiBtcB8nXuY9/fO/lXHxAZusEh3B8FP3SO75aBb99PFT+WoYKZZxkIfRp2qDH6a9YJyoiZp3s00D0Z/Fttdrn3rvo+i4yTKtTN+rP2shU2UIKv6NvE9AvG+XnPbEb+gmqdaaIUx90V6YHlmIkYdAfKLFIgBf3vVwtEJnW9vDg/tXNaW/EBXTokJpmYOqshgPg4UY5LhXkVL3nnTzouNil331V+ezPyd0DvIfXjIrKLKoeUomwfmQPhEerupi3M3Bo2UaGMCKgPoJcWgd16DOp4OWAyayVuJj2xtETqa0Y771RVXcIquIe4oVkUzC8pRKPDdnRgpVW4wwiCLAOSVqfbN9WwZ/BVluqFLyNRvrbdjAcIdQQlKiHc5IQGrI8FDSqLsDvjYjjazDXYZbGVvmgf5715D1Lc+QRCIodN9Mx73qjreYvrGzromgmv9fMKxgOrXFWWpiZNpsBzswRDHKU88zdp/p1t7J/0iqNfZTQMeNpZXk5MLAJsbiJS0pWTxghRQX4UWoISrGt/BQuI26bl+taoKO635/Hw6gg2FGH3aWpHohGzRegqQjBRoFeao6wWEwPc2Fnw1+CkLfladnBoeQoo98UmUir/6T87rETdgckaRog+E0OxEx/ZVlpTcETtL+hPAvjP03MjpQTfuaSotHqfcTY2+NifQpVIDPAeXhO8I0GH92d0UO8Pnnv+BxxH1oRLbR+gxzwv8BAUMFIyo7XVg== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199015)(36840700001)(40470700004)(46966006)(83380400001)(86362001)(82310400005)(40480700001)(36860700001)(36756003)(107886003)(110136005)(40460700003)(82740400003)(7636003)(316002)(356005)(6666004)(54906003)(2616005)(478600001)(426003)(41300700001)(5660300002)(26005)(8936002)(336012)(7416002)(8676002)(4326008)(186003)(7696005)(1076003)(47076005)(70586007)(70206006)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 04:39:10.1617 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dafdc173-8727-4487-e8e3-08dabd5559c8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4068 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748448447639997713?= X-GMAIL-MSGID: =?utf-8?q?1748448447639997713?= In order to fully make use of the !IOMMU_API stub functions, make the struct iommu_fwspec always available so that users of the stubs can keep using the structure's internals without causing compile failures. Signed-off-by: Thierry Reding Reviewed-by: Ulf Hansson --- include/linux/iommu.h | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index ea30f00dc145..afa829bc4356 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -173,6 +173,25 @@ enum iommu_dev_features { #define IOMMU_PASID_INVALID (-1U) +/** + * struct iommu_fwspec - per-device IOMMU instance data + * @ops: ops for this device's IOMMU + * @iommu_fwnode: firmware handle for this device's IOMMU + * @flags: IOMMU_FWSPEC_* flags + * @num_ids: number of associated device IDs + * @ids: IDs which this device may present to the IOMMU + */ +struct iommu_fwspec { + const struct iommu_ops *ops; + struct fwnode_handle *iommu_fwnode; + u32 flags; + unsigned int num_ids; + u32 ids[]; +}; + +/* ATS is supported */ +#define IOMMU_FWSPEC_PCI_RC_ATS (1 << 0) + #ifdef CONFIG_IOMMU_API /** @@ -600,25 +619,6 @@ extern struct iommu_group *generic_device_group(struct device *dev); /* FSL-MC device grouping function */ struct iommu_group *fsl_mc_device_group(struct device *dev); -/** - * struct iommu_fwspec - per-device IOMMU instance data - * @ops: ops for this device's IOMMU - * @iommu_fwnode: firmware handle for this device's IOMMU - * @flags: IOMMU_FWSPEC_* flags - * @num_ids: number of associated device IDs - * @ids: IDs which this device may present to the IOMMU - */ -struct iommu_fwspec { - const struct iommu_ops *ops; - struct fwnode_handle *iommu_fwnode; - u32 flags; - unsigned int num_ids; - u32 ids[]; -}; - -/* ATS is supported */ -#define IOMMU_FWSPEC_PCI_RC_ATS (1 << 0) - /** * struct iommu_sva - handle to a device-mm bond */ @@ -682,7 +682,6 @@ bool iommu_group_dma_owner_claimed(struct iommu_group *group); struct iommu_ops {}; struct iommu_group {}; -struct iommu_fwspec {}; struct iommu_device {}; struct iommu_fault_param {}; struct iommu_iotlb_gather {}; From patchwork Thu Nov 3 04:38:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 14639 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp315696wru; Wed, 2 Nov 2022 21:40:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7P3exFt1dAp3YYQgdcnEv87w8b4i0v6IYbE87C0r9hyMNmxr+PTIjmqU2pLvHIhMTcUVkw X-Received: by 2002:a17:90a:5a46:b0:213:cf6e:5f67 with SMTP id m6-20020a17090a5a4600b00213cf6e5f67mr22279384pji.93.1667450406188; Wed, 02 Nov 2022 21:40:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667450406; cv=pass; d=google.com; s=arc-20160816; b=tcFC9u4HCSy+IsWkhlTF8LPV29RoBRuT25VUYcnx0UqJZGWNKCJVGs29wU85aMvMp+ CidLEYFTnWLqwt9VExRa8sZeOUMRNehs5PuIh8pkpkoK6d6ImLU/DrVL6D+tmUH8iUz+ qo8z3LBHe9HrG2m1t5NsucBd7kP+eCkiIoCQeG2s4apZehWcFGVbeaX1DYo1VCmI5i4A GQcqxR0bjYqRuXJwsba8l5lT70140rLa6tRw3WvXrAre7lVqfap3LQhB/Z6pfn5vvEFh o4aOnDy6VaMnT3AKbUCsiRbr3kmYpKZbtE/5tfcknMtWJEXwxZADzX+5eH6V9OLuQWpf NHsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ySAXZuQxT+OaejFFBcyvnzs7QYtblFhBELXJC0YqmDY=; b=OIrc0DDmBStK3WEUpEuC4W/ctNhPQH4MHfT9M+lYW/QZaFfNCgIZfGXqPqELNhuLHI T73DHOVzxnivWChEvWcAYFWJbnfbpktJyEB4VB4EJ9ri+lbUe9wYOL8D796E8sJTPDVj soV+2wjyB9Xle8ZuxnheuVAjkXP0G6pwrQn6OqDbjlW44xGJrZgCkclJcfbkIqb/puNK C3RCj6MuK8ZWcccA1boWtGmp4Bt/kjtpK3tYLjPXiERM12os1fzhgYRp4WxITeD+Hom+ 91AOEhMWvUxcsf22f7lRfx7Ry+0OVB5hN4huTdljgNuYxvzj+hTTulWICZLOcziJblj8 AVKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="h/XzTIIi"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a170902e5d000b00186c3af9680si21879646plf.98.2022.11.02.21.39.53; Wed, 02 Nov 2022 21:40:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="h/XzTIIi"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230293AbiKCEjU (ORCPT + 99 others); Thu, 3 Nov 2022 00:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbiKCEjP (ORCPT ); Thu, 3 Nov 2022 00:39:15 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2077.outbound.protection.outlook.com [40.107.94.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 126A4B7F7; Wed, 2 Nov 2022 21:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zd8twesI+cBCyYzCHwVVK71fwBKfMBSkRYj9FGX7ooPbtI+/+5iFeetUtNc5ZeZaSFd1kWAX3vqXA3VAkQ5iUbMM+gZZYhr6TEuUKyI1FB34t6eCv/oKPpniq2rPFATvGYhFAj3gssA8thR67dj8naEySofvX/fVGjvmkGJH0Un9zz62bBuxbUDVn5gBdhLdJeNCdR0US1lzHEEMgURN/HZ/gJ4HAWGfVvYvDgWGOhhJ3r+v2pry63NoD1l0r2kOijzrwhhPF9vTjEN2cEMNJS6KFDI2AOBhmyU73E6nHvqKASj72Tp4MDs/Yb4caGRkr7B/vF3NdklM/KpDLZjsRw== 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=eWqpdjdIwzWrea05w/hy6QgrJnDKDTfaAMnvbWFpHZxuSf3UyVvya8Cf6vCBpH82ZggsrLiAnf+IczHZGgFstHRHOi5DWPT1vp7cPj6ENVU5ADkUvt4iZjYVLhma3da7VA3H4fryk+9n3+IEBGv0J2Lvntgyx3SisF7ZvvEageZF1hynT9126DJGDv5HhBhvHCdIRbl1AZwD7exuN8om1yqL20iqUoOmnrmQT9Kr745EtsKxBbkvWOZpmbFVD8/vDd/ArSvSBpwtyU3Q1KILojF/7GvatO1uK/OgzW7eSgvXGMDb2KVIpr8mLZ5E65gpRHEjWrYk/J7BV7gWfc8LRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=8bytes.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=ySAXZuQxT+OaejFFBcyvnzs7QYtblFhBELXJC0YqmDY=; b=h/XzTIIifMKCxsY7WFBTCCCjGFppBe5QGO3GRD2eUkHwhVfO5xO0fhZ7ZbFlJHMgsNU4CUCwWlT5CQMlWuRO+rReGzplTmAtZ8I/vUj3AXRlwIsZWg70CfWlw0iEyQHi6oYBgcr57RobBTuz0GD9XAJf4vfuNnFzbEKz10HMr+CSuYfBIVZVeglZb2jMzUQYr//yhPJyMDci2IBAiF+sofoLAqMSi9gFCYRRooNPnYTh4GWKxlqMRlhOnOjoIGrIYl0sQGcWLARRBdpgOBPwp8PmwnYvOa7PZ3rsHm/RMplqaBgZeoUNg0g8QxO/XzR49UMX9ITC4IA9yTuiAv58xw== Received: from BN9PR03CA0519.namprd03.prod.outlook.com (2603:10b6:408:131::14) by SN7PR12MB6766.namprd12.prod.outlook.com (2603:10b6:806:26a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.21; Thu, 3 Nov 2022 04:39:13 +0000 Received: from BN8NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::c3) by BN9PR03CA0519.outlook.office365.com (2603:10b6:408:131::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.21 via Frontend Transport; Thu, 3 Nov 2022 04:39:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BN8NAM11FT063.mail.protection.outlook.com (10.13.177.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Thu, 3 Nov 2022 04:39:12 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 2 Nov 2022 21:39:05 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 2 Nov 2022 21:39:05 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Wed, 2 Nov 2022 21:39:00 -0700 From: Prathamesh Shete To: , , , , , , , , CC: , , , , , , Subject: [PATCH v10 2/4] mmc: sdhci-tegra: Separate Tegra194 and Tegra234 SoC data Date: Thu, 3 Nov 2022 10:08:50 +0530 Message-ID: <20221103043852.24718-2-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221103043852.24718-1-pshete@nvidia.com> References: <20221103043852.24718-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT063:EE_|SN7PR12MB6766:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bb1e026-b703-4ce8-c8db-08dabd555b54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kYmjK55TxOWCgPnhIP4XVjquE2W8FLuSzcGccxngxMtnUg6V9oVjvzhbkXKon+C1yq2btOxpsJNeHK5tQUT5ac7B2XnYCgSsnEtX4J8OibtGQNjZrC3uLgLcOIrdKZGpTqIJcvXrare+RY4xfdNOz1lJ3FPLY/SilXsFqQXGI/5Ac7AfClL0ad0d/eFNBvi5vOZmGVU0yG3KEiS3UKq1dYNRZfOEE82kQGRYGXd8EU/Jx5Nexi6ZNlVJkSjlp6GXuUL6pNkfSHe6V+kwYAP6ziolm0ANF/Wg4Y9fRlr1IgxmTGgAACo4XJrRyEIoYgy1mma3USz/w443cWutZEA8EJlm2p8O8nf2STjD7qFPqxgqN5tM8b6zHVezXvN/rsxscS+kB9sp31auccau+UwWO7V5j6YNuXyRPujGsAOLiaF/O8O/q5mGuf7bYbZda1fycLapIsDt3E5MyzhSwjbVtqlqPDAHVL7/Cr8Jc4kaTslNFZU1edrjyF4uMySoKBlpIHMWZNT8m8EhgBuOs1EEsSkjWTp1RNzTBwkNNJ3OB/PakLRtAd/9J2Da+ZXcfNGYDK4b+/v5gme4jxqxIbHrksi2zJ8K55mFf4FAyOTxjl4DX1FbjqZUdDa6GgXuynphSALa7voEG5Bqp/rcPGqLAV6iksrp6mTQDN0UqQT2ailvA9grLwo4sG52qVXaA7LcLqGEMQTq29cGfCpheSji6o2RXdoTQmH+oDnBYBNMqzy33aSr1Q4Ex7f+W1vC0PnlN80i3ePtxY496lFxGb2Ytg== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(396003)(346002)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(47076005)(316002)(2616005)(83380400001)(426003)(186003)(336012)(1076003)(86362001)(8676002)(40480700001)(4326008)(36756003)(82310400005)(356005)(82740400003)(36860700001)(70206006)(7636003)(26005)(8936002)(2906002)(40460700003)(107886003)(6666004)(110136005)(5660300002)(41300700001)(54906003)(7696005)(70586007)(478600001)(7416002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 04:39:12.6468 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bb1e026-b703-4ce8-c8db-08dabd555b54 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6766 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748448477190473358?= X-GMAIL-MSGID: =?utf-8?q?1748448477190473358?= 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 Nov 3 04:38:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 14640 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp315800wru; Wed, 2 Nov 2022 21:40:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75+cICeT3EfeVMaAs8TQc9WiGkmvx7UVQybzB8njX84RxfiJR/A3wqPxffoSOVKvBNUK4m X-Received: by 2002:a63:ff4f:0:b0:439:61d6:197 with SMTP id s15-20020a63ff4f000000b0043961d60197mr24071962pgk.67.1667450424911; Wed, 02 Nov 2022 21:40:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667450424; cv=pass; d=google.com; s=arc-20160816; b=K0ZZM4jXcZWp9GucUHRKpyQfKMNj1gEbtR27s1dbQFdArIjZ1+FPcbo2xh3aByxeSy Be9/P3ATmQfiGmJyC3gxgwL+JkHkh0NSyeBI1wSOBIqGdEAWqgFaFk3MtyZhcRx/ERie 1t3q+NUYZfjRGnPmmep8OM5JCwP8U6E4vdy3TcBKFuX1zi+ELVUxOtigvUKLTWHp4g0Z CW25Nz7qmbjewAtTbHlA22mLMGF8n8IQejWvYsbbxlk1nmqbDQTyReqSjBT1GkWT2TPM hPBygP1oAiYVNOZrMyVuBTVCOnbfy4XJzsFhBYHARpOPZPtDN31DaRjT15xsnHK5l2q5 lW8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=b/XpF/6nLbeyAOMH+4J1F6F02x2732Gn1BUA6g00/JQ=; b=B5GP+VO5gxKW4qirkn1/6p37IdjGzcynY86ddB8t5weXGfshCvu6VbY6yuBoF5KmoX I7sIGWMq5YFshikVmugG/WPZEeKARU/tjb+aumwLFpMCFtv9jsVXhOIi+ZYxkoj4z4hq yxpSlW87fvSC+UjMDvLlgcfC+yeBfeGzzPxFHDgfrZK8Xi5CMScTYeRsMHkSfHJv91tR DYYN/seTN9erFJFL62wtlWIXFU8ySuN15L9hkrB6196wAedIMrG1zxdPKjwy5g1OMkrg 7wNLpJks+Zcs4xedYbNDIpfZKmOZW+HM/vw0GU1nxTgVAZdK6SHvfLOdMYZ0A1Ag5WyX +f/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=hUVDnx1h; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020aa79d03000000b0056c747dac83si16721796pfp.62.2022.11.02.21.40.12; Wed, 02 Nov 2022 21:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=hUVDnx1h; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230294AbiKCEjj (ORCPT + 99 others); Thu, 3 Nov 2022 00:39:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbiKCEjd (ORCPT ); Thu, 3 Nov 2022 00:39:33 -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 0B58017E01; Wed, 2 Nov 2022 21:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oEG0UPCxIU/yTF5fTW9Jcaw3Bhu1ukfz3Hxte4+UPl2QVSDdAWWH+UrsviaVx3UIrZZbHfv2QcFHLca7CzUC4IhHv3ncX0p+g+aZo9PV5vZQ8WYYYqqb2AtV1rC58J709o/MlfyE6Ki7mLQpnyqEmM04L+IZRlbM8SqoAXviZnUbsFglqg+FKcuDlTNWKCWdGHGFeqcz5PncwwJTa2Ua5fNLpmrmvVCza/DAu4+YfUcyHC5WgoFn5lEMU1tKMOabU7bky1ta6Q9niAhTx9vFoFHynDXeBDv0hJb0EDfR+rml63IeLhm/zsLCzK9fRptozjDY2booDXMOg915KBADxQ== 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=b/XpF/6nLbeyAOMH+4J1F6F02x2732Gn1BUA6g00/JQ=; b=MBFpkzkrDaRps7cXlGYmnKpdbcNnOOq2QB4sdEeLZevoamX0klu0U+mXHoZXH2TfZeV2Qfq60XsHVAlCi6q1vGZdWOganuJDhtP9xQfIiLJmusawLZuOLLATiId6OkGvju5uBapXkhHMwbS4UjHnoCXutwMf1LKCfwZbJvHwP3JPlkFpBFtEprvxK4YSLI58HYPSfTt5LRbLjjYX85R0C5Lc0z4SsrjM6XVhtubfuT4PTIfNs/JM76d58Um95/ipPv5Plh9jftrCYKXYqlYPu04oNtXyGBBTX+nDaG0uNw+Hk3yzPzJKNpr/rUH7QFEaEUxzIh6ZjMG73DrIZBCoKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=8bytes.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=b/XpF/6nLbeyAOMH+4J1F6F02x2732Gn1BUA6g00/JQ=; b=hUVDnx1hKKZNoaiPb1ow6jgLliPQ4QhV1t6JK7QKP1jrkzO9hCQao1D1GYSYpZouDXa+R0fq/5TdBz+V+Pc7JQ9dz8m1OXqRJFuzpPFFeU1BEOOfwcCF44eGBN9gMrPUO6YIvCqyF53G4qXoSNSYl2V+lfDmbYLkR+yj0YNeg5mvVsdeSgxPKpRXKswV9I2NUtfJH2pyvKwK9RGONI4qHmyP1Id6crccMAhjfKZ+b+Y9GB/cWLsQcERG8TtJtrOOcth3+lNUHFONJXusOlNyqOCPsUCmlVtBQXjtasHwQsJ6cyzR/fJq7ocEXY5QqQ4OaRf9/PyN4A+Pza4BNNOGbA== Received: from MW4P221CA0026.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::31) by PH7PR12MB5733.namprd12.prod.outlook.com (2603:10b6:510:1e0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.16; Thu, 3 Nov 2022 04:39:24 +0000 Received: from CO1NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8b:cafe::2f) by MW4P221CA0026.outlook.office365.com (2603:10b6:303:8b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Thu, 3 Nov 2022 04:39:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1NAM11FT032.mail.protection.outlook.com (10.13.174.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Thu, 3 Nov 2022 04:39:23 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 2 Nov 2022 21:39:13 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 2 Nov 2022 21:39:13 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Wed, 2 Nov 2022 21:39:08 -0700 From: Prathamesh Shete To: , , , , , , , , CC: , , , , , , Subject: [PATCH v10 3/4] mmc: sdhci-tegra: Add support to program MC stream ID Date: Thu, 3 Nov 2022 10:08:51 +0530 Message-ID: <20221103043852.24718-3-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221103043852.24718-1-pshete@nvidia.com> References: <20221103043852.24718-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT032:EE_|PH7PR12MB5733:EE_ X-MS-Office365-Filtering-Correlation-Id: 22699bfd-5f53-406d-4c09-08dabd5561f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1Z31zPf4SGEDv6CX+0vcdymv5ajsD1vq9av3BObP5/AzUyu+6L4Daw28zqrtBRQwu1+eG8ijXYVkPpSWWUHVM6VAAChMXtVkGOKY4z1195Wa6vLnu9JhZGD5celr8ji5wEFxjTA4BQY4AzCTEfTbDYJy2F/KQPEyixTb7nOKa8+4DdoYm6V9ir71HEh41nYPrMmoXKItRtTs2/RnzGVEn1Bom19Yc8uul0NErbmwKEsugloir1hWlNWMGTNg0aqg2fVD30DtXbi6wlbLlL0Dq5gaizUSY/3km+Y8FRHiTqAYG08gRANqsC0rMCZPW534x+Wm17rK1FQPKl2kfZFoFh+YjnW8qknzOc2Uj4F2sLiY6FuWDYHSp3ursG+Jfy/NT3Bprf2asBAqxmlfPsGATNUykHy/aLXtM2NEOkfJd1DNzAJAMa7qz6zSmSVyJajcoAfMK3tzQ2kyKN1hMn9nJ34AYinaZS9QCj/GHdmeenQvodRziYqtLxbnw+D8WCLHj7Z5vmCB77BDniE6mkSrNwrpOlNHczuleCymTNaz/A1Yp4K0aOwi6ffyFPG0wrTU2l+khfMu/agEt5ur5Q/eF3S+45UUPhFISFUY4LUpIjM98vti0ubmURZd10e1y5FIBvJSJg7vtSmUTh0425TOgMj7NLa3+dLu09I+GQax3lUfl2N2x1G4gTCxdgLDaPUeXXyiTN4XV359n3VlGDL+VAkpWMUrSPY756bKQbsIgCa1JcrYcFB242yJNQDCSwLHfVx3JPi906zJFNV8rVMGtA== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(40480700001)(36860700001)(82740400003)(6666004)(83380400001)(54906003)(4326008)(70206006)(426003)(82310400005)(8676002)(36756003)(2616005)(70586007)(316002)(110136005)(86362001)(47076005)(7636003)(2906002)(7696005)(26005)(8936002)(1076003)(41300700001)(186003)(478600001)(336012)(5660300002)(7416002)(356005)(107886003)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 04:39:23.8548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22699bfd-5f53-406d-4c09-08dabd5561f2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5733 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748448497064000443?= X-GMAIL-MSGID: =?utf-8?q?1748448497064000443?= 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 | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index a6c5bbae77b4..e44060cceb68 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include @@ -94,6 +96,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 +125,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 +182,7 @@ struct sdhci_tegra { bool enable_hwcq; unsigned long curr_clk_rate; u8 tuned_tap_delay; + u32 streamid; }; static u16 tegra_sdhci_readw(struct sdhci_host *host, int reg) @@ -1564,6 +1570,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, @@ -1630,6 +1637,29 @@ static int sdhci_tegra_add_host(struct sdhci_host *host) return ret; } +/* Program MC streamID for DMA transfers */ +static void program_stream_id(struct device *dev) +{ + struct sdhci_host *host = dev_get_drvdata(dev); + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host); + struct iommu_fwspec *fwspec; + + if (tegra_host->soc_data->nvquirks & NVQUIRK_PROGRAM_STREAMID) { + fwspec = dev_iommu_fwspec_get(dev); + if (!fwspec) { + 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); + } + } +} + static int sdhci_tegra_probe(struct platform_device *pdev) { const struct sdhci_tegra_soc_data *soc_data; @@ -1775,6 +1805,8 @@ static int sdhci_tegra_probe(struct platform_device *pdev) if (rc) goto err_add_host; + program_stream_id(&pdev->dev); + return 0; err_add_host: @@ -1871,6 +1903,8 @@ static int sdhci_tegra_resume(struct device *dev) if (ret) return ret; + program_stream_id(dev); + ret = sdhci_resume_host(host); if (ret) goto disable_clk; From patchwork Thu Nov 3 04:38:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 14642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp321039wru; Wed, 2 Nov 2022 21:57:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7p/NAVh0MYP676beiwx3zgzV+3rnJ2XqB1oFChH5+Q2+7nWveaROJ+iMbSWWvETyC1R5ug X-Received: by 2002:a65:6bc4:0:b0:439:8ff8:e2e1 with SMTP id e4-20020a656bc4000000b004398ff8e2e1mr24606799pgw.91.1667451453735; Wed, 02 Nov 2022 21:57:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667451453; cv=pass; d=google.com; s=arc-20160816; b=KKUzevx0LJUz/sDkXAysNUBdtZfPw2PSIeDjGbQuZxIH5Kwh86uu+s0wNrrI08syNm KB8Ucj2YP/ZFsDadvKoDJdMcUguiqEYV1wiNdU8fPDh7POrITlH33NpPZLY+IxmKrhRw VV5eTGMAbC2LlQx4k0y2VGSMpH/2vmqXosoS8Jooiy1pS9ZoCLDIWecCoS2WXz9C4Mct 4RhXhnEwukvGWDzbdqm3X6e4ZZLzXX8+TErTnRyYkydf5MjLGsuIBzsYUBLGc5KeWimN p8+aga5sGtTa/i4PG13G0N+UqRwkNG+JVqn7h671chmf7EmBWEijbomZHBT+jsnrvW0F 0Fxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=F4RZIQ1Di7dneZqytQHdUTk6Ta6ap9bGCfe5EgqxPxI=; b=nHg+PaFuc6/7NKuPbWcxIoFPpCih7hlODJb6JoKfR1+YnCzaO/LG6fREy7EIJ/M3nU +JmuRt6zvLTSQRsa452JVF4T/l+Aw9eCM/D/Hmdq8++lvx6oNFzk146s/7EuimzsTQ6K bppxyIC2uTcdWmcgLKzZQ6FIeDljpUubrk35IzeE69KBf9mq65tIHRqFlnJndVH5QtIC lciOC4MRfX3/lhAmhWWEg5JdfIlgdNe5yAf/a3u6S55Fsc12gJzFOxZeejLpieHcvv/u z6xwPl/HCuwo5b1oTFKDOxwBgiLvUPOtuiNb/fPQWxuKK+9TtlOMeaoFJ4dNPAhdIBPY vqMQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=hukOlJnc; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j185-20020a638bc2000000b0046f42e65a9dsi18227616pge.10.2022.11.02.21.57.20; Wed, 02 Nov 2022 21:57:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=hukOlJnc; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230389AbiKCEjx (ORCPT + 99 others); Thu, 3 Nov 2022 00:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbiKCEjn (ORCPT ); Thu, 3 Nov 2022 00:39:43 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2058.outbound.protection.outlook.com [40.107.237.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8E8017435; Wed, 2 Nov 2022 21:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aq+s+WYgXuWGQ8eAxQQubO+o3k/lUrRz3a1yBLsMehhHJkihXwyLX+8qw7uiLDjph7oTtZLYmnUQ6/bT+pGi9MnSOcjzIHvar8PB5YuAv8w+xGJu2XvVG8R2koD65ReoOJi9F5is/O1jsV0X2ZGrWAc84iF1XF10OjQtnzsHR6o555HqO6bduneRgmzSbESC0QPqES3SCXqjI72WjSwMbnQjHl9lc2BKXy2fFhDTm2MIrYtTnHD5fktJ09EpWx3FDmGoWHPzgKlridevFCFsGQSEdSfJjlWQoWs/HMTl6R4S3KQy0X6nJhP3uNmFzqBpcxqTf8BwJdhh27QSwt0r1w== 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=F4RZIQ1Di7dneZqytQHdUTk6Ta6ap9bGCfe5EgqxPxI=; b=hIfYHrnjmF+aAWU9688tYHlFqHqJwy1B0iZg1Y60im/Z2C/lU0ipBLTJisvcGIMHi5c7mjG8hw9qYY5JrSZGYchh9ADspHNWQJ8O3IJSSJ2PlHGQuf4Ug0H0FMLkcz+rXaSL0QYzicXZX5/fhbDq7WINf63Z2wUQlgFPslRbWs8BVxL0cCQagSJ1iLeQu3KtJTLXN+JlGhdxGaTxrp4wiaDs9V2dGr8e7xfbal78sb75X+Z/NjZGYoRV4ukiWGAHeA78q1f39lPHlkp9PPr8Hw4DHunvd2xoSuBylOULdFRM3KyXJiJnep23jY0eOoYxjqLAbEFla6X3DX9nzylaVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=8bytes.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=F4RZIQ1Di7dneZqytQHdUTk6Ta6ap9bGCfe5EgqxPxI=; b=hukOlJncMJL0LYaSmZVTQz5sjq2Egwpq1/3hGPStbCHcYu+NMeTGx4So8rZFjjlWqGYrU4OcRzvTML3BEvDydc0FZc7PZ8Ah2RW0jxmTBN/eWHRe33L0gxJm/KR4nfvQhxbg/70qsF1VSv7GW2bWpzFc7+/rNUlTLhpa58AbPIfQYX4SFbC6WEn6xpkSMSmnsi4FsxOaa5vjroWXJbLhW4yKPgXlAqUmxuE7fcjJ5BSjaCD+mLBqVDe7+Qr3mMRqcpnLTq3k3LW6Cq3eaSc7B1u+56cV3HcweJFCN4OwlRarhUqcMj2PA5j97MmKpsxeca0T1vSPKMHsCMvIHHOr6Q== Received: from BN9PR03CA0395.namprd03.prod.outlook.com (2603:10b6:408:111::10) by BL1PR12MB5970.namprd12.prod.outlook.com (2603:10b6:208:399::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 04:39:37 +0000 Received: from BN8NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:408:111:cafe::24) by BN9PR03CA0395.outlook.office365.com (2603:10b6:408:111::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22 via Frontend Transport; Thu, 3 Nov 2022 04:39:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BN8NAM11FT057.mail.protection.outlook.com (10.13.177.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Thu, 3 Nov 2022 04:39:36 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 2 Nov 2022 21:39:23 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 2 Nov 2022 21:39:19 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Wed, 2 Nov 2022 21:39:14 -0700 From: Prathamesh Shete To: , , , , , , , , CC: , , , , , , Subject: [PATCH v10 4/4] mmc: sdhci-tegra: Issue CMD and DAT resets together Date: Thu, 3 Nov 2022 10:08:52 +0530 Message-ID: <20221103043852.24718-4-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221103043852.24718-1-pshete@nvidia.com> References: <20221103043852.24718-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT057:EE_|BL1PR12MB5970:EE_ X-MS-Office365-Filtering-Correlation-Id: 145f2f1d-eb54-46f6-7234-08dabd5569a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L0JnOLDUlALpyaJKgaBReVaQ1VHMFEy5WvspdC+OUVKkD6xU3RfgFT7fs6rCSbIRvl0ZcVZyVnoMnF7UI3tZEoLzKbcDDxlhDA7ZMxh73Plsg50jfuZ+6v4x0Y4mLeJzUZug4fk2EDtGQI0yTCbS70vDRVv/nB3FOUb2o3xFYcVOO10klmen0CMnOZAfr3/6NPrZP3Eu4awZxscXHd8/BU5sAPoCHvqrraPe9tArVIFer/rKMAWhaVxRN+taeMTybSlkH92xtnnHKy1fhY7e6fsP1bg+vJXRyygoAnXTLEMDcgKKYF1JMEXAKkB/nUVwlF+zyYHBP/JhkVOOe2t2bxm8e0noD4sKnvV8pW0X0qjqKzJlP+iCXz5B766r37kFl4W9CtE0w3FZuBWako5yLtI+Pr1ixiIb1gE5CL60mN4D6vq1rVrQ89jRARuajAkO/f/OgRy0uaW2pv0A0xEbsZlOaJTu38rYYEU1LWiyT3epDO9sjfqYXGaBkE4vkkBMB0iSh/d4VyX2Yd+zBA/msH5lflqcwlFoJs+qsQ1hSq9erW9hfzssu5SP+iC7YB8EAa4EcpsyEK5FvysbF3ZKoWkJn3alDTgoS93yekzafA/TKDDIE50YGOv92GTu5A8QD6kVrj9GtSgn/dYlCGyrPztMWHez0OLeLaBWmYTJQLH6avW/zZQ6g6r8DDP3zDlnvYcpflUR+D+bQBBlcN3YP7cJiaPPfo6T7FGYGiIUdS32VoaM2ac/dLrN9gGjlE/qcDqJDFVFKQmYCoblRjUPkQ== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(26005)(186003)(86362001)(4326008)(70206006)(316002)(8676002)(82310400005)(8936002)(70586007)(478600001)(41300700001)(110136005)(54906003)(40480700001)(7636003)(356005)(6666004)(36860700001)(82740400003)(7696005)(83380400001)(40460700003)(107886003)(2616005)(426003)(47076005)(336012)(2906002)(1076003)(36756003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 04:39:36.6726 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 145f2f1d-eb54-46f6-7234-08dabd5569a4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5970 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748449575287362948?= X-GMAIL-MSGID: =?utf-8?q?1748449575287362948?= 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 e44060cceb68..7cb3bf34a176 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -1531,7 +1531,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 */