Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2039643lqa; Tue, 30 Apr 2024 06:55:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0GVBUJGgYQATKX8rQN5jGfbKeOo1SASCytKSSYgn+zqr0sPlV7/KuXVkRW1oEyl/s8DsAX36nkBy8S7+SDLbIKSh2lt17JOuNghhEPw== X-Google-Smtp-Source: AGHT+IG9/Dl7IomyuzjzA2cNfPB3sX4Lf68O1qHpFPC77HTFlZJ+xpGUnA6JkZphNFx5Lp27ibvo X-Received: by 2002:a05:620a:70ce:b0:78e:bdc8:563b with SMTP id vk14-20020a05620a70ce00b0078ebdc8563bmr2488108qkn.71.1714485325580; Tue, 30 Apr 2024 06:55:25 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id da49-20020a05620a363100b0078eba58396esi28293786qkb.67.2024.04.30.06.55.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:55:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164045-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=EnGaovm3; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-164045-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164045-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 43CB51C22417 for ; Tue, 30 Apr 2024 13:55:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31E8E172777; Tue, 30 Apr 2024 13:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="EnGaovm3" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6920A172BDE; Tue, 30 Apr 2024 13:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.64 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714485306; cv=fail; b=cn7cDyH10lbdC6kigVKDQQIJ5P0+IKM5jQdxkRP5b88MmSJuTDzkQ6BIhOx58hDsepPrvoX0ZyU4xZJsdwAbcquw0Vb4SV2aN4vl2BbFN95Kb5QcVR1e+SRAr8fQKoyCFMkrgfYliXLNgFm1sn4xeodhGG1xjfXYX1DVSXG835I= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714485306; c=relaxed/simple; bh=J48789P/UiYbmDruGqYUG/0kPnhwNY8SfCD/5STgS+U=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=XSVQPt8V11FRIcesxyD8KGIyqBnpgZRi8nKNHBdnFjHHfuGlj6b7oIaJpTBtZQ8Tr+tF7k5zuzAmnDwbanlE1D0owbOlnTe1PlWkvjsKOTROe1sL3so1D6UpBg7Y02Hsj+CBwvaP/F6L6v6yaMXrZ769fvGgqQxMZFTL5/uWfJM= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=EnGaovm3; arc=fail smtp.client-ip=40.107.223.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yi0YswpKbErorRxh2HNhSgW+fCY+7KtGG7kLYDP8OLdBF3X3C/AQrGIMeLqIlAaQpJbbisUwJW4/kf2KSb6t15/5/TahIm7WrKshog1errWJ5nSimYnjU3gUtkjauFSnvMY3NNxR6ieXxUjrPqLvXtkRKVgJrpoev26qoiUWH0k+SLYQ1lLTPxnvyW74FPVAd+muVMUneb2garaK4IQ1paLUa8PA65H8xEa2rUOQ+m1Y2daeuNAnfGcrdrW6l/EDFFTlksY2mdMw/HCkiHS0t5ehvg2KoNDksawOmENkUoZfoSl1yGAx6JRLWWNGNtBQymds9pjBlkeTN2tvPZS/Jg== 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=JcxIyifRRMw+Plw9ZqrHZMuNKTIaNyQZS60WkeiFpf0=; b=DWvtKErTHVciW/O+O634jcpGY4d6LYhgO3f9t0bf0/LaektOMT+8xWNLxxtU7e1YYYLnTvOehlAgfCPJBj1j+gMuKzhJGFyacexRd845WfYAKn8jZYRjyCyLhUeLrhDP4fB0SYSwsMI16+sG7acoPpbrOnG3J1euvK4ickqOFlSHg0o2ml6MxjNSMFUOf0N3EqHnbzNjeNa6tiWnjafJN+tmpk2pYFqB75bLw8Nfk9rGJ804BwpeyhC1nbjS0a78v870uNFN7FLAY1PdQcaw7EqaY6QGtML6yO7CVt9hvKB4weMgS8US/7bNF63wqsxFIgXnX1VGVzP3Ov8CiUwS2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=JcxIyifRRMw+Plw9ZqrHZMuNKTIaNyQZS60WkeiFpf0=; b=EnGaovm3xu2VXOG3iJGXBwRZ0NXHz/EWaRDADH2o+RVogzjYvkaRJfTxCVSuM5Xbz1Eo9MQL9VDbQroHEhuKlm8zpXS+2nDNS8JKIkLImthCTm1OXEoaA1Kfg83xsEG8x7LPtnVsLqiIDT6omIgRGyM/drFGS62Evz7yQVjA5DZstkdZHJ6NvQbFnk/vMfUPmX30WXSkTL6Z5xaNwspiJv6QwAEVD1tiaYvLvCfFQTedvOaSuGFTWHyyodimhk5xf3+EFEkYEIbmrHVu8RUVgQH7qfN/RrB+8z+nyyBn+ASPpv5BHcJJVC6J23cI5dGT/Dulw80PZliLREZUqzZWug== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) by CY8PR12MB7169.namprd12.prod.outlook.com (2603:10b6:930:5e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.32; Tue, 30 Apr 2024 13:55:00 +0000 Received: from DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::c296:774b:a5fc:965e]) by DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::c296:774b:a5fc:965e%3]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 13:55:00 +0000 Date: Tue, 30 Apr 2024 10:54:58 -0300 From: Jason Gunthorpe To: Nicolin Chen Cc: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, thierry.reding@gmail.com, vdumpa@nvidia.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH v6 1/6] iommu/arm-smmu-v3: Pass in cmdq pointer to arm_smmu_cmdq_issue_cmdlist() Message-ID: <20240430135458.GO941030@nvidia.com> References: <0acb55059f7212abdf4277a81e2f033127072bc9.1714451595.git.nicolinc@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0acb55059f7212abdf4277a81e2f033127072bc9.1714451595.git.nicolinc@nvidia.com> X-ClientProxiedBy: SA0PR11CA0151.namprd11.prod.outlook.com (2603:10b6:806:1bb::6) To DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB3849:EE_|CY8PR12MB7169:EE_ X-MS-Office365-Filtering-Correlation-Id: d08aa4b8-de21-44c2-044f-08dc691d20a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Cioz7UwRDjZ1mCzlWziN7BTWO8Z6889mxdQvLfJmskY26YqAj8vgtG/IUifh?= =?us-ascii?Q?La2QwaWUfOA6+/TQcKN81aB6pv43gmqwn1vNj9D8Noc9N/8OrIaScQTfmRfZ?= =?us-ascii?Q?ceMCjMiScxlEMbtnDSEWGqeOJ5FmD+iplv20nJtXXvPQPG/wkdXL5AlKG6zR?= =?us-ascii?Q?+WC/YjxgOG8ih6Al/fuMj3fccZhwq/E+GXmuVbE9ZSju8/AdFIul+18VJwhg?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8PQzoZs2rjFDr8RqI0Qq+HMbsfzrSSrUW63jg0LQda7J?= =?us-ascii?Q?RyVonIsN4V6lOPIcyu1wtbAOMl/T7qvJa6qa4SWTMI0meVydQZxPefFyxvxR?= =?us-ascii?Q?izPeLhIqSZI0ERBS0BakTorh4pcu6NENfWo7dHQY5Nc7o8GNQ7+KiUPrjdu2?= =?us-ascii?Q?+zg8Kza2Vh7AJDKwrJQukDXVeg1mmj4M4CHpQXTYQA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jazuUsGmwZH0ijnMKwFKRiNcYIKPvWsHW8KgeGRP/t8R6qCf2Z/qhPcF7luX?= =?us-ascii?Q?nXAcXf1BSf42E9eAgxLU9Q5s/5sD3ag7q6cpqb6S6phv7+DrrESPq9XA7crv?= =?us-ascii?Q?zvyVma7J1ajHQ+EkNMAx01s3IGz/+SxtxgadEiMg+RnM/AnUxEu8rDVG9n4N?= =?us-ascii?Q?cXzIij53APJ0aGWoD+djZiwzoL3Ms1bScshidubzNbKqugAF10EDI7oDIHkp?= =?us-ascii?Q?UVN8fy5vryx3mWvQd6ykl3h12ptemW3b/8rM9RlAwEB40RFQxqvVLNQ9tZPW?= =?us-ascii?Q?Tp1dbD+D7Z/NxyBJE8uLCY98/tQvEwV0uN0UgNduKuvIIm8wlVc3Te37K6e4?= =?us-ascii?Q?qdgnfaFNsqt5DzT7/uPZAsn6JgKYMr6dqeumQbyLCyd5sxkdTa9aXpIhk7b4?= =?us-ascii?Q?AZAMgjzmu760+tdM+NhEbU5bXetoUz4PQZzNtvjmjiQtgRNjnqF74/1HLVQl?= =?us-ascii?Q?CKh0d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NbWUDU?= =?us-ascii?Q?+3kE96g1et40oEosTTuMtdDWnGqWjJp4ooeT43jOQLnAyp0ynEjKFXo2VFtw?= =?us-ascii?Q?VM3jse1chlP5MHLn/EXoPeDsA/6cVrwEjKeLUJ5nFH1bd84yRTn5Bxoe9prv?= =?us-ascii?Q?fjrZuGfx1mPdoKt1ZgvXqzfIAeDsfflPVeclFsqd18vOtlom2IZCmU+kKg6l?= =?us-ascii?Q?+AB8QrXsJWwt5cjm0bcHQU9FYe64JjQfx8CgcG0g?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d08aa4b8-de21-44c2-044f-08dc691d20a9 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3849.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 13:55:00.4000 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kQB10nCy5pK/wzIJY0X92A7aP1rM6bmmPEukNshMFZjYMBOCF27h/+dzsDCfsQQv X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7169 On Mon, Apr 29, 2024 at 09:43:44PM -0700, Nicolin Chen wrote: > The driver currently calls arm_smmu_get_cmdq() helper in different places, > although they are all called from the arm_smmu_cmdq_issue_cmdlist(). > > Allow to pass in the cmdq pointer, instead of calling arm_smmu_get_cmdq() > every time. > > This will also help CMDQV extension in NVIDIA Tegra241 SoC, as its driver > will maintain its own cmdq pointers, then need to redirect arm_smmu->cmdq > to one of its vcmdqs upon seeing a supported command. > > Signed-off-by: Nicolin Chen > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) Reviewed-by: Jason Gunthorpe Jason