From patchwork Thu Feb 3 18:40:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yannick Vignon X-Patchwork-Id: 12734569 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ED03C433EF for ; Thu, 3 Feb 2022 19:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353668AbiBCTGa (ORCPT ); Thu, 3 Feb 2022 14:06:30 -0500 Received: from mail-vi1eur05on2066.outbound.protection.outlook.com ([40.107.21.66]:52993 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1353655AbiBCTGa (ORCPT ); Thu, 3 Feb 2022 14:06:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SJf2z+yeNuFR+k9TgadnobY0xdxT6nv0SB+Xsyv08VFPuK3HxtI2o8oGLvJ+sUQJTR+yf1ctvHBv0rVLaI6uWIKFpOq279DO5zkbA5Nvrxc1giz8/XT/Aan5AoTwEQYAem1KZrG9BPmsvSjQwspfcJot5umqqChSibSO8FVGo/bW0UbRTxEAyaShLT5sjhmLT8dEIUZfD4JkiabA+dNbYKVAqhh3F8NRM62fD/kAJhhjeapIVvixW60cD07zNGdAkWZn5Z4rv/Ak89lYqq3cVdlH6x1eo5L1q115tuwcxcWmWPg7L/85htdOb0HLxCeIRFgH7G1NqmJfJreZlsKNpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Jr2AvyhVaAASDgwi/uwdp/o8N6yOwinn6cQyl1GSvp4=; b=R+72oikf4XEXCWN6kqN+MmD5LlPOLFWLjPR8nwMkGWt990pmWEBLiqvASsLjhh7sM8bjTNL3DD8SE2UEH7WdGC1XHBIhVrNfoDk8FamTGlF9HabITe4ndgCtl848/N2cZo/kTgW6cmoRcRLsZgJh3sozeKdYqpfPBPTHn/FxOmicuOU7y49v70xL/IJQPpJwJpeShsTIxaXzQ89Lr6jQzqZRY2f6bxWqC2E3+MF7zMB+dLlckL/3C54cyIxAh4E44SP2J1+CcmGDbPOSWbgF8RTT+bQREDSIx2K3a9Z+W+uppLVsi2Cx4ioTRLo+SAC1J+Ct3x4wrwOE/QvbAdCqdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jr2AvyhVaAASDgwi/uwdp/o8N6yOwinn6cQyl1GSvp4=; b=Xix6U8yzO27lwNeWjnuGxkrDloUUkAeyPVAH6UhZKwJ5LByXNPrCNGsfipogz3rzyH9kPUyiHGBxpk/So+BrRS4jF93RdbIeBCUdQMc7naMa2zJu8Yu2Qim7Af0OoK3lbE4/NuZzQk99Cr9vjuKZVoSz9WzaqMYWDGUfb4FLd8E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU2PR04MB8807.eurprd04.prod.outlook.com (2603:10a6:10:2e2::23) by VI1PR04MB5408.eurprd04.prod.outlook.com (2603:10a6:803:cc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 3 Feb 2022 19:06:26 +0000 Received: from DU2PR04MB8807.eurprd04.prod.outlook.com ([fe80::9484:131d:7309:bd02]) by DU2PR04MB8807.eurprd04.prod.outlook.com ([fe80::9484:131d:7309:bd02%5]) with mapi id 15.20.4951.012; Thu, 3 Feb 2022 19:06:26 +0000 From: Yannick Vignon To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Coquelin , Eric Dumazet , Antoine Tenart , Alexander Lobakin , Sebastian Andrzej Siewior , Paolo Abeni , Wei Wang , Kumar Kartikeya Dwivedi , Yunsheng Lin , Arnd Bergmann , netdev@vger.kernel.org, Vladimir Oltean , Xiaoliang Yang , mingkai.hu@nxp.com, Joakim Zhang , sebastien.laveze@nxp.com Cc: Yannick Vignon Subject: [PATCH net-next 1/2] net: napi: wake up ksoftirqd if needed after scheduling NAPI Date: Thu, 3 Feb 2022 19:40:30 +0100 Message-Id: <20220203184031.1074008-1-yannick.vignon@oss.nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: AM0PR10CA0070.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15::23) To DU2PR04MB8807.eurprd04.prod.outlook.com (2603:10a6:10:2e2::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b46b94be-dedb-4e01-0c28-08d9e74846a9 X-MS-TrafficTypeDiagnostic: VI1PR04MB5408:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6a7fNcOHop+E14NH3l1XRCB4jYz3HMzqZeaxCR/KLsrFVZfHXuYc7DO0xAdQZGvPgt32wXxcTFl39EVI8n184AiqS/2MFHn589iK96tnVCn7IBRPQOuyNKDxfiUmO80m/6OYC8rev08O8FyGUlaE89lnRlgIEzr8yMET3qihVpbyRT7QcuG59QLN4J/GfpckwwF2UeVSUbwU4r9HiCLvz6dh41IP3vnwj86T+ym20oFvgJvB2m3BT9lu6o+nlrDg3r3Q442DvLwdpLhY9FbFRTJBFDf8SvjZtKld1LVhX04+aDzfhh0MLbx7xsQFXpcTE++0wUF1eZND5ZQgxYwLyPQtnLxZAAnAfPeYWEyGl+AbNZO8qq+aSdDNU/QqF0O2aEh1gFFxBGHO2v7F55sVeWSNJ0zVtX9y2ueofqNno27xEQD39gymmQ7doShoBkLKIpY3QFKMj69Ftl4aT609nosz8VKfLM/J/CX+3qO+/fzAJwe9h47DGLeOE4RyXvHQVUe7cVJpZRyXyac2lkkEH7/z1eFlyuHpp0V83nHjGNEVA00Lr3LDj31hgN+knkiRlVPrnUKl3PJn0wjHw+Zh7briIh5y1RfNY4zrATbs6P7Nsc3IR8oX2nlwrJlW/J7TxL+520lYd10lLiSmIeFpDnpceN9XmgzVyrpAhH8/HNm1C4uh1S80uJixnEBCH/wMNWQVPQIprKr6gwviPOtqn9yDc6YCQ85K4qQBpYs2SJY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8807.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(110136005)(8936002)(44832011)(2906002)(316002)(7416002)(66946007)(66556008)(66476007)(921005)(8676002)(4326008)(5660300002)(6512007)(6506007)(38350700002)(1076003)(52116002)(186003)(26005)(83380400001)(2616005)(508600001)(6666004)(86362001)(38100700002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mpFN5iJweVVD1eeBb5lKH1dQFTeWKSR1V7a6vXlS9Cc+B3i+6IolvOH4uJ1j7fUNnk/mrv+QCLbRwbUZ99h0HnqcSRRj5R9fvcDb4A/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oMq/qqUEE6+RgFTNQwMF13tJ+zw4NgpaAE772mfyczALh27+RmH3Ks93WVXbmeeSlog4lpasHUSZW2nu0/tM/SiLAzef1XF77Z0jppuWFDONnaay0ETCTOds6OwOs87lnm1vHah2YBAid1ckUTNcyMZHeaPraOWXqG/5uHVVUn/4oGI6dAYUKhs1eKzFfCdsY/cQp6sRTNpXPlANigRu8paP7gZ4fseGffrh1xyj5VePoO04T4aWrQ3o0ST65pyPB/pFSjASoD+qeQ4B+Rp6x1eEWOEdk+HkAs0C0boY4MNMBxwo7VnIyt8EQ78Fb96iBLlrFYMYPigkEaGB55Xcygry1yfyekEpXK0r8LA4MvjkO5FbigR0St7X1m23dStXA0TO0Az6QsWgpY9Rbz/L7Vc81dFPcKJZTZYXh6+mImSY3A/+WWpPh9aBC9Eq/DyhkT6ma3Dk8CP1kGIw= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b46b94be-dedb-4e01-0c28-08d9e74846a9 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8807.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2022 19:06:26.0187 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 67Q/F91NuDEEbBqHobOoOt8kwg1yZCLANa8z2Dp3tLdXECzgfazIw7t+SYZrfgCx5Ie89RwePCrSNlfqSnY9vg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5408 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yannick Vignon If NAPI was not scheduled from interrupt or softirq, __raise_softirq_irqoff would mark the softirq pending, but not wake up ksoftirqd. With force threaded IRQs, this is compensated by the fact that the interrupt handlers are protected inside a local_bh_disable()/local_bh_enable() section, and bh_enable will call do_softirq if needed. With normal threaded IRQs however, this is no longer the case (unless the interrupt handler itself calls local_bh_enable()), whic results in a pending softirq not being handled, and the following message being printed out from tick-sched.c: "NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #%02x!!!\n" Call raise_softirq_irqoff instead to make sure ksoftirqd is woken up in such a case, ensuring __napi_schedule, etc behave normally in more situations than just from an interrupt, softirq or from within a bh_disable/bh_enable section. Signed-off-by: Yannick Vignon --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index 1baab07820f6..f93b3173454c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4239,7 +4239,7 @@ static inline void ____napi_schedule(struct softnet_data *sd, } list_add_tail(&napi->poll_list, &sd->poll_list); - __raise_softirq_irqoff(NET_RX_SOFTIRQ); + raise_softirq_irqoff(NET_RX_SOFTIRQ); } #ifdef CONFIG_RPS From patchwork Thu Feb 3 18:40:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yannick Vignon X-Patchwork-Id: 12734570 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1ED9C433F5 for ; Thu, 3 Feb 2022 19:06:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353655AbiBCTGj (ORCPT ); Thu, 3 Feb 2022 14:06:39 -0500 Received: from mail-vi1eur05on2069.outbound.protection.outlook.com ([40.107.21.69]:13793 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S244261AbiBCTGi (ORCPT ); Thu, 3 Feb 2022 14:06:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XUtTtck3M0/ZKTYpw39C0tRZK3H3CVcrDCWmnZg9cjUNofPNgYIWQHIB4zOmYpqx6cehW82zicMXITL1pTkK9d057tmJfgloaA3W7x3osxM5YYQ/7b3IIiDCx3Y3J49ndM5UGCkj6WaPkcZAqEYiG0Gm1Yk0TQhx5TWCnG/+k5RmSop9joSu76M0/lyV7f7T8X1lb4KPmF+tiKnCl0leGQWmiC4a2g1LBUbJxIKCKzBukhYLOgx4qsa1snfRTo9eNGjQxZpJ0w3i5uaG9eCGDB4E6yrZVlsJhKsWgnqd/AJr9GhQi9wJ1wiR1fdkjo1gfVP/tUbquEdkFyJZnZ8DAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=FwMz116FrNRLAAoMjPwfPg1k9vajaLJ9snnf0dJLeP0=; b=P7HL8ScW0LJjHPDptWAU2e9Y3kWC4a/iftsvCPVcSoPQstcQ4ND5AH6HgsXiCHIZA3TquDRFraNF9pcvI/kALPAtiPTqbmlKOHgT0KumTYIng0ufbRhKJiaQYzgOPgyHYxvYmPSTosFAnaroSpQZwyzQsawXdZtRIyiocDAvaUfKAgeE1yiqYkTquIuGIMkkbybJG+lRD5NvXqN0E/4MWQe/kLbzR5TZd0zlT8+KHV9hu33cfwnt+/pKkUs1qq5W4hiFtmhOcTedZH6sAmcnoa2lH52bReLidV+Nj0V0w5ij8dFBnMuv1f86wAk1nZpMe0NI+JYgKM67rhc6SDr/hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FwMz116FrNRLAAoMjPwfPg1k9vajaLJ9snnf0dJLeP0=; b=TMq8wI573hWOGjcBo4G4BMxrkX7zf0xIyFxutzdJl6AGLnv5KLUG+JMORMxPriJwK0TaMqgz7R1g5gvKOoryvsSGlsA0MPrinrYUh2/zpE8iKnn8k6axsn2UYTvI04HA/rwwkFDhZ9Ih/GelUYl4etDszB7GG3KNrUQr8PJgRTs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU2PR04MB8807.eurprd04.prod.outlook.com (2603:10a6:10:2e2::23) by VI1PR04MB5408.eurprd04.prod.outlook.com (2603:10a6:803:cc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 3 Feb 2022 19:06:35 +0000 Received: from DU2PR04MB8807.eurprd04.prod.outlook.com ([fe80::9484:131d:7309:bd02]) by DU2PR04MB8807.eurprd04.prod.outlook.com ([fe80::9484:131d:7309:bd02%5]) with mapi id 15.20.4951.012; Thu, 3 Feb 2022 19:06:35 +0000 From: Yannick Vignon To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Coquelin , Eric Dumazet , Antoine Tenart , Alexander Lobakin , Sebastian Andrzej Siewior , Paolo Abeni , Wei Wang , Kumar Kartikeya Dwivedi , Yunsheng Lin , Arnd Bergmann , netdev@vger.kernel.org, Vladimir Oltean , Xiaoliang Yang , mingkai.hu@nxp.com, Joakim Zhang , sebastien.laveze@nxp.com Cc: Yannick Vignon Subject: [PATCH net-next 2/2] net: stmmac: move to threaded IRQ Date: Thu, 3 Feb 2022 19:40:31 +0100 Message-Id: <20220203184031.1074008-2-yannick.vignon@oss.nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220203184031.1074008-1-yannick.vignon@oss.nxp.com> References: <20220203184031.1074008-1-yannick.vignon@oss.nxp.com> X-ClientProxiedBy: AM0PR10CA0070.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15::23) To DU2PR04MB8807.eurprd04.prod.outlook.com (2603:10a6:10:2e2::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f71647d-90b8-4522-ee68-08d9e7484c2c X-MS-TrafficTypeDiagnostic: VI1PR04MB5408:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4upHNy/Udttca1h6JHkRTmOApVk3pCi79Q7QSjDOYY7Gf8lpwvROw4UxaF8SRmLmyW9E/IG8niJJzpNR0JpVQb5GFgDz34oPrWPTdIqGaj2XnWxZwDqgkfKrj1KtDx965ZlvUYdWemyRMCk/t2IzLz6ETO/pa8m+cFK7r+aougfBjTeC2kzUAqiX9wQfL/I20HEcJ2uR4vGDPux8wYuliyqezqCU7Kf3DH40Yv2oU8oLdHMhWUgTUvYGKWzMM/GMdSwNoJvZnqavY/wy5TgYgbmtgstJTL6QWtUjKPU4z7ffHXSx31Yd2Bi1U47VUxf3XHP0thh9VKrNOd0d7IAn2oKkgWz8hy5H/AG7ylBqkR7zu40ch6kHvflfJkKG5lx2DLa+K8ZJ4IyFIJCCBh28PRWEnvZSBPKrljcC15NKZNABBsnchsSAouwTC93wa1iJTRD8/U8qMG/rre7NVlQs5/QAMqbZfUZHQ8XZI54dAfxQ0NMfWXkwEWt8GLTgc2cEi41t/IvFiQhVsO6ShFJoC6ywQfnSe2qu6dEtIwvNO5ztXnNYgxaHlsww9ssM4m1RWLAmzN4h+3zygRlPB717o/E6rHa8kAXu/Pnna4gKRiFbenwgJ3/TVxo76PJCcuz4G/5xL85H7dNhQFne/KOCzYAVzoeGlAjWCW0WmRGOO3GHB3O13rmxlO8f/FKjcd+xMbfECV4ZrKJYYPhoxI91p0C0yeRRvJqMy4KN3Iu/5tU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8807.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(110136005)(8936002)(44832011)(2906002)(316002)(7416002)(66946007)(66556008)(66476007)(921005)(8676002)(4326008)(5660300002)(6512007)(6506007)(38350700002)(1076003)(52116002)(186003)(26005)(83380400001)(2616005)(508600001)(6666004)(86362001)(38100700002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q1eSdFxY3ohfMOP44B7/wxq2uguOI8rV1IuGCEjN6MBLyqfNT9uW0Ow08C6mil7Ily0cXuNnlt/MuzG//wjFtrYEUeuVeWyfRM3KwINV7QVWZiPmxY63QCe6AqqOP4Kt3IdhTpLGF6y13wdwbm5purOGIWAoxPKWZYoW8N15oqCSGmixVY0jgES3H+bWSjffODVQxnxqapOduaaOBNfWIMOyTxoVfNU8k2m3JyKigBXjf5nyHvqU/pvCU201Xytlm8suND/iG8YBhnUOf1M/Ti9NTDk8WdIPBBt39Bf6TS58hmLdokaAJRKQgAa+UY8ZDsfevjOduIyH5IPUsgcqXpBwlMte/2Mowa62uQflg+QCDbkCgjB1pFZr5j9fROUnMX+h2eXXtzB4TYIOGbNAF7hOquaWBH3gR+saCXoxTSZ7hDVnL7MhARtV3hOick9XT2SXIamEK31PXIe4cYpYOLEmwZ0zPr2UGd2EM/a3DSkAc0AzvBKpiAN+btQ2Z9Q6uvrUJiiGIYqm/trdzhRSWYaTP08Y99G9cf/AnJPerzT3UWv4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rg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f71647d-90b8-4522-ee68-08d9e7484c2c X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8807.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2022 19:06:35.4448 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XCuTL/mOdXMLYVoYorj34djN97kMMYKg7WpvrXbxDv8hipNFstAlTmZAJ7RiOD5athAj0/lfXJdLZ8bhVHiuxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5408 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yannick Vignon When an IRQ is forced threaded (such as with PREEMPT_RT), execution of the handler remains protected by local_bh_disable()/local_bh_enable() calls to keep the semantics of the IRQ context and avoid deadlocks. However, this also creates a contention point where a higher prio interrupt handler gets blocked by a lower prio task already holding the lock. Even though priority inheritance kicks in in such a case, the lower prio task can still execute for an indefinite time. Move the stmmac interrupts to be explicitly threaded, so that high priority traffic can be processed without delay even if another piece of code was already running with BH disabled. Signed-off-by: Yannick Vignon --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index bde76ea2deec..4bfc2cb89456 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3459,8 +3459,8 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) /* For common interrupt */ int_name = priv->int_name_mac; sprintf(int_name, "%s:%s", dev->name, "mac"); - ret = request_irq(dev->irq, stmmac_mac_interrupt, - 0, int_name, dev); + ret = request_threaded_irq(dev->irq, NULL, stmmac_mac_interrupt, + IRQF_ONESHOT, int_name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc mac MSI %d (error: %d)\n", @@ -3475,9 +3475,9 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) { int_name = priv->int_name_wol; sprintf(int_name, "%s:%s", dev->name, "wol"); - ret = request_irq(priv->wol_irq, - stmmac_mac_interrupt, - 0, int_name, dev); + ret = request_threaded_irq(priv->wol_irq, + NULL, stmmac_mac_interrupt, + IRQF_ONESHOT, int_name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc wol MSI %d (error: %d)\n", @@ -3493,9 +3493,9 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) { int_name = priv->int_name_lpi; sprintf(int_name, "%s:%s", dev->name, "lpi"); - ret = request_irq(priv->lpi_irq, - stmmac_mac_interrupt, - 0, int_name, dev); + ret = request_threaded_irq(priv->lpi_irq, + NULL, stmmac_mac_interrupt, + IRQF_ONESHOT, int_name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc lpi MSI %d (error: %d)\n", @@ -3604,8 +3604,8 @@ static int stmmac_request_irq_single(struct net_device *dev) enum request_irq_err irq_err; int ret; - ret = request_irq(dev->irq, stmmac_interrupt, - IRQF_SHARED, dev->name, dev); + ret = request_threaded_irq(dev->irq, NULL, stmmac_interrupt, + IRQF_SHARED | IRQF_ONESHOT, dev->name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: ERROR: allocating the IRQ %d (error: %d)\n", @@ -3618,8 +3618,8 @@ static int stmmac_request_irq_single(struct net_device *dev) * is used for WoL */ if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) { - ret = request_irq(priv->wol_irq, stmmac_interrupt, - IRQF_SHARED, dev->name, dev); + ret = request_threaded_irq(priv->wol_irq, NULL, stmmac_interrupt, + IRQF_SHARED | IRQF_ONESHOT, dev->name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: ERROR: allocating the WoL IRQ %d (%d)\n", @@ -3631,8 +3631,8 @@ static int stmmac_request_irq_single(struct net_device *dev) /* Request the IRQ lines */ if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) { - ret = request_irq(priv->lpi_irq, stmmac_interrupt, - IRQF_SHARED, dev->name, dev); + ret = request_threaded_irq(priv->lpi_irq, NULL, stmmac_interrupt, + IRQF_SHARED | IRQF_ONESHOT, dev->name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: ERROR: allocating the LPI IRQ %d (%d)\n",