{"id":2224149,"url":"http://patchwork.ozlabs.org/api/patches/2224149/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/b4344b8d30a75d5d8d0acdbd9f038d9cddb4147d.1776381841.git.nicolinc@nvidia.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<b4344b8d30a75d5d8d0acdbd9f038d9cddb4147d.1776381841.git.nicolinc@nvidia.com>","list_archive_url":null,"date":"2026-04-16T23:28:39","name":"[v3,10/11] iommu/arm-smmu-v3: Introduce master->ats_broken flag","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"25dbf9028d6e98c445db0b15bae0c0f2a89c75b9","submitter":{"id":82183,"url":"http://patchwork.ozlabs.org/api/people/82183/?format=json","name":"Nicolin Chen","email":"nicolinc@nvidia.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/b4344b8d30a75d5d8d0acdbd9f038d9cddb4147d.1776381841.git.nicolinc@nvidia.com/mbox/","series":[{"id":500217,"url":"http://patchwork.ozlabs.org/api/series/500217/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=500217","date":"2026-04-16T23:28:31","name":"iommu/arm-smmu-v3: Quarantine device upon ATC invalidation timeout","version":3,"mbox":"http://patchwork.ozlabs.org/series/500217/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2224149/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2224149/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-52670-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@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=DvwbMDdR;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-52670-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=\"DvwbMDdR\"","smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=40.93.201.52","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"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxZ9z3hF0z1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 09:35:03 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 2E0A23144EDC\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 23:30:18 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 61A3F3A5E85;\n\tThu, 16 Apr 2026 23:30:17 +0000 (UTC)","from CY3PR05CU001.outbound.protection.outlook.com\n (mail-westcentralusazon11013052.outbound.protection.outlook.com\n [40.93.201.52])\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 0C3923976A8;\n\tThu, 16 Apr 2026 23:30:15 +0000 (UTC)","from BYAPR01CA0046.prod.exchangelabs.com (2603:10b6:a03:94::23) by\n BL1PR12MB5996.namprd12.prod.outlook.com (2603:10b6:208:39c::14) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.44; Thu, 16 Apr\n 2026 23:30:10 +0000","from CO1PEPF00012E80.namprd03.prod.outlook.com\n (2603:10b6:a03:94:cafe::d5) by BYAPR01CA0046.outlook.office365.com\n (2603:10b6:a03:94::23) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.52 via Frontend Transport; Thu,\n 16 Apr 2026 23:30:09 +0000","from mail.nvidia.com (216.228.117.161) by\n CO1PEPF00012E80.mail.protection.outlook.com (10.167.249.55) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9769.17 via Frontend Transport; Thu, 16 Apr 2026 23:30:09 +0000","from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com\n (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 16 Apr\n 2026 16:29:49 -0700","from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail204.nvidia.com\n (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 16 Apr\n 2026 16:29:48 -0700","from Asurada-Nvidia.nvidia.com (10.127.8.11) by mail.nvidia.com\n (10.129.68.9) with Microsoft SMTP Server id 15.2.2562.20 via Frontend\n Transport; Thu, 16 Apr 2026 16:29:33 -0700"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776382217; cv=fail;\n b=nsq3iaRIaHyDqD+xDubsS35tGu8TIXaxpMFqWoDvCuu+L6UFXdxH0PJkq4hAikF11N3bj83o3+vH0tn5laBPXi1+y5yY631/IqjbfnDAXqcIF0CH93klEwdcmMl76xhIEjwvxslU4XIBdV1gVjKK60EH9tIwxohyaT3LEWE3jT8=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=EIFFGXvFJPPCldtaMr0Pvo4RrH/epPNVqlzEL3chLmDTuiM3Qz+kXgQwpyokxDQrZC8HXcziL+5EknFXHAV58CqwuJQmIfQj+Y04kZuMneG4Y5oV9U+oNFIiepaKTWG+QIWy7jYr812zbsRj0RKYpoewilHfCa8KZ/k3FspBo3WQ63CgkI79iIdx2ItEfL0ZCFYngfCUKNWFA4LTTW8mReiaCa+yuLzryCD86DaRFjB1D84wWhMVQxMZEaAZ9osM83jxTuRot8uUBV7IHeUg0gcF60aYcuqPfS0Y1WL2UorEzHDyEvYkxBt4YoH6Ccu0k1hkWtN9L3DLOaowxIoXqw=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776382217; c=relaxed/simple;\n\tbh=yDq+Cfmk12pGLtv6JD/6dMZacmjIxegiFlixuDRoLNE=;\n\th=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=OmHLBhrKQx/mjkY4z3wo4p0gicwFG5M6FHZs4BzCVqk9ehHIgC6Q/tkef1iGYjxVgosdWOfoAHp0JrI9UVfsTdgPD3RFHDqidfxd7k2f1s5Zp+NsICA5jpCxx0e66Vqjmu7DMr3C2BwlEDU8wG3ibuRB7ffRMFA1xzmP9795DbI=","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=UTWELt83k3g1C5gQ86XTAw7Bn0+qH7tYz0O1Q4yqYDA=;\n b=Sg+M9iPgtEAZ6me8MpY6lfo7tQhj5pEAnbYSz7b5MIdx5P5Or0bkJPK/yvWDoyIXx47adD/SbV9Sld/EoAZt3++VzLOYXTIjfTKyS0SghlszNkMFoHpfbbVkdmkEf9GYIxHY8N+W319LH23ZGYP5vOoZSd0swZYOZEI4xzPwdFfSLCo+t5OcfDPQekrBwjxJQfGbt0U8rcdjpXAKqFlCi7lzx0GvA4BXmld5o5pv52UzTAheyu2EqX4ZyrXVjVIrOUgd39EJRI3AHHl21x32LARZOb2yVSmBIMc7svM3ZqW9LitR/C69ouLOx0J72A+4vA287VFLRSx49PDZW0AiHQ=="],"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=DvwbMDdR; arc=fail smtp.client-ip=40.93.201.52","i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.117.161) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com;\n dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none (0)"],"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=UTWELt83k3g1C5gQ86XTAw7Bn0+qH7tYz0O1Q4yqYDA=;\n b=DvwbMDdREg5Jq55sRenoYU5h0NxB9lDwfB1DWQO672z/dxyWSG2p7lud73+Kmgl9LiZELPYcise5WZWCfQYmrcHeQETsTaIgBBsaqsVriMEHZiaYo8u278rBFxJwVWENXipYhj8mOKmjJxkgxl19M4109nxlmornWZmnanE45cyA1Fs2pfl4ubVZ6AdXjLwyXJcgTCVbm7YFq5xQtynF0SyNqvwsLCqKwxu13H1+EwKQZLS/bt32JvZKYQ+idgCKZEArmbzF+F+GcjchHE+0f1OnpsxS26JGlI40XyC0LvA3kuc6rAgamaMvAavs4yQvhRGhkrzAzRzUdB0+6G3zKA==","X-MS-Exchange-Authentication-Results":"spf=pass (sender IP is 216.228.117.161)\n smtp.mailfrom=nvidia.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=nvidia.com;","Received-SPF":"Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.117.161 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C","From":"Nicolin Chen <nicolinc@nvidia.com>","To":"Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, \"Joerg\n Roedel\" <joro@8bytes.org>, Bjorn Helgaas <bhelgaas@google.com>, \"Jason\n Gunthorpe\" <jgg@nvidia.com>","CC":"\"Rafael J . Wysocki\" <rafael@kernel.org>, Len Brown <lenb@kernel.org>,\n\tPranjal Shrivastava <praan@google.com>, Mostafa Saleh <smostafa@google.com>,\n\tLu Baolu <baolu.lu@linux.intel.com>, Kevin Tian <kevin.tian@intel.com>,\n\t<linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux.dev>,\n\t<linux-kernel@vger.kernel.org>, <linux-acpi@vger.kernel.org>,\n\t<linux-pci@vger.kernel.org>, <vsethi@nvidia.com>, Shuai Xue\n\t<xueshuai@linux.alibaba.com>","Subject":"[PATCH v3 10/11] iommu/arm-smmu-v3: Introduce master->ats_broken flag","Date":"Thu, 16 Apr 2026 16:28:39 -0700","Message-ID":"\n <b4344b8d30a75d5d8d0acdbd9f038d9cddb4147d.1776381841.git.nicolinc@nvidia.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<cover.1776381841.git.nicolinc@nvidia.com>","References":"<cover.1776381841.git.nicolinc@nvidia.com>","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-NV-OnPremToCloud":"ExternallySecured","X-EOPAttributedMessage":"0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"CO1PEPF00012E80:EE_|BL1PR12MB5996:EE_","X-MS-Office365-Filtering-Correlation-Id":"7f18b5f4-6b3c-493e-4433-08de9c10198a","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|1800799024|82310400026|7416014|36860700016|376014|18002099003|22082099003|56012099003|11006099003;","X-Microsoft-Antispam-Message-Info":"\n\th8/wZ0WnMrzk7tyGjFrjO44ziq1JtowcO8qrJvr2liKfeFIl114o/vSEYvKHvOH7CMxYCs3j9x6GzC+IJG5CV/Z3lBQ5ZaHmb4j6tSup1fB+3pB/E2QPQFAe2H640lq24QpuMwGy195eyM832Qm6yWCo1RnK0FmswVCoccDeZ275ilG+NPK3eYxAm1ha3M3mM/o+6jr3cBzICfEQSAdkOod1p3jX3Wl4ISlBYhz70R7lCQmFbqaXYBCXn1Y6yW3Xs8qrmfeLn8oxcxGYWdO8/qby0D7mhQ2fshAHClRL25tUkIlgCPqz7Wc0Y5jluRzGUHhMeHr7eWNc/E4BPLs+hdYx1xymFOiRQ0hANannaJ4DveoFZ4ZfBPUhg+kpzJHM9VBj8WEytHAUlMeGsbuYU+C6fy7bNv+tthojQGsgg7k18qIl0UrJkgy/JQYEgdG3NJiw7POr8cc+naxG+Avi/dJSoOu60mqS0dcXfhcPGMPiCFmc5peDHse9TXp0olDkkhOqyWMqe0dHIQj+8twBfj5UT6iH0KeGze0/3rIQCAj5cCcj6kOipDUTEyMfOIhqXsYXoye8emBl3VngcEGUek/tWZEIK57LSlg+EJ6W35Q2A6T4O/8JpskHtyDAKQfCDQeQh8WXDt22A1IKfPm1t9ZdmEI5vjtlhVS3xZ8zikvPr0lZ4yuVrntOsXHw6bGrpXVNBpG+2rbjqQGajB0hdcdR+JFutXzvqVKp+FDjnwEpHgS6lCP2xTjDMBOtoyYg/4PA6nZvL6oxRSpuIegoHg==","X-Forefront-Antispam-Report":"\n\tCIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(7416014)(36860700016)(376014)(18002099003)(22082099003)(56012099003)(11006099003);DIR:OUT;SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n\tvpJJ+3c+4nJnCG81mwHINtEH/cDkt0E6RbB7H1qynykpKINfr6xv4FLGLIHDrzAT409uUku3PxyMRGfjU8RF/Te6PQp7oybIEfpdq0enGJB0GLBlmqd/FGIKUkxmCB1/3glLuOpJA/vtM1sSAtLT+2U3a/C+nIwLEmLCw8mmuFWL+RrIeh13bBP0tKmdewNZagMCMU7KCl3Eq1AVjuIbdCK5twKsDy0WHt4BgozUu/X9dfmfexkhYCO1AuYFd5mOjQCIs2qpppNKN1JWgEeFdUOdDAvPncI+NNP4JvPz3Y/AKcz/H/SiZ2ROHhNgzoI/9lHnENLz1nsgB8SDJgBDXbaiLOmoo6KkBx4WzHwxB2gDJntvElE8ErfzqQpmMFkE66xlOO+822xUEhVQMFni9M5AzYQaPSwGMEHQPzdkR8vUtChmqg5CEXTYn+4tezkT","X-OriginatorOrg":"Nvidia.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"16 Apr 2026 23:30:09.4579\n (UTC)","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 7f18b5f4-6b3c-493e-4433-08de9c10198a","X-MS-Exchange-CrossTenant-Id":"43083d15-7273-40c1-b7db-39efd9ccc17a","X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp":"\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com]","X-MS-Exchange-CrossTenant-AuthSource":"\n\tCO1PEPF00012E80.namprd03.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Anonymous","X-MS-Exchange-CrossTenant-FromEntityHeader":"HybridOnPrem","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"BL1PR12MB5996"},"content":"The flag will be set when IOMMU cannot trust device's ATS function. E.g.,\nwhen ATC invalidation request to the device times out.\n\nOnce it is set, unsupport the ATS feature to prevent data corruption, and\nskip further ATC invalidation commands to avoid new timeouts.\n\nUnset the flag when the device finishes a reset for recovery.\n\nSigned-off-by: Nicolin Chen <nicolinc@nvidia.com>\n---\n drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h |  1 +\n drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 28 +++++++++++++++++++++\n 2 files changed, 29 insertions(+)","diff":"diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h\nindex 26e0ee0bb5b45..95bce9966374a 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@@ -941,6 +941,7 @@ struct arm_smmu_master {\n \t/* Locked by the iommu core using the group mutex */\n \tstruct arm_smmu_ctx_desc_cfg\tcd_table;\n \tunsigned int\t\t\tnum_streams;\n+\tbool\t\t\t\tats_broken;\n \tbool\t\t\t\tats_enabled : 1;\n \tbool\t\t\t\tste_ats_enabled : 1;\n \tbool\t\t\t\tstall_enabled;\ndiff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c\nindex 13f225f704e73..5dead82cf1186 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@@ -2523,6 +2523,10 @@ static int arm_smmu_atc_inv_master(struct arm_smmu_master *master,\n \tstruct arm_smmu_cmdq_ent cmd;\n \tstruct arm_smmu_cmdq_batch cmds;\n \n+\t/* Do not issue ATC_INV that will definitely time out */\n+\tif (READ_ONCE(master->ats_broken))\n+\t\treturn 0;\n+\n \tarm_smmu_atc_inv_to_cmd(ssid, 0, 0, &cmd);\n \n \tarm_smmu_cmdq_batch_init(master->smmu, &cmds, &cmd);\n@@ -2729,11 +2733,17 @@ static void __arm_smmu_domain_inv_range(struct arm_smmu_invs *invs,\n \t\t\tarm_smmu_cmdq_batch_add(smmu, &cmds, &cmd);\n \t\t\tbreak;\n \t\tcase INV_TYPE_ATS:\n+\t\t\t/* Do not issue ATC_INV that will definitely time out */\n+\t\t\tif (READ_ONCE(cur->master->ats_broken))\n+\t\t\t\tbreak;\n \t\t\tarm_smmu_atc_inv_to_cmd(cur->ssid, iova, size, &cmd);\n \t\t\tcmd.atc.sid = cur->id;\n \t\t\tarm_smmu_cmdq_batch_add(smmu, &cmds, &cmd);\n \t\t\tbreak;\n \t\tcase INV_TYPE_ATS_FULL:\n+\t\t\t/* Do not issue ATC_INV that will definitely time out */\n+\t\t\tif (READ_ONCE(cur->master->ats_broken))\n+\t\t\t\tbreak;\n \t\t\tarm_smmu_atc_inv_to_cmd(IOMMU_NO_PASID, 0, 0, &cmd);\n \t\t\tcmd.atc.sid = cur->id;\n \t\t\tarm_smmu_cmdq_batch_add(smmu, &cmds, &cmd);\n@@ -3069,6 +3079,15 @@ void arm_smmu_install_ste_for_dev(struct arm_smmu_master *master,\n \t}\n }\n \n+static void arm_smmu_reset_device_done(struct device *dev)\n+{\n+\tstruct arm_smmu_master *master = dev_iommu_priv_get(dev);\n+\n+\tif (WARN_ON(!master))\n+\t\treturn;\n+\tWRITE_ONCE(master->ats_broken, false);\n+}\n+\n static bool arm_smmu_ats_supported(struct arm_smmu_master *master)\n {\n \tstruct device *dev = master->dev;\n@@ -3081,6 +3100,14 @@ static bool arm_smmu_ats_supported(struct arm_smmu_master *master)\n \tif (!(fwspec->flags & IOMMU_FWSPEC_PCI_RC_ATS))\n \t\treturn false;\n \n+\t/*\n+\t * Do not enable ATS if master->ats_broken is set. The PCI device should\n+\t * go through a recovery (reset) that shall notify the SMMUv3 driver via\n+\t * a reset_device_done callback.\n+\t */\n+\tif (READ_ONCE(master->ats_broken))\n+\t\treturn false;\n+\n \treturn dev_is_pci(dev) && pci_ats_supported(to_pci_dev(dev));\n }\n \n@@ -4412,6 +4439,7 @@ static const struct iommu_ops arm_smmu_ops = {\n \t.domain_alloc_paging_flags = arm_smmu_domain_alloc_paging_flags,\n \t.probe_device\t\t= arm_smmu_probe_device,\n \t.release_device\t\t= arm_smmu_release_device,\n+\t.reset_device_done\t= arm_smmu_reset_device_done,\n \t.device_group\t\t= arm_smmu_device_group,\n \t.of_xlate\t\t= arm_smmu_of_xlate,\n \t.get_resv_regions\t= arm_smmu_get_resv_regions,\n","prefixes":["v3","10/11"]}