From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.46.39 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796171938; b=gKgL4VW2ZCiGUNHquMp5z3mBi5ktWltjI5JCVGizn9Vh3AA2SyJSVqDtizlEPgpy6O5b FQI+sA7lA7KjT8F2P54FtJyuEKR4SyjnjdMOK9nhnk6eS3bvg07E0eKTgyxPo2HQNyhKR xk2JpF/BBRiZUbhYWCwSILAa5okboMJdtVpGFyTiFZxIpbHSsAJaw1zjqOyeGc5Sp0HrT DshGGEJBTXy2LQIABTt1PZQ2OXg2XiVqWOBehWiSyWnaeEuAhA7HcSlwj2V8MrdX8EycO eD313SbG3FYflfOpsv/YkibiecJDvExq+Y2370o7p6jNUdsCY/IuC9q98bJXHtE6n4A== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796171938; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: From:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:CC:X-Mailer: X-Originating-IP:X-ClientProxiedBy:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=shHTzLpV8dIulj1NgZICh5/m+qgffuRG/iknFVPhwEg=; b=RftpuSkYhDXOLyAZRcYkrsdkuEx3Qp2Waa9q+5zHvMr1546bejiSbcO4N07Qz9IX3QF4 CPVElgLge8qDEEapnoBJP8B3tdOG218s9l2TCv85qgUbyrnuXu99JIwSD/bvc2hB/amKn AH43lp+Cbo/SsrUfB749vHe0k8CQ/NibfwCNoPxxrmOSf3Q+8WVPpPtDXL0l9e96v2pT0 3GN0p6doYIkE7AsisL7T13Q2sboIJfqzbXyCfujol/2N6INVHEyMHTRdiarlm7N5hb2MN bL12eJA+R9nHTYz8+e1//lLJruDZtK8iuibCWWpNrBRy8R3+uJZyx5udyABsJe7J6Qw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=RoZNw8EW; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.46.39 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11010039.outbound.protection.outlook.com [52.101.46.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 419B1606A31A; Wed, 2 Dec 2026 00:38:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 419B1606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=RoZNw8EW ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UpSy29NH+E/K7fhC/Vl56eWA6j1b6RqzyFu6qR1hx45wcpmTUZgXyzkyiK+bgZtKjaQ0Po6l8a9t8+ZMOthcdvus/bd5eImqbav1Je0ILyWnujYVsLMRTAcOMEjJ58IPbaO3e88+aJV1mACYdZr1OmpYAK+SyILGf4Ku9Xyj8zs/Z1zxsftgZqYsNvqZLlGeV4BTRVkWiaAO2xjZ/UT4kcB13uxCQnRDpZtHuNzx0+3GmtcPLYw/BEEbysxJKUW+idi0GLeq+N9z/wZQS3feKhkc5PrmtEn9x1MUbJnwKps8NG3O8nu1qBkTC5EtsRK1A2O/17tQvUY0qHHrxuY+rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=shHTzLpV8dIulj1NgZICh5/m+qgffuRG/iknFVPhwEg=; b=waA8NzshOdSI5iYXUoxfqy1/BoUIch7/0QyiYMqSzXiF/Q5v9R4nnU9Vzd8dkS7zOqUTd/zyJZ/IsRIz2x/L+Ty4lsYhYwlYc+upLGdisrrkNlsOhF4ha4ZuIvKIfvVwnW37SgFyU5a/WlNak+P+/8OZ1X5J83sbB+sAROJpIVnNQ8U1IarUMrhfkkfSIvdQ6yvolNUB5kqsj9h8IRVt1vQCaU1Fs8sDg5RJV4cwbGY+Sbxp7PdlmMIX290oEn1M5D81/WiTQvUS9BLakkrZYyVBUi50yDJtkxOtAw3/2eZOKOALM37eKecCDDnkXEr4qjhc4dWUc4ADPONfNpzqDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=shHTzLpV8dIulj1NgZICh5/m+qgffuRG/iknFVPhwEg=; b=RoZNw8EWJltLZI5Kl4Z8xV+mh+x4//bO2M0Gs5q6qqrC316zMFGBVD9OO5fxVVQXWlBkftYKZRl+By7BApKh3jieV2c8lihY5vWw9PlnolW9VPUrZ0i7E7rGu3wQRzQ0dIT5+wJK8rHPaE6LihVY89Lw1pMcBSMYjw3ViUNG7B8= Received: from PH0PR07CA0008.namprd07.prod.outlook.com (2603:10b6:510:5::13) by DM4PR12MB6616.namprd12.prod.outlook.com (2603:10b6:8:8e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 00:38:53 +0000 Received: from CY6PEPF0000004D.namprd03.prod.outlook.com (2603:10b6:510:5:cafe::62) by PH0PR07CA0008.outlook.office365.com (2603:10b6:510:5::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Wed, 2 Dec 2026 00:38:52 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CY6PEPF0000004D.mail.protection.outlook.com (10.167.247.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.3 via Frontend Transport; Wed, 2 Dec 2026 00:38:52 +0000 Received: from [10.11.96.223] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 18:38:51 -0600 From: "Nikhil P. Rao" Subject: [PATCH net 0/4] ionic: fix register reads racing the BAR unmap on PCI reset Date: Wed, 2 Dec 2026 00:38:21 +0000 Message-ID: <20261202-b4-pr60-v1-0-b1f6706e065b@amd.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAH1oD2sC/yWMyw5AMBQFf0XOWhP1qMeviAV1cS1KWkQi/l2xn MlkLjiyTA5VcMHSwY4X40GGAfTUmpEE954RR7GSUhaiS8VqVSSyoS8SXSpFeQtfr5YGPr9TDUM bml+6vZtJb+8D9/0AdUUpJnAAAAA= X-Change-ID: 20261118-b4-pr60-5fd83c966e7a To: Brett Creeley , Andrew Lunn , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni , Richard Cochran CC: , , Eric Joyner , Abhijit Gangurde , "Allen Hubbe" , "Nikhil P. Rao" X-Mailer: b4 0.15.2 X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY6PEPF0000004D:EE_|DM4PR12MB6616:EE_ X-MS-Office365-Filtering-Correlation-Id: b9fa07ac-ff62-4deb-58c9-08df500ca384 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|82310400026|1800799024|376014|36860700016|11063799006|18002099003|6133799003|261009223027099003|10067099003|56012099006|261021135927099003|261021123027099003|261026121527099003|261021121427099003|261028144727099003|261102123227099003|261026140227099003|261022075727099003|261022105027099003; X-Microsoft-Antispam-Message-Info: G5qwWuUdT1i73pBhYaxXNynW3C3cexfXxVpOiIC9XTizwC/LRV+VFa2CIjsg9lH85SbJe58wIWicEqMluvk4qjPWj65VKHgZRpcKUWO2jA/I1sQH6GTYpf6XJEfI7wnuiBbiRGNrBoBXbiDxGSNX59pm1Happc2lCT+oTOteWCC3pr0QFBL61okRGwCPxxZIdH2DQ+elgXzbKACK0MvisxtUy3jf+KEMhs+KgEObjxVFKqQa6F6GcZobEaFAtlIH6zwoy+D+sV/rvEdMSb7CGeHZL/HyRSO+XQvJYfuv1x1smOrKrMU0Yc/Pi0q0KG9IrDC4GNbRzAIdtGFkEW9iRwV2JdNKEGG+gbs7E4AyijXaxOl+4AIrldBlozaW3zcFA+YO8ZWM17DLnRQRSgdhrLmv2ya2TL6YYjHw/4pE11W37txeXxbLBfiXylUg2qb5EAnuw1Kol7+JHbbyc6tSu6FaegUuIzAwvMPqsMvQ3C7NVP9sgqDEsC73IdMnOEWIDOudI4An9nE3NVP2gUHG6cFfucTZVr173rJ0uFjGWP2mI0IKCx6amvwDD6uu9kt+JZZ1SV0qWir4bV39Ff4khP61I656s9R+D/o2hyPds3Sgb4BCbcHthhYQ1j9wEJBuJJgT22sJ7GSrfwUJ4/AjV+e27oHRUEkMc2Zk5+KLnxIKo76wPE75uLFjPkTLM+TSCl8lv5DOX+sNgfEyf+/q2w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(82310400026)(1800799024)(376014)(36860700016)(11063799006)(18002099003)(6133799003)(261009223027099003)(10067099003)(56012099006)(261021135927099003)(261021123027099003)(261026121527099003)(261021121427099003)(261028144727099003)(261102123227099003)(261026140227099003)(261022075727099003)(261022105027099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PWH0+yuoZW2HmCb+vwsmN1/GGTJqRldJeLkKuW5cbSKZC6Gk/iUtyUPYJZC60SAzJcNDsFQTzBsskBoVSqDvBoSa8ObsN/EpvFU5T/53xgklDk30Hx/4UjHquC4+T1iDvaS/YqBY4vm8COIggs3YQxYZaXbFKqGtw7buLvODdL7eICDHX9AzPXzvE4xm2bWJq3ComErhaZrgck887U65oS7LYiqwGx6RALz5tGVaov7IqoWrSEacPGOGgDpGNThkV/c9dX51q7PWjL/a+8n8Gc5u06ZT5PUTd/kH3w5UeeyhUteGUhJiMGJALbJsproXlNNRwvteDLdyrzjLuKgGcCOUfbKh7T0pLn09hng1u67KiIFLDeAU6T3u8klrgYuonP43yOUVvQAl97S9DleahbYqmC+AWw7LrFfYx51CwBdgmE5bRiup4EyDwCdJ/E4Y X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 00:38:52.2211 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b9fa07ac-ff62-4deb-58c9-08df500ca384 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY6PEPF0000004D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6616 A PCI reset of an ionic device runs ionic_reset_prepare(), which ends in ionic_clear_pci(): it clears the driver's pointers into BAR0 and unmaps it. Several readers test one of those pointers and then read through it without synchronizing with that teardown, so a reset that lands between the test and the read makes them access the unmapped BAR. This series closes those windows. Patch 1 clears and sets the device command registers under dev_cmd_lock and takes the lock in the two readers that did not. Patch 2 turns the lockless device info readers (firmware status, heartbeat and the ethtool register dump) into RCU readers and has the teardown wait for them. Patch 3 clears the PHC counter registers under phc->lock when the reset starts and has the PHC operations check them under that lock. Patch 4 holds queue_lock while ethtool -C writes the interrupt control registers, so the update cannot race the queue teardown. The races in patches 1-3 were reproduced on an AMD Pensando NIC under KASAN by holding the reader between its check and its access with a test-only kprobe module while a PCI reset ran: without the series the access faults on the unmapped BAR, with it the reset waits for the reader or the reader backs off. The race in patch 4 was not reproduced. The series was also run through 30 PCI resets per test under concurrent ethtool, devlink and PHC load with lockdep enabled, without regressions. The races in patches 1-3 were found by Sashiko and the one in patch 4 by a Claude Code review; Claude Code was also used in developing and testing the fixes. Signed-off-by: Nikhil P. Rao --- Nikhil P. Rao (4): ionic: fix devcmds racing the BAR unmap on PCI reset ionic: fix device info register reads racing the BAR unmap on PCI reset ionic: fix PHC reads racing the BAR unmap on PCI reset ionic: fix ethtool coalesce updates racing a PCI reset .../net/ethernet/pensando/ionic/ionic_bus_pci.c | 21 ++++++++++++- drivers/net/ethernet/pensando/ionic/ionic_dev.c | 34 +++++++++++++--------- .../net/ethernet/pensando/ionic/ionic_ethtool.c | 18 ++++++++++-- drivers/net/ethernet/pensando/ionic/ionic_fw.c | 6 ++++ drivers/net/ethernet/pensando/ionic/ionic_lif.h | 2 +- drivers/net/ethernet/pensando/ionic/ionic_phc.c | 20 +++++++++++-- 6 files changed, 80 insertions(+), 21 deletions(-) --- base-commit: 0e4c3240b03093264d501ab24c65726d29921987 change-id: 20261118-b4-pr60-5fd83c966e7a Best regards, -- Nikhil P. Rao