get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/2231886/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2231886,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2231886/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/patch/2-v1-b7dc0a0d4aa0+3723d-smmu_no_cmdq_ent_jgg@nvidia.com/",
    "project": {
        "id": 21,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/21/?format=api",
        "name": "Linux Tegra Development",
        "link_name": "linux-tegra",
        "list_id": "linux-tegra.vger.kernel.org",
        "list_email": "linux-tegra@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<2-v1-b7dc0a0d4aa0+3723d-smmu_no_cmdq_ent_jgg@nvidia.com>",
    "list_archive_url": null,
    "date": "2026-05-01T14:29:11",
    "name": "[2/9] iommu/arm-smmu-v3: Use the HW arm_smmu_cmd in cmdq selection functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "532b8cba142a6129a47aebce628524de68d182a1",
    "submitter": {
        "id": 79424,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/79424/?format=api",
        "name": "Jason Gunthorpe",
        "email": "jgg@nvidia.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-tegra/patch/2-v1-b7dc0a0d4aa0+3723d-smmu_no_cmdq_ent_jgg@nvidia.com/mbox/",
    "series": [
        {
            "id": 502465,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/502465/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/list/?series=502465",
            "date": "2026-05-01T14:29:09",
            "name": "Remove SMMUv3 struct arm_smmu_cmdq_ent",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502465/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2231886/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231886/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-tegra+bounces-14134-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-tegra@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256\n header.s=selector2 header.b=FyiVBIrS;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-tegra+bounces-14134-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com\n header.b=\"FyiVBIrS\"",
            "smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=52.101.52.21",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=nvidia.com",
            "smtp.subspace.kernel.org;\n spf=fail smtp.mailfrom=nvidia.com",
            "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=nvidia.com;"
        ],
        "Received": [
            "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g6YMZ3mknz1yJv\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 02 May 2026 00:29:30 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 54C4D3006921\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  1 May 2026 14:29:29 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5BE563CAE69;\n\tFri,  1 May 2026 14:29:28 +0000 (UTC)",
            "from BL2PR02CU003.outbound.protection.outlook.com\n (mail-eastusazon11011021.outbound.protection.outlook.com [52.101.52.21])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 907BA3CA4B3\n\tfor <linux-tegra@vger.kernel.org>; Fri,  1 May 2026 14:29:26 +0000 (UTC)",
            "from LV8PR12MB9620.namprd12.prod.outlook.com (2603:10b6:408:2a1::19)\n by SA1PR12MB8096.namprd12.prod.outlook.com (2603:10b6:806:326::22) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.23; Fri, 1 May\n 2026 14:29:22 +0000",
            "from LV8PR12MB9620.namprd12.prod.outlook.com\n ([fe80::299d:f5e0:3550:1528]) by LV8PR12MB9620.namprd12.prod.outlook.com\n ([fe80::299d:f5e0:3550:1528%5]) with mapi id 15.20.9870.022; Fri, 1 May 2026\n 14:29:21 +0000"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777645768; cv=fail;\n b=F6I9g/71EVoMTeS+PUpXl3eEQogQqrqMw2JJatSgO4MahS6eGAnmPD/9lFC1dCBVcoaKKuQ342mkOzzKAS3wINMPOcCX8eUoYPoLATNZghztnM7II2RamRDvWnlqMRMADkGoX72F/9HywrAc+s3Tcs5uRLtPAltWInYX3CRC6uQ=",
            "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=T2AJWHeaPshmRicOenVuUPTnyp4lP+UMyjs0pDR2uerwoyZSk2AQZ4ESUSyEo5JtEWqrC/BTMU13tnXbD7OLH5oJZXbYfmf12rB1/SUpr6/DpDuKwh8+DCvNXpFtYbBYq+BML4VvDaePVGxcyDxX12/s9vr6f9FeDv3GkDKTVS1Iqe6/QqHlShzDEoa5/mwAdpc3GIzVEfXdLBM+J/DN9qzCWsbsIWh4PiqXbNubHMqBbSdvkHzIsc9QbUqtvQ7Gug1kZPvrgKRR9SmS8oAxPj/5AEojrSOBogEiGeyvAiSZNW/kaZZSzEeNN0LXWb9HRA1z8H4FafzHhGuswR6D3g=="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777645768; c=relaxed/simple;\n\tbh=qD0LZ6bDnQ4zYwFuloWD3o8VwcR+nzHS7qO0LCfq+GI=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=R8BNAhBR0MfXEkQ2HpxlWNW5EFAHz6/6NoUMBvCvWFEDIBeiYdVBvRDDf8M+Bp3x5WiksgQqkSXvYEQPGfTrvWejaGuS29bwT7y9WxcVVSFYc/uOK/ygZ+aZ6Q2ZNMkWGd8rXP8p0lWYUkXk30CAKR19DfDdc7WpNt5DPjRdPmk=",
            "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n 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;\n bh=n1uhfAmuA8YY+eLYAKMut3jF20w/vgKNBzm/D/EpeDU=;\n b=oP3rf0Fwu7G73b4mj58giCf0Th3T6m29gKs5iwn68Wpq8HA61BP+AdyOGroz85MggdCeztL5ZclPqyYx2AEUTCxoOBJkPmrsnBh8FPquQ+Rimo3Ni2sFSc1tMrwYZm9r+Qcc+wjL3N8Df8ZwNZ9IR1BZmufKWTydu5cUgYGvZiK7fcYjYlZihKdD6EoCPgSVowN0LHrbO+1dbJe+InyUVOj2YJsqUVSiU7a0Aln9DNVmYQpsUQKhYSfzKRCrDLONAFUSAHKra9t7KZ0b3CATaD+pqUF+FGars1s5fshsvdw7wufIy1miWLqIcqXUgPsGZ9VaV74wIoxRmJkCtiTjaw=="
        ],
        "ARC-Authentication-Results": [
            "i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=nvidia.com;\n spf=fail smtp.mailfrom=nvidia.com;\n dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com\n header.b=FyiVBIrS; arc=fail smtp.client-ip=52.101.52.21",
            "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;\n dkim=pass header.d=nvidia.com; arc=none"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=n1uhfAmuA8YY+eLYAKMut3jF20w/vgKNBzm/D/EpeDU=;\n b=FyiVBIrSnpBq4OIUOqsWemzbaXIcr5e1JzLPsukc+IBM3zVX9iav7s9Zw4Z0V/2J5gHI8uKVkjIM8JuwAaJAcPbK4BU2DWtU5WOuqtduZlklNI1kqDnIQg/Fr7erkIePM6f7llppQ/nR053F+pwoPWYZfF0BlLjVavTxEBSVlO/+rmsm3hmayV5RPWRjGz7OYgkBv9S1vFVS3/rsyhd7PJUwMMgk5MdePBNgPdjkRA78pRhdpJOB6ANvYiq+ooJNC/YdWzy+ta3GL3cPHbI3JZ6daBx04jiiUVoSWcKNwTZCpWUHu+6zY+PItbMyHDzlcHPYKDGtgzX7tY0/89lWyw==",
        "From": "Jason Gunthorpe <jgg@nvidia.com>",
        "To": "iommu@lists.linux.dev,\n\tJonathan Hunter <jonathanh@nvidia.com>,\n\tJoerg Roedel <joro@8bytes.org>,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinux-tegra@vger.kernel.org,\n\tRobin Murphy <robin.murphy@arm.com>,\n\tThierry Reding <thierry.reding@kernel.org>,\n\tKrishna Reddy <vdumpa@nvidia.com>,\n\tWill Deacon <will@kernel.org>",
        "Cc": "David Matlack <dmatlack@google.com>,\n\tPasha Tatashin <pasha.tatashin@soleen.com>,\n\tpatches@lists.linux.dev,\n\tSamiullah Khawaja <skhawaja@google.com>,\n\tMostafa Saleh <smostafa@google.com>",
        "Subject": "[PATCH 2/9] iommu/arm-smmu-v3: Use the HW arm_smmu_cmd in cmdq\n selection functions",
        "Date": "Fri,  1 May 2026 11:29:11 -0300",
        "Message-ID": "<2-v1-b7dc0a0d4aa0+3723d-smmu_no_cmdq_ent_jgg@nvidia.com>",
        "In-Reply-To": "<0-v1-b7dc0a0d4aa0+3723d-smmu_no_cmdq_ent_jgg@nvidia.com>",
        "References": "",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "BL1P221CA0004.NAMP221.PROD.OUTLOOK.COM\n (2603:10b6:208:2c5::15) To LV8PR12MB9620.namprd12.prod.outlook.com\n (2603:10b6:408:2a1::19)",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-tegra@vger.kernel.org",
        "List-Id": "<linux-tegra.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-tegra+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-tegra+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "LV8PR12MB9620:EE_|SA1PR12MB8096:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "1312e880-e10a-46af-94b1-08dea78e0851",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "\n\tBCL:0;ARA:13230040|376014|7416014|366016|1800799024|56012099003|18002099003|22082099003;",
        "X-Microsoft-Antispam-Message-Info": "\n\tfrAEzBoDYkSQS4nn8UWgKAe8tHfJOX98vBzrG/qZV31K9Q3pM8MNLcR8OUGMkIPuLWGhKQK9iP3X8vXAr571R/iaz3E1/VPM6hZXQ6JejzJ8rTwOcxbiliIr6s2RBTQAJzLif8WGFJ3YBm4cjkoJc29LoYOYbZKCZp7agKCOTxMFvPCzjSsTR82JAtEarLEqAWLYhfzVwqkaNTw7lACO5LA8PepijvmR4tBATg4vRMUVXgz1x+zUggu899Wwab7raQ0hwbmRiFR4pydc65EoBRli1sX/m5SJqHTKAyhtwIm/TXb2FhE4iYZ7eeLTyfhdXHK/EVLSQAxhsbtSuFDj/a9CFregFWBSE+aaQb7xaezBFMlItr2eVTChOprBenxOFfAvY1gM5lS94FK6S7F8bQGU7Brcr3M1Elej2FWZ6BGRJ2lbmahGzHkYSsQ2h984yH1eiU3zCER3JX5utAV4LAF3E0oG8ZoB9ojIzTFNruFjb45UbLk6NC6hUOARPLnwiCtbwM0ecPIN6PHZiAAVSVu7UT2k5C1T7huVCwILMmkKVt57KTgX1uHtBGDbsIAcynBUtmkMwH5bvZk/FzPQOuZH9gmQaQLGxhvy7J+XWZzKWigoCPD7+hlm5q+u3T5TCs7+QNLoENBP2mvHJ3JMCS/8siPWt24xARhD9eRql7iidIzMq5PrAMvfnpFUc2v1",
        "X-Forefront-Antispam-Report": "\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV8PR12MB9620.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(1800799024)(56012099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n VCxv9iCTEKmj492Klh5MF4xsvPt3yPQBM5hhFgyMKGxNmsi7wHFol1lnbpRV0JazwXXA2sPq5b/YimEDqXsZ7nkLCxz58ONb8sWXLMqavol8RFOORKAPRC2g76axBYKPABbZXLgQDqJ0fIvXiktb8N1zNlamAv9EkbZsQD2BBhNdWlroscLKCKzsS/Gcv5UElh8wXh3FijNpLeFitSR22O8IcSOkTN1tfTJqox6k6FQOESyEX9B7TH+Nph1+NPiAH1ylqhHEs/V8xmbCVHUq3BvXUKvSceisnNo14lWfkqxRA1W99jAK/h1iZwjDwWhWKenvs8QaL1tQGsV+Zrdm2CJjtk9vrULgXCuOvxtfof4brogZeHUT8jv3s9Wq6Bre5onLyRpkdynXKlSrK9X74WyoUlPeXCggl6Li0daebhy8dLC79rU9IWBikF0td4AWrmJbnhDMcrBCJI/fQIku7Vus45wrJ4CnlW/159+OcbOv/WhzqIzjXcIAnIBsRuhoJ3mOYSIs6QVLvhJz2vh9iboykw5ULK3fDsdpQFSXzvwX78k6RC/hg7cgkyW05JYq7KZF+tcslyUDG4vP9WipHiEV4act1hJibyE2plpnK6u0kNjRxhoXVDVlCRIx7Z09kVbd7Y5Pfo3H0ge2rGSNUZjO5dK1mRTS1VA8id+OA4hShEAfXCqyodRrxqdVvQrqWUHD04s1WojueGhR++m7mHnb1YyTrApLfcD0pcUCK/WdJ+MR9jl+G+iPlsadboPudIZOZ4LEuSD2iGCLCYNeu1Ll9DC0E+P2z9A0BEYmR+j1obZ9dFLrkKNwTzK0I8VT89bE7RZHjRNvoPTDZMnHD7saW1abIb9xpu+wK85P/1fw42uvcH5ht3xS11iNBD5T57f8d7lwNao6OKXUWZnjnhvM9UqRxBif9HB02aoIcrtwm0yoUii62Q9Ae/3mG1kJWAWlUeWx19xBJi2MlAoaZDyXaNxNaQ75rjZ7/BmLG4cR0aAcqIRIeqYftJGRC8OP4atR5QY9CkMm5vS3uvGA9suTaiNXXICg1jVUnBZKh2ZdgppS7Wyuq2hBBZwhHr0FhV2aeyS2w4dHoPMQ+oZETVe2LkFuJML9oI00Ah1HQ7L2xLd1EPgUDHLZc0O5/hUNmbsBwe4ISqUJ/Q2QcwcOLzUlwLhNc7f2AzitZE6eQuCKnyNuKpG/cRYnUWlSQBcDVVBvDAXPJesXv7jjvvfmEwbo24k2XPMozminZNtywVJ3Lis8YBXFT7kVVhws1nuyObhIhL7FYA7R5UZ9Eek68FOV3JdnlgWvfxMvjg6gns5xSVflpXDFHWEXfbeOyPGWUxlWNNRJigLHfiWTqSXZEiiqJ1rhWfJHVreIy8eG0ML18aPPm1fx/fGx08HAcTd2tBhhrLM+EnrfWtBJp7GqrQhiM4+hmmJOPl6hop2cBeMi53yPoQ3TJj1we3hDB/8OnrdxOeQAiobmFuEtzZMVuCy9HuerAicyd2xaHw1yxsPog5OzvvBBsgGQw3+A6FYV+asYbr64XdWHdyhy7pbE4SsqL2P9yVqNxMgRfUma9wh4zlpx673wPwSbufQPqPDdh1F4CcNMgoKk8FRqQ6P5vmdPuWYyZqOZ5aadPVls/LqRxFa51S5VXKWAJUagPCPbNpvUnsz1H0NVXACn2FYDo03Dy8mvC15ljsaZNjDnhPJc7rYeKldKDF+ZV53ckcSa",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 1312e880-e10a-46af-94b1-08dea78e0851",
        "X-MS-Exchange-CrossTenant-AuthSource": "LV8PR12MB9620.namprd12.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "01 May 2026 14:29:20.3273\n (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": "\n qtZBMOn7nGLGimjH0DGdQKdtbYtA1/upod8Y4IUzJn9LAplXSiasRHuovFww7jDy",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "SA1PR12MB8096"
    },
    "content": "Start removing the use of struct arm_smmu_cmdq_ent, starting at the\nlower levels of the call chain. Change the functions that determine what\ncmdq to issue the batch to into using struct arm_smmu_cmd directly.\n\nSigned-off-by: Jason Gunthorpe <jgg@nvidia.com>\n---\n drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   | 47 ++++++++++++-------\n drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |  8 ++--\n .../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c    |  8 ++--\n 3 files changed, 38 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c\nindex e8d7dbe495f030..5cdeaec890592f 100644\n--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c\n+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c\n@@ -371,12 +371,12 @@ static int arm_smmu_cmdq_build_cmd(u64 *cmd, struct arm_smmu_cmdq_ent *ent)\n }\n \n static struct arm_smmu_cmdq *arm_smmu_get_cmdq(struct arm_smmu_device *smmu,\n-\t\t\t\t\t       struct arm_smmu_cmdq_ent *ent)\n+\t\t\t\t\t       struct arm_smmu_cmd *cmd)\n {\n \tstruct arm_smmu_cmdq *cmdq = NULL;\n \n \tif (smmu->impl_ops && smmu->impl_ops->get_secondary_cmdq)\n-\t\tcmdq = smmu->impl_ops->get_secondary_cmdq(smmu, ent);\n+\t\tcmdq = smmu->impl_ops->get_secondary_cmdq(smmu, cmd);\n \n \treturn cmdq ?: &smmu->cmdq;\n }\n@@ -924,16 +924,16 @@ static int __arm_smmu_cmdq_issue_cmd(struct arm_smmu_device *smmu,\n \t\t\t\t     struct arm_smmu_cmdq_ent *ent,\n \t\t\t\t     bool sync)\n {\n-\tu64 cmd[CMDQ_ENT_DWORDS];\n+\tstruct arm_smmu_cmd cmd;\n \n-\tif (unlikely(arm_smmu_cmdq_build_cmd(cmd, ent))) {\n+\tif (unlikely(arm_smmu_cmdq_build_cmd(cmd.data, ent))) {\n \t\tdev_warn(smmu->dev, \"ignoring unknown CMDQ opcode 0x%x\\n\",\n \t\t\t ent->opcode);\n \t\treturn -EINVAL;\n \t}\n \n \treturn arm_smmu_cmdq_issue_cmdlist(\n-\t\tsmmu, arm_smmu_get_cmdq(smmu, ent), cmd, 1, sync);\n+\t\tsmmu, arm_smmu_get_cmdq(smmu, &cmd), cmd.data, 1, sync);\n }\n \n static int arm_smmu_cmdq_issue_cmd(struct arm_smmu_device *smmu,\n@@ -948,42 +948,55 @@ static int arm_smmu_cmdq_issue_cmd_with_sync(struct arm_smmu_device *smmu,\n \treturn __arm_smmu_cmdq_issue_cmd(smmu, ent, true);\n }\n \n+static void arm_smmu_cmdq_batch_init_cmd(struct arm_smmu_device *smmu,\n+\t\t\t\t\t struct arm_smmu_cmdq_batch *cmds,\n+\t\t\t\t\t struct arm_smmu_cmd *cmd)\n+{\n+\tcmds->num = 0;\n+\tcmds->cmdq = arm_smmu_get_cmdq(smmu, cmd);\n+}\n+\n static void arm_smmu_cmdq_batch_init(struct arm_smmu_device *smmu,\n \t\t\t\t     struct arm_smmu_cmdq_batch *cmds,\n \t\t\t\t     struct arm_smmu_cmdq_ent *ent)\n {\n-\tcmds->num = 0;\n-\tcmds->cmdq = arm_smmu_get_cmdq(smmu, ent);\n+\tstruct arm_smmu_cmd cmd;\n+\n+\tarm_smmu_cmdq_build_cmd(cmd.data, ent);\n+\tarm_smmu_cmdq_batch_init_cmd(smmu, cmds, &cmd);\n }\n \n static void arm_smmu_cmdq_batch_add(struct arm_smmu_device *smmu,\n \t\t\t\t    struct arm_smmu_cmdq_batch *cmds,\n-\t\t\t\t    struct arm_smmu_cmdq_ent *cmd)\n+\t\t\t\t    struct arm_smmu_cmdq_ent *ent)\n {\n-\tbool unsupported_cmd = !arm_smmu_cmdq_supports_cmd(cmds->cmdq, cmd);\n \tbool force_sync = (cmds->num == CMDQ_BATCH_ENTRIES - 1) &&\n \t\t\t  (smmu->options & ARM_SMMU_OPT_CMDQ_FORCE_SYNC);\n+\tstruct arm_smmu_cmd cmd;\n+\tbool unsupported_cmd;\n \tint index;\n \n+\tif (unlikely(arm_smmu_cmdq_build_cmd(cmd.data, ent))) {\n+\t\tdev_warn(smmu->dev, \"ignoring unknown CMDQ opcode 0x%x\\n\",\n+\t\t\t ent->opcode);\n+\t\treturn;\n+\t}\n+\n+\tunsupported_cmd = !arm_smmu_cmdq_supports_cmd(cmds->cmdq, &cmd);\n \tif (force_sync || unsupported_cmd) {\n \t\tarm_smmu_cmdq_issue_cmdlist(smmu, cmds->cmdq, cmds->cmds,\n \t\t\t\t\t    cmds->num, true);\n-\t\tarm_smmu_cmdq_batch_init(smmu, cmds, cmd);\n+\t\tarm_smmu_cmdq_batch_init_cmd(smmu, cmds, &cmd);\n \t}\n \n \tif (cmds->num == CMDQ_BATCH_ENTRIES) {\n \t\tarm_smmu_cmdq_issue_cmdlist(smmu, cmds->cmdq, cmds->cmds,\n \t\t\t\t\t    cmds->num, false);\n-\t\tarm_smmu_cmdq_batch_init(smmu, cmds, cmd);\n+\t\tarm_smmu_cmdq_batch_init_cmd(smmu, cmds, &cmd);\n \t}\n \n \tindex = cmds->num * CMDQ_ENT_DWORDS;\n-\tif (unlikely(arm_smmu_cmdq_build_cmd(&cmds->cmds[index], cmd))) {\n-\t\tdev_warn(smmu->dev, \"ignoring unknown CMDQ opcode 0x%x\\n\",\n-\t\t\t cmd->opcode);\n-\t\treturn;\n-\t}\n-\n+\tmemcpy(&cmds->cmds[index], cmd.data, sizeof(cmd.data));\n \tcmds->num++;\n }\n \ndiff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h\nindex 092179f689e9f1..6d73f6b63e64a9 100644\n--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h\n+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h\n@@ -641,13 +641,13 @@ struct arm_smmu_cmdq {\n \tatomic_long_t\t\t\t*valid_map;\n \tatomic_t\t\t\towner_prod;\n \tatomic_t\t\t\tlock;\n-\tbool\t\t\t\t(*supports_cmd)(struct arm_smmu_cmdq_ent *ent);\n+\tbool\t\t\t\t(*supports_cmd)(struct arm_smmu_cmd *cmd);\n };\n \n static inline bool arm_smmu_cmdq_supports_cmd(struct arm_smmu_cmdq *cmdq,\n-\t\t\t\t\t      struct arm_smmu_cmdq_ent *ent)\n+\t\t\t\t\t      struct arm_smmu_cmd *cmd)\n {\n-\treturn cmdq->supports_cmd ? cmdq->supports_cmd(ent) : true;\n+\treturn cmdq->supports_cmd ? cmdq->supports_cmd(cmd) : true;\n }\n \n struct arm_smmu_cmdq_batch {\n@@ -815,7 +815,7 @@ struct arm_smmu_impl_ops {\n \tvoid (*device_remove)(struct arm_smmu_device *smmu);\n \tint (*init_structures)(struct arm_smmu_device *smmu);\n \tstruct arm_smmu_cmdq *(*get_secondary_cmdq)(\n-\t\tstruct arm_smmu_device *smmu, struct arm_smmu_cmdq_ent *ent);\n+\t\tstruct arm_smmu_device *smmu, struct arm_smmu_cmd *cmd);\n \t/*\n \t * An implementation should define its own type other than the default\n \t * IOMMU_HW_INFO_TYPE_ARM_SMMUV3. And it must validate the input @type\ndiff --git a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c\nindex 83f6e9f6c51d6b..b4d8c1f2fd3878 100644\n--- a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c\n+++ b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c\n@@ -367,9 +367,9 @@ static irqreturn_t tegra241_cmdqv_isr(int irq, void *devid)\n \n /* Command Queue Function */\n \n-static bool tegra241_guest_vcmdq_supports_cmd(struct arm_smmu_cmdq_ent *ent)\n+static bool tegra241_guest_vcmdq_supports_cmd(struct arm_smmu_cmd *cmd)\n {\n-\tswitch (ent->opcode) {\n+\tswitch (FIELD_GET(CMDQ_0_OP, cmd->data[0])) {\n \tcase CMDQ_OP_TLBI_NH_ASID:\n \tcase CMDQ_OP_TLBI_NH_VA:\n \tcase CMDQ_OP_ATC_INV:\n@@ -381,7 +381,7 @@ static bool tegra241_guest_vcmdq_supports_cmd(struct arm_smmu_cmdq_ent *ent)\n \n static struct arm_smmu_cmdq *\n tegra241_cmdqv_get_cmdq(struct arm_smmu_device *smmu,\n-\t\t\tstruct arm_smmu_cmdq_ent *ent)\n+\t\t\tstruct arm_smmu_cmd *cmd)\n {\n \tstruct tegra241_cmdqv *cmdqv =\n \t\tcontainer_of(smmu, struct tegra241_cmdqv, smmu);\n@@ -409,7 +409,7 @@ tegra241_cmdqv_get_cmdq(struct arm_smmu_device *smmu,\n \t\treturn NULL;\n \n \t/* Unsupported CMD goes for smmu->cmdq pathway */\n-\tif (!arm_smmu_cmdq_supports_cmd(&vcmdq->cmdq, ent))\n+\tif (!arm_smmu_cmdq_supports_cmd(&vcmdq->cmdq, cmd))\n \t\treturn NULL;\n \treturn &vcmdq->cmdq;\n }\n",
    "prefixes": [
        "2/9"
    ]
}