From patchwork Fri Oct 28 13:02:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 619756 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 E46BEFA3741 for ; Fri, 28 Oct 2022 13:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230176AbiJ1NDB (ORCPT ); Fri, 28 Oct 2022 09:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbiJ1NDA (ORCPT ); Fri, 28 Oct 2022 09:03:00 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2063.outbound.protection.outlook.com [40.107.100.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD7471C2F2D; Fri, 28 Oct 2022 06:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ejNoGiaggHJC3wrxWJid7PeynIYvcRwe1jFVJujOjmlLjgDjUA8mcK2/7m4L/1XVpiYjG7DRrn1qww8PPORtkayN5zxeE/vQKnE9IwPdOMdDSM7TcJxfRwTV7UMuBCnzFcLWXdwznY/qRfGFbhg7wIcpFP9RJf3BUQ1sFQM6Z+dM6JFGbrplZIHHhDz07SuF6PSNEvhT9maVyZX0qohMCnwcdupm9ArAy+YxlVelbBRgUtB6lyR2YjfhF03vzscIDsi7IsEbvWC7hLgipoOYMX806SrORGF64uZ90g7grThCtYMH/5XLUmlXOAQr6AAPX5izKqcsGdCRAxIsASBPpA== 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=FX9a5NQCui3EmelUBuL6tUUBvUkS2Lt4E9Z9Ko17AUg=; b=JY1KAkQ1M3g+JM47cOBGGRBk/bdeaujYe+ggLbuBxy6yP32Xiq8OUuR1S41GcqhMhk+gB7ZAcP2PYkVTIuoYH3NYdkJktrDxGGwxiIBYoYgeenQwtXGCFmvT+8O2bCRaPVohoCBkdtzLkEJskVB0i87mCKiJEoGSP4IqZGi/c3HRdarPO2YINWrC1apH/WAerqRoWBp2/pVcKTzoE34+fUt43qXFJXAg+pwoDTgdlq7g5pUIMP/z2GT5UAPKnQjca3B+g/d5g++/7jyJcLJgKwL48Xlo4BA+7OXyIHw1XCQYYOvMCG8kbbZvAft8AVk/R04PVkQfuloxUziv4ogweA== 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=FX9a5NQCui3EmelUBuL6tUUBvUkS2Lt4E9Z9Ko17AUg=; b=M/TMGju8bwOVv1yETMQBp+gj7DFTujGCG8kmv+2qpYDqwLpKOLPcRHnpdrQL3RZ3G0r59xv9AzMj1Efg0LtyJt12e2XIOwWEu3//gZ1Es0RomqDgbcRuvjanmRBbbC1TMnXqxi8NUayBLJSZiHPk1KtTZbH8eWiguTwuhBJPaJV+j8No36610vBRlFMAN7ilt2uyXZu7xr6/RcV1MVMVS6AjlmTtXVXtflY9zoz4VwECt23hzudV0KKMFSUAs6qa8xsMYhxlZnV8gUMl+KIasuMwzSOI3zZaJYdDXTtzPozHCN0H04CCYG5WZE+Yu4PLztCXgY00bvvxBaneoBuy8g== Received: from MW4PR03CA0155.namprd03.prod.outlook.com (2603:10b6:303:8d::10) by CY8PR12MB7539.namprd12.prod.outlook.com (2603:10b6:930:96::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Fri, 28 Oct 2022 13:02:57 +0000 Received: from CO1NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8d:cafe::9f) by MW4PR03CA0155.outlook.office365.com (2603:10b6:303:8d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15 via Frontend Transport; Fri, 28 Oct 2022 13:02:57 +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 CO1NAM11FT026.mail.protection.outlook.com (10.13.175.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Fri, 28 Oct 2022 13:02:56 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Fri, 28 Oct 2022 06:02:49 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Fri, 28 Oct 2022 06:02:49 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Fri, 28 Oct 2022 06:02:44 -0700 From: Prathamesh Shete To: , , , , , , , , CC: , , , , , , , Thierry Reding Subject: [PATCH v9 1/4] iommu: Add dummy dev_iommu_fwspec_get() helper Date: Fri, 28 Oct 2022 18:32:39 +0530 Message-ID: <20221028130242.20900-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: CO1NAM11FT026:EE_|CY8PR12MB7539:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c22eb2c-d718-4d6e-479d-08dab8e4bbbd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OQ9sa2FpsWMkfk9q+oxO6AIeVEmpv69PK+prSUKKx7CBtCDL8NDz7AmaVMoShicmrJEJyYS4ZXKWVjxSKnP/qI8CgTy54aIJ5X1f/YVtEr75vMKvhtfHavAe1IRe38VMITVA+qauCK2ZHHXXPvSgENuRhcbqk9DQB4j6ABXMF1URDswnUGycYabdHsqzyDoM9Wtfzx2dgssOuiiWDgFmoD2vae2mYHnZl7nP5+0/lJL662S1K09hpR/FAVRvDd8PEeWknfNXbZ4ZAUTKuH9gBNXbhkZtlkxfKnqb4e3svC50WdlHzs7+6o2N/4ZEHSE9JEeZQ3oLc/MsRXM1VkgeOpjA1vOSA2iN+6ZY8vf/H51kKin9uDtV4OWLtq0iGkiKU72mwY7RlmWtbHVNUiKXKWiDwE2Ghgads9c+0W5/X8IY9Ba3k+bzMU/20oxTCTZyxl6NgY0VJ2zJP9+2EdsnBDWrdWksH908NXr54EdHlvoA0vExd1hiLBBQ6wxGyWdoQhkGgUimY0RZt/kTgJ3yf6RHED9DJXJoW70Xd0sWUkUBj3DLpdFtlE3IF2tpLYhh1PhBuvxGkJphC+tr0d6IVHm9T0i7NCQZ8S62zKJD9wswI9CyjnYhyOOy51kdqNBj3NoR0tQWgKaIOdtjKYaJcblWCuVAOFfCE+/dgX0GSByMuXipL48U8drMKd371jhA2NMbDK33h4Yu0pb3D7iHmDDPk3rOFCuhkYSsJGBAmh93VGPJKgHiwI92zB3+5cd4faCLISjEtAURZ3EyZc+dxg== 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)(39860400002)(136003)(376002)(346002)(396003)(451199015)(40470700004)(36840700001)(46966006)(82310400005)(1076003)(54906003)(83380400001)(426003)(110136005)(8936002)(316002)(7696005)(478600001)(7636003)(356005)(86362001)(47076005)(36756003)(26005)(40480700001)(107886003)(82740400003)(70206006)(41300700001)(6666004)(40460700003)(5660300002)(4326008)(336012)(2906002)(70586007)(36860700001)(186003)(8676002)(7416002)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 13:02:56.7207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c22eb2c-d718-4d6e-479d-08dab8e4bbbd 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: CO1NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7539 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org This dummy implementation is useful to avoid a dependency on the IOMMU_API Kconfig symbol in drivers that can optionally use the IOMMU API. In order to fully use this, also move the struct iommu_fwspec definition out of the IOMMU_API protected region. 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 Fri Oct 28 13:02:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 620176 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 06903FA3741 for ; Fri, 28 Oct 2022 13:03:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230222AbiJ1NDL (ORCPT ); Fri, 28 Oct 2022 09:03:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbiJ1NDH (ORCPT ); Fri, 28 Oct 2022 09:03:07 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2053.outbound.protection.outlook.com [40.107.92.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 274191CD6BA; Fri, 28 Oct 2022 06:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CuWvNak7KHI5a819+uAdreNt5nNEOuFK/H8s7xfmmSkCW+8j6YxUIbyviTOrD+/x68fuBnimHqoCQnUcGpxhzy36ZNfPpoxDdR3oqmdnQbIzrcCYud8k5bYuYGKoho8vRrIVhR49VaF+9xgfbSSScx2RC7L2MkMqFA/bJBMKDmmCFqoLl7cyxLhfh29WYtSxsvaabTTg3nPC4Epal+mFMCG4CZYOZE51s1M/H/TllC9Wa4sMLyZavHT8bXE7Z6QtMiQV8+NUEvaEL6POpQHr2I9p9MWBtX1I0807J20/PuTXhN190MdNvXFQ3R2lvAlWp8MAcTjIBrzj+LZiR8UzEg== 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=NSbrVZSqA3ByIYOT+z31BHHuRSrt1FX3fTbwfe9GR5u6Ks6XiMvKmyB8hpe+OMNEOzDH59xFMsYuXdsouAOVHvfUCGKpxbnmCFN08BzAAOUU/h62LIkkHWDIhuMXnEEVqZexmpmeZ6RUCEfEMWscAZpvLjG/Aej4TycsmAWUzWABjABenX6kGIFcLeCcud7NqBmsVf7QbJLWG631aqfd3gj9jTrN+vDIlq8QGdWRFNEAdhbgQgHamJSz/2OJXiRjAzq0dtcSCktT6xmHMNZMKRi4vU+KlhN3C2BmAwVFABsLv6BDnh4mSAcRGmSF/y10GHlR0SP48+PAdkPJBWhzaQ== 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=XU/+6A13UlYl7XVLtqNQ5B4J2MKbz/jRPGrs7k8b/6JHwpbUQy+tVY2Hgto65EENL6pouHjuM8R5vGrGQ7ZnHylDJL9kE9Dl4QgpET1ixdGXdz++3t1uIuCxSgjC6rzWyzD1J2rEFL3DVN0BaxgBBt1xzP5FMzKvOkPI90wPVvaMHLDT0QM+wOV4OjW/Mb1nir60SRmXEGqp5nt7s/SUyBkTZ98CizzjLVAvq/w3/BnFgEfHuzcjS+T4iciTZGTGPVFbbuq5r9TMe8rnPnIM1SE5IeIvIBZY2w1qGFpiruYR61qDXiTIc1ocwfGJZRNQMmFOd2bjhK8HqFla1epWqQ== Received: from DM6PR02CA0087.namprd02.prod.outlook.com (2603:10b6:5:1f4::28) 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.5723.33; Fri, 28 Oct 2022 13:03:04 +0000 Received: from DM6NAM11FT074.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1f4:cafe::96) by DM6PR02CA0087.outlook.office365.com (2603:10b6:5:1f4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Fri, 28 Oct 2022 13:03:04 +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 DM6NAM11FT074.mail.protection.outlook.com (10.13.173.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Fri, 28 Oct 2022 13:03:04 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) 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; Fri, 28 Oct 2022 06:02:55 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Fri, 28 Oct 2022 06:02:54 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Fri, 28 Oct 2022 06:02:50 -0700 From: Prathamesh Shete To: , , , , , , , , CC: , , , , , , Subject: [PATCH v9 2/4] mmc: sdhci-tegra: Separate Tegra194 and Tegra234 SoC data Date: Fri, 28 Oct 2022 18:32:40 +0530 Message-ID: <20221028130242.20900-2-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221028130242.20900-1-pshete@nvidia.com> References: <20221028130242.20900-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT074:EE_|PH7PR12MB5733:EE_ X-MS-Office365-Filtering-Correlation-Id: ee66c6cd-d88e-4f60-3b64-08dab8e4c07f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DSg27F8FQmUT9tQK8pdqoMZ40bWbMALMBAURW03opyjYOobt5Ww02unMIQSTlLiYYSz95qq8JeMM1orqTCwc/6pjfhx159Zt5tKkNbBhTCTs2yaEHtf9YDfIf+gA+UQd6e4eXqLGLcUJ3Y9qMhp01oT2YfPE1tptexxomrN+OFuBgD6dFDwxZjNnWNF9TczpgjE0+J+m/hjHhsA/CWumX+GqUO8Hiah0kkxfJ0P5RrK3/QnBtwDdNzOduNhcxjviTvmm6Nk8W5ElVmMrqy1snHv8m/guiZpnbOVtrnPjwMwaMgc06Zt8vcRNsytX5EDfixa6Q01j6oBRSYzBKZm2cOTVS9RRCPoYUMjdXtghuJz7GLM0eEzADXKa6tWZ8H6mUiQ6Ztg2Z5a2QCKIwOjc+LCJxgOxd8FmZaxb1qhRjL6sxKRBmO93YrzP3FN7kFD9T77yQmEgz2qGWFoSL3+i7bF9C5MWFS0cS9LZqUt42vuPF5cgfgJx8TEN20797wH1c1KW31+v4A/5CCdZl/6w0jkk0OWOG8iCToOOwBODZH0bu3kzxMVGCFvOqhApf3A3IpRevvAFywYGWyK5+xjMedwvd6fmnxRVufWgmrop6PTzuNfknbnfN4jq138ANkuiMp2lzfrI1BB0Xw6b5JrMdrPQnGpOlXZrEicAlpG03ZPGWRISAnQlZecf1mpwSJqdCr6mCPd3Ow3YMG0eaj6PxnLAN6WOK1hHoRpvlVr/IPtk+Qekp222QQCMxUX2fxyuB/2KXCjQeSlI96cDGECG9g== 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)(39860400002)(396003)(376002)(136003)(346002)(451199015)(36840700001)(40470700004)(46966006)(7416002)(40460700003)(70206006)(86362001)(5660300002)(70586007)(4326008)(8676002)(7696005)(107886003)(26005)(6666004)(2906002)(36756003)(8936002)(41300700001)(426003)(36860700001)(110136005)(356005)(7636003)(316002)(54906003)(47076005)(82310400005)(82740400003)(336012)(83380400001)(2616005)(186003)(1076003)(40480700001)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 13:03:04.6402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee66c6cd-d88e-4f60-3b64-08dab8e4c07f 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: DM6NAM11FT074.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5733 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 Fri Oct 28 13:02:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 619755 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 05E61ECAAA1 for ; Fri, 28 Oct 2022 13:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbiJ1NDO (ORCPT ); Fri, 28 Oct 2022 09:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbiJ1NDL (ORCPT ); Fri, 28 Oct 2022 09:03:11 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2077.outbound.protection.outlook.com [40.107.243.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2D751757A6; Fri, 28 Oct 2022 06:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EpW38cympu6bTq5myi5gtwX83Saz1ABWToQcHuNOGXPazXSK0ch4v3PIiUIwLDX0Hc03s4LUUj4YBUGHJNHLYyUB/vMYASX05TgjR4XIfyMCihDRRcfM5R93vPKQ6FVnn9xOz6371NaR1GDS9wVobuhUfxrp2hf9EHgWErkQK9QQX3BI9aoSQsKxbcVtRrUsSpOM+1NHqDLD3b0pJ6p+VQqXjOdoHuQ92vS1hvLVT1DXZ9nqFOTVMr1182u7UoD3CpyKZRRLjl33j8wwAXIPtq8CJGjzJQPx9KEck3vM8qjYzy+CYFvUfWGUiosBwVcXHxAIFadjt6DPbu0pfS8L5A== 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=PaLm1Y092EWj0NEXv61SQcUzVeNTqvlOAY1KXknF2nYeJkhfbG0p2z5v68awQ/5eKMo0lRjmAnf2BkjacYFGcBIwM/bpxQdN3TC5/Ab8I5v9NnnEArpP6FZgoLw0GHgxuyVuooDUHgeg4rFwQQLU4OjV8xcdbwZpzgiXJahmTOQXPUC/jUrO21fdu0xwBIgNkzvqrz566rVQpJXFKHapaY04szN9W5n9OF6QCTTWtpIFH315xslS2PnLujfz3eGEIUPClIuOWBqMzbxVqlP2DD4sbXHD+bJWRrbKC7NecCuBbP/QtQREqZjFlQ0Lzhl+gd0T8ZFqP1A56AFulpVdOQ== 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=b/XpF/6nLbeyAOMH+4J1F6F02x2732Gn1BUA6g00/JQ=; b=rHliPcs0GwfsVQWHnAk/UuTKTmF+/lMPPAyuUC6A36OBzKqAcPTaNaKD1iLiBTvEj6LZdDffBn78Mc5XXMsEaR2PHAet1Y351M8y+riWVSB+MIxUEl83jqDPwgn9wxo3l5KPh75d5qSku1r4G1B/KKr3WtXBfktQsBC2jG/YtvrEzFdoSyLScA1dyFvUAS0z351xdU8KzJns0NwNdxsOvtoP41xRBt/pN4Y/Apbj4HzbJagGMphsJT79vMS1LyTspAcT3fAOPMT1AVeIJhLb8vJNtoMmqAlHto3qCJd6SLC1G225ZYtiQ7aPs+wsqpujpLNFp8yLWZC0IxCfrg+pow== Received: from DM6PR02CA0091.namprd02.prod.outlook.com (2603:10b6:5:1f4::32) by DM6PR12MB4401.namprd12.prod.outlook.com (2603:10b6:5:2a9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14; Fri, 28 Oct 2022 13:03:08 +0000 Received: from DM6NAM11FT074.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1f4:cafe::17) by DM6PR02CA0091.outlook.office365.com (2603:10b6:5:1f4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15 via Frontend Transport; Fri, 28 Oct 2022 13:03:08 +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 DM6NAM11FT074.mail.protection.outlook.com (10.13.173.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Fri, 28 Oct 2022 13:03:08 +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; Fri, 28 Oct 2022 06:03:01 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) 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; Fri, 28 Oct 2022 06:03:00 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Fri, 28 Oct 2022 06:02:56 -0700 From: Prathamesh Shete To: , , , , , , , , CC: , , , , , , Subject: [PATCH v9 3/4] mmc: sdhci-tegra: Add support to program MC stream ID Date: Fri, 28 Oct 2022 18:32:41 +0530 Message-ID: <20221028130242.20900-3-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221028130242.20900-1-pshete@nvidia.com> References: <20221028130242.20900-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT074:EE_|DM6PR12MB4401:EE_ X-MS-Office365-Filtering-Correlation-Id: e76e6100-9a7c-4fe0-51e1-08dab8e4c2a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fy2cBmYw+7jdoNdz9u8vf0yt0Krxrv4h6yL9LpPzY6E4LmEM8opIRG/6CcokAFQKKt9ewXedSZSGsAZCHUaWTOVnN9UmM44Wl/O/o4HvIVggPQWzNWvwIITQ1dCUhK0y5HRL6rsj7s3TlOBjmJiVQooa/xDiPDRVnPRH+vD8XdZW3cTK3YnI2KZXdRgD1CYSkr5gyeNC2/GYfah4g1ixzJi3mUwFaNS5ai4PGwFk3FwpEwJhj+WVdzCCvddHVaoFcG7FVfzlv9Y7sCcf7ryFu5xnPShrPfWmnAsY6v8vpxovz9ns53VyT6hcIggoNyD0KdAe1AnTAh2/aaQ9+Uk9WaHyQbFWUZBzeCvyFBx0BE9DVrD6ZoLR88zbYPzCbTzZDlRjdF1hJI5EVYjtycPHWsrkGkox95eI+o6f6DaKjqm+ACtSI3WtfIvO8V7AnFuDK/wpiWhOo74P3Lz8+4th56wSPUxkXG0/px9SpQGwTAX/IJO18s6ao/s0I8yFF+mKecx75qOo5PaV+4Kk8jTgy39qghMQgkrnnnbgZqbp8KNm006F4GSNzy00zYPIHtkIC0t9gsQhUisChueuvnW1eyopG4evWKCQ/FX+l3iBF83aNNKYPeD40wqx9nSHDNh0MoBN0IrDfSippUkIxnhagOAp6cu7mZHVXUOpjbO9SctU5KT02j9UddK2Qh+25aLufZFyK0J29xVfh99ck/3GHRgE81h9lzolH45jqX1l9NAMuQ14KczSbpIQXfBMBPB3PQ5Rc2sDnn+59Gh3SgIG/g== 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)(39860400002)(396003)(136003)(346002)(376002)(451199015)(46966006)(36840700001)(40470700004)(54906003)(5660300002)(478600001)(86362001)(7416002)(41300700001)(70206006)(40460700003)(70586007)(8676002)(82740400003)(7636003)(356005)(8936002)(36756003)(40480700001)(110136005)(316002)(4326008)(336012)(2616005)(1076003)(426003)(186003)(2906002)(82310400005)(47076005)(7696005)(36860700001)(107886003)(26005)(83380400001)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 13:03:08.2649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e76e6100-9a7c-4fe0-51e1-08dab8e4c2a8 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: DM6NAM11FT074.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4401 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 | 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 Fri Oct 28 13:02:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Shete X-Patchwork-Id: 620175 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 1EE09FA3742 for ; Fri, 28 Oct 2022 13:03:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbiJ1NDS (ORCPT ); Fri, 28 Oct 2022 09:03:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbiJ1NDR (ORCPT ); Fri, 28 Oct 2022 09:03:17 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2051.outbound.protection.outlook.com [40.107.237.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F361D1CC77D; Fri, 28 Oct 2022 06:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fhms5AgFOkWQTsjWWiiCA8moQ02wNae2mbR7hQZPQNCuNMW1JvsrxpkR7Ux1Dbz5FVngS43uO8+oVjOwUh4qHPzwe4It1ql488UTKIbikZW7DQcO5lDWJC8FTSmPlvHR09QosvYflF6uqYaADlUbSMYPyvcwWKqGdRxQILY14yI7jIL2QGgukhnMdDHGLptlsw6ATsZu/9ks+a8axBxcCnmIdJdD+m5HJGtG4qJ+oXeuL9IWOfo91wPm+J6Vtg3JDEYEHxCDWDf8AqCNN35w89/hgUAxEJHnYmEFginROjbpIqm+ulkI96fa3HpDEilzBimLtKoIOY03kHUF+6VL1g== 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=FzbJDFBhlfarPyfjhaISBCcDAuw0j9sVjsoouZut73Ilh52DEcLsP1HjO22hg4X7SA4Pj4A0juQEWZ8A/+qwn4U7dIpQIxndFzYRP5FCCLHnzpXXmR1Dxl7NSNQV1pwM8lATClcu5ylo1TNXeiPIg+mtnbpkMtoqCiuLfflS1isdrP7YDPxm+mc+qjJr1mwgl6kGCNXNL/LS4uMemAsvbUp7ug9c7ed4tc+I/dmkf7pIgAn+2qDlMYCHdkUmcRZEPIo0cUZqVoG+Pa+5+UNzVVFRtO/Wq0FZ3geyCXdC+YUbgEAP5SkTPyfh27Q9hvOk4U7RKckQNI5A4qbq3Qixlw== 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=osQPjwfFKFoZolKFtuIVCktYUIjJVpgd+iSEt+pLnZ4ywMXHuswBsztPYKTjqTIQoWKWKAiptnWseBvF6lwWE4KeGajLghcJgBoDu5oMlTtXtIZsFMyBTS4aptINZPNWE99WL929suNj99f8MBGyBIcLKyS3PSNkeUEBPJxgM+5ELS7KHDZ4RIyp6gzF1AdqEHVTzICbuM7Cg5XJXgbpz9wMTxAFs9AesIwSAKMT93MEhxeVMuC9UBtZDqFEAMY/s0Ho3IhdY8wnzXQbcREZsuMpz6z3czDVvgVtipN90B4Nc9lKD7DX/8r+wDV6C7iZ8z3CBFLeaD5+Wzi8s6dIhA== Received: from DM6PR02CA0077.namprd02.prod.outlook.com (2603:10b6:5:1f4::18) by DM6PR12MB4386.namprd12.prod.outlook.com (2603:10b6:5:28f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14; Fri, 28 Oct 2022 13:03:14 +0000 Received: from DM6NAM11FT074.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1f4:cafe::af) by DM6PR02CA0077.outlook.office365.com (2603:10b6:5:1f4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15 via Frontend Transport; Fri, 28 Oct 2022 13:03:14 +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 DM6NAM11FT074.mail.protection.outlook.com (10.13.173.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Fri, 28 Oct 2022 13:03:14 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) 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; Fri, 28 Oct 2022 06:03:06 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Fri, 28 Oct 2022 06:03:06 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Fri, 28 Oct 2022 06:03:01 -0700 From: Prathamesh Shete To: , , , , , , , , CC: , , , , , , Subject: [PATCH v9 4/4] mmc: sdhci-tegra: Issue CMD and DAT resets together Date: Fri, 28 Oct 2022 18:32:42 +0530 Message-ID: <20221028130242.20900-4-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221028130242.20900-1-pshete@nvidia.com> References: <20221028130242.20900-1-pshete@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT074:EE_|DM6PR12MB4386:EE_ X-MS-Office365-Filtering-Correlation-Id: 964bf9d0-5233-47a3-3d4e-08dab8e4c632 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C7YycH6GmwjPCQGKsc0vBJktHOSHvEqJprHh+Y5DJR4l4xe34R1exz2rbXNmrgRzXUFL9JVLNbpM0xFWurNqWXcId7sVUHOlSehjLGwuXR7DJsqoWEqykGfvarQvBDVoekXkCdXlOm1+XtFVWe1HmvhQ6YaTeWfWW720dT4rRpfSqdbxVcJ4huEa9/KeY/l5iRoAUoqGvkjmrNM16e3CPTiH5oXV9bxKWxiSwWrWDLEyP4Lt1AMjazLdOmKOM/gc7zbZ3hKn61RrWYUWp0tMBXN/h6m1kJc3ZU32xSXu210SOizaG2syXO08aXbjoaqAzWcKlyZZG8YHi38SaKjjK8lBg/lp4cLwI5tZVplOuPkQP56sYmUvY7xJ4sllD73Ir3gd9vkTj7JSsC9xFpyEX+JWUNX8sa4KHEObvtUlOUdKhqUnYfTldurmDZ1+jhFKlcTqN3gGIkuXP4VMrxwsJlMj22bt3CmQFG7LqWy0JGqJl0glEK4PJ3kIA4wUSEZm3cJXkmgAolTZYv9zFirqpSMNpYVPaqoppN4XCW6epEZACJnIK5Ohg5R1lrQO1a9x6g/lheaLFy/I6+WcVbKMMpcwQw4Ow2oH3+ds/YTkiKhr4XA/2VAOD3zHKKqOg3Zsp8iEI0jC0ZHnNKwjLD7diirZ8NssnNTMP6EUYlZxvhQZ3bzitBZzee96UAOqc4AoihThqK0WRjETatRN5TMpfXHqTPigNIXzRGRkiSjHkz4A1CH2TnR/oAMD0ziqB22lY3sliOFe9R0LqnzDBEUDQQ== 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)(39860400002)(396003)(136003)(346002)(376002)(451199015)(36840700001)(46966006)(40470700004)(107886003)(6666004)(316002)(110136005)(36860700001)(336012)(47076005)(40480700001)(426003)(54906003)(86362001)(2906002)(40460700003)(7416002)(186003)(4326008)(8936002)(36756003)(70206006)(5660300002)(2616005)(70586007)(83380400001)(7696005)(8676002)(26005)(1076003)(41300700001)(478600001)(82740400003)(7636003)(356005)(82310400005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 13:03:14.2019 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 964bf9d0-5233-47a3-3d4e-08dab8e4c632 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: DM6NAM11FT074.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4386 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 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 */