{"id":2224150,"url":"http://patchwork.ozlabs.org/api/patches/2224150/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/c90693e75c0610da38103a683b558d5596bd843b.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":"<c90693e75c0610da38103a683b558d5596bd843b.1776381841.git.nicolinc@nvidia.com>","list_archive_url":null,"date":"2026-04-16T23:28:32","name":"[v3,03/11] iommu: Add reset_device_done callback for hardware fault recovery","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"b4e92eb8071670af023adfa313b28434712d0b7d","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/c90693e75c0610da38103a683b558d5596bd843b.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/2224150/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2224150/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-52662-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=LAlxWFwh;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-52662-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=\"LAlxWFwh\"","smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=52.101.85.39","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 sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::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 4fxZBB0bz5z1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 09:35:14 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id DA50F314CE5D\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 23:29:21 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 843D73A0E88;\n\tThu, 16 Apr 2026 23:29:21 +0000 (UTC)","from BYAPR05CU005.outbound.protection.outlook.com\n (mail-westusazon11010039.outbound.protection.outlook.com [52.101.85.39])\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 1F9363A1691;\n\tThu, 16 Apr 2026 23:29:19 +0000 (UTC)","from BY5PR17CA0065.namprd17.prod.outlook.com (2603:10b6:a03:167::42)\n by SA1PR12MB999254.namprd12.prod.outlook.com (2603:10b6:806:4dd::21) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.20; Thu, 16 Apr\n 2026 23:29:17 +0000","from CO1PEPF00012E7F.namprd03.prod.outlook.com\n (2603:10b6:a03:167:cafe::26) by BY5PR17CA0065.outlook.office365.com\n (2603:10b6:a03:167::42) 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:29:16 +0000","from mail.nvidia.com (216.228.117.161) by\n CO1PEPF00012E7F.mail.protection.outlook.com (10.167.249.54) 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:29:16 +0000","from rnnvmail205.nvidia.com (10.129.68.10) 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:00 -0700","from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com\n (10.129.68.10) 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:28:59 -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:28:55 -0700"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776382161; cv=fail;\n b=Ry4/t0Lqg04AIabTM0ql4O+MApePkvE5acHsS7BKjPLtXupW5FUwTh6INxz2nElV81PM78lHQ7T72ircot4Df8KhBSIKCmNF8FMxvCuGZFy6Joc+0sxJ2d3F2Cc61pwD4rhsssDA+QpTkNzvGf2162Yf+jjHeZCOrgoGDpgbFH8=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=yLsbqCtS9IwEg0v7J7RlUez/Fniqvodw/68rm4JAO5t2akwSCRgfPOonIU1a+BMvdduk9r239Nva5ecz86rttgrcljfQ0lh8878OwlNCeK+ApgVeawQqO9is2HV/h2RrQLtsd/bV+Xj43sBf22lc9HRZ4V2D5k7TWPE9/oUpHP5DTtWzT4zzVnHWLTXpnllbSaoeSJJEyod+BnstTNQc/gu4KeiOz6qpTqQK2VxEt+lFmdPIm8gCeC/D2JOMDUo3zxsZ7aFf/sweySbrRqRSXY3ZQUvzyv+nPq22b8IHn1J3QfNM69rQ4oNDRR8mhAE0JKAxGme/54+9+EXVY/xrmg=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776382161; c=relaxed/simple;\n\tbh=HyJBoyIkzYUYxX8t32ECAJaiApwKhGAjebHUviGRV2Y=;\n\th=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=bmdHYmc3hsvYUPpolyyWsmUmQpSIif6v+nzFdN7r5+l2zUQoWsviwXBR+3e8OSvf1hNXWXuz9rRFyM9ZfdkueoAviKlEZjSkjD/QIsdu1MZ29vuaoT/KSgI+nSv7nlWLJHecwP2R2OthDX1wnBpJAtsVcj3BsC6sN3+RVJmx0IU=","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=k1Mj1LBauyDdAO7B4BYNXH35KS6f5YoBnRkjbDINpVU=;\n b=AHzPaEZvrzPLfzOkpZsJ0Ya7la6EfqtKJQm/UBO++M4ljbKuua470Q3AKZUh/ILexOhpZHWQGVDr9Jx2Xaqp8fzqx58CBoEnzVrO+ELEw7KmidwrXEycLf3NUtf7S8xNAtIUPEml5bsgO3F6X6dEXjONr/LHwYytiLMIVHNpSECpVhIiJOUpZH+K8n6FPmhL5+yLR0H6ogS4Lj4kYZeyTRdxzaXm6tLPuP3u1N/t5fYIIDakPbOVqZybJy8POIb74O2GbaDHNuVcVl2QCgLSz5j52AIf0kOBrQPpfNdcavQtqyocB+6u9dFaJ36ntyOcAvVkvF0ZdDla5w3AoXqfvQ=="],"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=LAlxWFwh; arc=fail smtp.client-ip=52.101.85.39","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=k1Mj1LBauyDdAO7B4BYNXH35KS6f5YoBnRkjbDINpVU=;\n b=LAlxWFwh5KjmkXCDMxUtHoUCM5MCr5CoNKz3ZAH8XMxnss4/5lVt+lhp0706oRBXQlNCnpekPy2yzOwrueZ9Y5UNeHTKkwOhwiJK1qy8xrwvGzdVQOUIkk8Tb55OQW/iMxs8PxviSq9lcxnxys4I6WmFXXGGUcjmdlAek/QB31A13PO12q+O9j+HyKtCpEF/EQHBnxVc919i66f7rpd3cxmM9iME9eCjEUMKGlGtLDPtdETr93Zo91zbaKOHfuoWfc+n28cSUlWo9VUiQDgC/TvyrCdjsqH/M61aBVsn++Ft6DEbcj+n516Ep490/cHIiFKB6cljxkI15/dmD8F90A==","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 03/11] iommu: Add reset_device_done callback for hardware\n fault recovery","Date":"Thu, 16 Apr 2026 16:28:32 -0700","Message-ID":"\n <c90693e75c0610da38103a683b558d5596bd843b.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":"CO1PEPF00012E7F:EE_|SA1PR12MB999254:EE_","X-MS-Office365-Filtering-Correlation-Id":"28176e69-ce49-4ae4-eea3-08de9c0ffa0b","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|7416014|376014|1800799024|82310400026|36860700016|22082099003|56012099003|18002099003;","X-Microsoft-Antispam-Message-Info":"\n\tRHXSxaU+/ahkQGbw7rsLod1xXamHmpKclaIwJfaBI/NPetf8rSHjSg0EJppclzeMQVS0oQeIFmOX1sepJG12mMXYlhIbq9lPYl30TGuSpZJfYG5vCfQdAADuu417ciFRbAxZIotEsS9v57Nd0MzaoTm4CF5cmFvC/Xe4bqCoJyJU5jK11J6B3K3dwgx2pEPAqgz+catmOPxz8qzYVhuejRzAn6Zzsf4cJUVr7z4pSIRnK2jAgXFFHq4mrxgi+qboioa8pZYdaU6qyvuE91cssRmysx8JgJC7Ko84RurhNHwg6TQ4sIui0aWlcW8Yk7ZKlIeh4M6EOAxlRepW1IeEZUTCDhphSVwrhrDQy+v8gNOHZtNGzLXTOZjRH87DqqjyRZtzaluJlKVqFsYWDzlcVsSoR4LR3RpfKUPnvKl6nOvK6BTgpf7TVp5oQkHbXZxp4bl3MJQYvrYbsv2I6VwJ/UMzd5b6uVEWm9NBaIyHJ5InJdFjx2OWrzkVDqqrDeHPadyR6EOW89DNvbESwgB943mqd5dAYnwaSx03sB0bTpGTQ4F9kg+ipmLQrYW9lVac5VjTkKweKSXgAV2b/J49syIwNSE45KNu3qIy9KG+oRDwmHoOZHNVptLrSrJ1QOLfzK8ke7nr2mnlVFOXQ4bvMSGHdo6MgK9Zf7QkQoSsfBClRmcJ2JujLrgm3NhVo7YVrrbLqWBsZibsb+pXOSSkz5K7HPUOV9GBSG587EWoPqcD+A+9hQ0snTmUBEUNoQkNAP77EDGEbBfJHOOe/X/eSg==","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)(7416014)(376014)(1800799024)(82310400026)(36860700016)(22082099003)(56012099003)(18002099003);DIR:OUT;SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n\t5wVyJpGHSORQ2Eh/pNsSTi6EL1PKrQiUa1khw7wv3S9FgyLjZ+7J6+WHxwZhBY7ADefoIRUxrSGV08FxsDYvcWxpgmYqqsw7aD8/VWKwKtLzDpfCnDDxt+uFqgTLH8lCP5YsIlxI54HXnjkwLVWbc3s6HvlJq28cRdhddvsbv586dbiUPmU7RN8P4vdk/E/WOKQTYuyt1Ww5h2dcN2hfO7ypkxa6Tnzg/fTp5k/CUDzKhSvLzfaaHDVdBAB4oacykgsaRAvo1z+Ao0leYk+xX7qA2e/F1Zixm/1iWNderKfuDUkxVhvlbg16L7nVo37p5cctebxeOjqpQo/vvj/xs5XbGKT6obTjwYFCH45olRbg+lDK5Nayzz85Zh3p1izR3wVyx0wcX0H7K3KkduzgKp4FHs5EBro1A6mxUHq0p0hwRx3P6z+Z7JqZUJcGiFR9","X-OriginatorOrg":"Nvidia.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"16 Apr 2026 23:29:16.5769\n (UTC)","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 28176e69-ce49-4ae4-eea3-08de9c0ffa0b","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\tCO1PEPF00012E7F.namprd03.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Anonymous","X-MS-Exchange-CrossTenant-FromEntityHeader":"HybridOnPrem","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"SA1PR12MB999254"},"content":"When an IOMMU hardware detects an error due to a faulty device (e.g. an ATS\ninvalidation timeout), IOMMU drivers may quarantine the device by disabling\nspecific hardware features or dropping translation capabilities.\n\nTo recover from these states, the IOMMU driver needs a reliable signal that\nthe underlying physical hardware has been cleanly reset (e.g., via PCIe AER\nor a sysfs Function Level Reset) so as to lift the quarantine.\n\nIntroduce a reset_device_done callback in struct iommu_ops. Trigger it from\nthe existing pci_dev_reset_iommu_done() path to notify the underlying IOMMU\ndriver that the device's internal state has been sanitized.\n\nSigned-off-by: Nicolin Chen <nicolinc@nvidia.com>\n---\n include/linux/iommu.h |  4 ++++\n drivers/iommu/iommu.c | 12 ++++++++++++\n 2 files changed, 16 insertions(+)","diff":"diff --git a/include/linux/iommu.h b/include/linux/iommu.h\nindex d3685967e960a..3c5c5fa5cdc6a 100644\n--- a/include/linux/iommu.h\n+++ b/include/linux/iommu.h\n@@ -626,6 +626,9 @@ __iommu_copy_struct_to_user(const struct iommu_user_data *dst_data,\n  * @release_device: Remove device from iommu driver handling\n  * @probe_finalize: Do final setup work after the device is added to an IOMMU\n  *                  group and attached to the groups domain\n+ * @reset_device_done: Notify the driver that a device has reset successfully.\n+ *                     Note that the core invokes the callback function while\n+ *                     holding the group->mutex\n  * @device_group: find iommu group for a particular device\n  * @get_resv_regions: Request list of reserved regions for a device\n  * @of_xlate: add OF master IDs to iommu grouping\n@@ -683,6 +686,7 @@ struct iommu_ops {\n \tstruct iommu_device *(*probe_device)(struct device *dev);\n \tvoid (*release_device)(struct device *dev);\n \tvoid (*probe_finalize)(struct device *dev);\n+\tvoid (*reset_device_done)(struct device *dev);\n \tstruct iommu_group *(*device_group)(struct device *dev);\n \n \t/* Request/Free a list of reserved regions for a device */\ndiff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c\nindex 28d4c1f143a08..df23ef0a26e6c 100644\n--- a/drivers/iommu/iommu.c\n+++ b/drivers/iommu/iommu.c\n@@ -4071,12 +4071,14 @@ EXPORT_SYMBOL_GPL(pci_dev_reset_iommu_prepare);\n void pci_dev_reset_iommu_done(struct pci_dev *pdev, bool reset_succeeds)\n {\n \tstruct iommu_group *group = pdev->dev.iommu_group;\n+\tconst struct iommu_ops *ops;\n \tstruct group_device *gdev;\n \tunsigned long pasid;\n \tvoid *entry;\n \n \tif (!pci_ats_supported(pdev) || !dev_has_iommu(&pdev->dev))\n \t\treturn;\n+\tops = dev_iommu_ops(&pdev->dev);\n \n \tguard(mutex)(&group->mutex);\n \n@@ -4105,6 +4107,16 @@ void pci_dev_reset_iommu_done(struct pci_dev *pdev, bool reset_succeeds)\n \t\treturn;\n \t}\n \n+\t/*\n+\t * A PCI device might have been in an error state, so the IOMMU driver\n+\t * had to quarantine the device by disabling specific hardware features\n+\t * or dropping translation capability. Here notify the IOMMU driver as\n+\t * a reliable signal that the faulty PCI device has been cleanly reset\n+\t * so now it can lift its quarantine and restore full functionality.\n+\t */\n+\tif (ops->reset_device_done)\n+\t\tops->reset_device_done(&pdev->dev);\n+\n \t/* Re-attach RID domain back to group->domain */\n \tif (group->domain != group->blocking_domain) {\n \t\tWARN_ON(__iommu_attach_device(group->domain, &pdev->dev,\n","prefixes":["v3","03/11"]}