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.52.35 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796171941; b=mzWylQJWRKvgEbk0EjO7dfLZso3b+mM4w5P3Zv7dMSScID7ruQqf0B45A09Y1BylsQO6 HvRCxK8m3xT0jKcEASD2a4X/JDvzSxuvP4tTqz+dEdNGeEDtVOdYRsrxSvNKFRm1F6YUu 7L/IAFVJ9FW5HQ1CrIgZt7qzqfxNGvCfXeiEeHRxKxVqnpb3yTXUha3N8nyPJdBTXoG7u w0oCQQf1l/H94sCOpdZCa2KUkMQgOhoKaOiaW8JJvZKhoaBjTBtmUGOHBwNF/ybLswged VtKcdqQDrMHFjV6jON8DQZhfYbtld71mknQ63xMj1xURsCG4vyecFR5oRPBo3aB1u6g== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796171941; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To: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=N85jSXZiAAHmZPgIWHX7PDgF9m91RYiPBRd0xq3lLhs=; b=lPUfoAu27+FQy5pj88ff99wMpUbV6jlJqRGfC5brEh8h6Y3bePOtZypkBXMxEuYHH1QZ Jc19Q/iRaSzr2Vc/kBNoqswiSyk6X8o7e+dyp54fOsX6dxAnw9BDohyAETAzi9kQReI2D plujEFwlCsueJGN6ILdC86jPtkC14jeck2hvV7ry7qN3bhb5Y7FxuRJTdzDMh57J7lKda fCwDdQvNTdvPUgu+VuKYYupzfnxVzPdP6y8otmtjTqZCPEojGHUXqSzU7nP1GDuKGDWb4 SZ21xjAn16ntLpNihg0zugADQAb3hb+a87SlWDUoV9rF0B4HxnX0MJ+UEtav+3sESdQ== 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="Ku5lXRu/"; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.52.35 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011035.outbound.protection.outlook.com [52.101.52.35]) (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 9457E606A697; Wed, 2 Dec 2026 00:39:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9457E606A697 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=Ku5lXRu/ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NqM95FQ98/JIBXQsinVszZXISryiCySBymy7FWEPbx3W3B1RIbakIffZABdGjs2sbFladkJOxoUOiaIDJdAKZ1Wd/9OVK67UiVgaUaIA6s5iwfZnHfKIBHlCqeTHtsIdzcjLmevuzq5MIwDNzmzctRiWrxmxR6+B+7QNvVw1R3V2ZbbsQjNEzgBXqmV5QNXkw2taumWhV66FT7AyT+n5R2TNNDNuM2AgzVYpL5smaDIe0UZ5fdBP5ndC4PW05vvB863fvFB7UPGivYSufgfk7k6Nkuv/hqkM1N4m9HawfJtNELCLu7fAGMAbkiixt5+iCo6xH4NnTgnVBQB3PcH+Zw== 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=N85jSXZiAAHmZPgIWHX7PDgF9m91RYiPBRd0xq3lLhs=; b=qPKpAxxIT5jhoMJfQ0QBVlIQnIAuFbkzGkaJrn4XlgPFj6h/h7Fzk1aj+fK8FlkHvOTHEnBNUMcSp8orWxTQqL2jQ+mDl/kdehYFcm5xmBhUC5nUvjGuaajt1HvufiStQiR/v+16mZ8TsEFHbpPoH7SIBkKnUYq0wg95/UBW/hiW1jdXCQUg5LmDJyO3OdvMGu7FGMgFHK+53t/Q+z3nGlFGHx2nAoF/cuztswk0fCpeB56e+UZCP/eBhBYXfwBkBJAJEW3cxRy5EacQJdXj/p6uo3YEk1na0Xtf31d19qe0k2BJ8+HNi82u6puaSNgwPmu0Yz2R6i65NszKiay37g== 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=N85jSXZiAAHmZPgIWHX7PDgF9m91RYiPBRd0xq3lLhs=; b=Ku5lXRu/B9lUPa1xpltdIXbskk5HOAaESLXscOnLSem3NoimwV0ckWQkp5ZvuJJIHGvh1FqGIVP8qpjEJYasIuXd/6WjcbIQvcsi3uYzKqT4O7rTIIuCq38X1GLP9Od30UTMYDSpzF4p3juQqyvtCkLJDLeX1WW4N8jONTDTya4= Received: from PH0PR07CA0004.namprd07.prod.outlook.com (2603:10b6:510:5::9) by IA3PR12MB531186.namprd12.prod.outlook.com (2603:10b6:208:714::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.7; Wed, 2 Dec 2026 00:38:57 +0000 Received: from CY6PEPF0000004D.namprd03.prod.outlook.com (2603:10b6:510:5:cafe::87) by PH0PR07CA0004.outlook.office365.com (2603:10b6:510:5::9) 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:56 +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:56 +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:54 -0600 From: "Nikhil P. Rao" Date: Wed, 2 Dec 2026 00:38:25 +0000 Subject: [PATCH net 4/4] ionic: fix ethtool coalesce updates racing a PCI reset 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 Message-ID: <20261202-b4-pr60-v1-4-b1f6706e065b@amd.com> References: <20261202-b4-pr60-v1-0-b1f6706e065b@amd.com> In-Reply-To: <20261202-b4-pr60-v1-0-b1f6706e065b@amd.com> 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_|IA3PR12MB531186:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b9171c2-ad3b-45d8-2c7a-08df500ca5f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|23010399003|1800799024|376014|82310400026|261102123227099003|56012099006|261026140227099003|10067099003|261021135927099003|261021121427099003|261028144727099003|261022075727099003|261022105027099003|261026121527099003|261009223027099003|22082099003|18002099003|11063799006|5023799004; X-Microsoft-Antispam-Message-Info: m3FkVwxPi2+p3ksnKz8EVOoJLMq5rTg0Qv2PDujQbh/2xBSt2pX0uzkkZXU3YQ1db1EnJwlsph/fJ0LI4f1jR9j9CF6mr5LzU6w99Kpmq7iNxZVMfqFwO2DLqwT+ma/h0BJCSYEd+VpJHgSy5JiapzslF+eLwCovpO8eJzl1dADzoFeq+TbgMiSvzn2oIVotn+fQC5YxbEN9zxM4hGaRedlqgmDa5hV1ePEQbdh2FrObvu37lkge+gxGsXjU2vICX9FjXmdq2UCPZZMVrdWWY3i7IHtkaAsCnzNNxThZfKe8DQWaLcG3f5G4QpreghKuPyMvjuHEUSUEwEqiphp/3TUaPW7yfK24RsT2XZdsjyDa5lEawWTNjcBCsEZHJ20jHl00a96RQ3cl2aSKFRFyt7hkQcBAa5G5uNboXniKMnbs7J4oI4HuHAFUHZGhZ5wAED6rds4SqbeeJ7Bn93+ZZ2M7hBT1NJY0wiV6ckvvzYnCaY7QFUfiU0sjtXnWC7U9XkKbYIjU+ecQjsyVGPD5os0/2IuYuwo+iADbsfxIXIs7dI/OQ6DrBG6IKX4GAF3qXVoTneshgvDRp7CGpK1HJXGEz0QsUSIpZT1uq84QYsEiTdNJE7paI2I+0WEI0e9WHMdrtFs0zbASUbCRjKYP+0BBNKe030s+fAmbaHvVlbXnfW9RzMbZn0FiSD5Du1guXi59DdLnIYfsJNZc4tYMYQ== 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)(36860700016)(23010399003)(1800799024)(376014)(82310400026)(261102123227099003)(56012099006)(261026140227099003)(10067099003)(261021135927099003)(261021121427099003)(261028144727099003)(261022075727099003)(261022105027099003)(261026121527099003)(261009223027099003)(22082099003)(18002099003)(11063799006)(5023799004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZPlSIbO2w2VSjP4ZzJiO4pX5oAie51mjgYk/u6hAMTlJGNY90I2eLFKXEp3T+3xetfr8capDtQMw5Gf9/CvbOgjBmz8j2FEIjR5aEFoovOlDwVz+Q8D8dyk/jnlMKUfV39FBUGBw+csqxqXWiMs3O+42duX55xntoEt8Us/59VrBz9Oe4PmZLgnM0kWIiI4cIKRDBH2tdJiD0V1utEolBwV38rLCJS6XNdyOqshcJIAh6yzZA+SFo9FzPkXoXmIe8qGTI0awxNvtEpYrGIHc3/BqLpF+5YioELJ0oXZJddRCt46HC8SGMigWQw5/YUProNjKRbCvd6Cvkq/EuWiYktkedFPZXC0+cToCT4t46hdUL9uaQExYeH5dxbH4j6VtbbrRGWBCRTWo4zWEj+NSTVfbrEU/6332jzHfzIlC8F9l55yfzj2wFOVaKnzo+DOw X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 00:38:56.3320 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b9171c2-ad3b-45d8-2c7a-08df500ca5f7 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: IA3PR12MB531186 ionic_set_coalesce() runs under rtnl only. It saves the new settings, tests LIF_F_UP and writes each queue's interrupt control register in BAR0. A PCI reset clears LIF_F_UP, frees the queues and unmaps BAR0 without rtnl, so an update that passed the test just before the reset reads freed queues and writes the unmapped BAR. The restart after the reset also programs the new queues from the saved settings without rtnl, so it can pick up a half-written update. The teardown and the restart both run under queue_lock, so take it for the whole update. ethtool's ring and channel changes already take queue_lock under rtnl. Found by an AI code review of this series and confirmed by reading the code. Not reproduced, as there is no call between the test and the register write where a test module could hold the update. Tested on an AMD Pensando NIC under KASAN and lockdep with ethtool -C running during 30 PCI resets. Fixes: a79b559e99be ("ionic: add FLR recovery support") Reviewed-by: Brett Creeley Signed-off-by: Nikhil P. Rao --- drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c index 1360a3dfb7c6..bc0601dbcf63 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c @@ -555,6 +555,8 @@ static int ionic_set_coalesce(struct net_device *netdev, tx_coal > IONIC_INTR_CTRL_COAL_MAX) return -ERANGE; + mutex_lock(&lif->queue_lock); + /* Save the new values */ lif->rx_coalesce_usecs = coalesce->rx_coalesce_usecs; lif->rx_coalesce_hw = rx_coal; @@ -598,6 +600,7 @@ static int ionic_set_coalesce(struct net_device *netdev, } } } + mutex_unlock(&lif->queue_lock); return 0; } -- 2.43.0