Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1435421pxu; Thu, 8 Oct 2020 11:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEf5E0aJrJVnD4H9DtAbK9yn9EYDJLjf4T3hTKfF52llJ9yf+gX+hOWnv4R2ZLgGQwKKp/ X-Received: by 2002:a17:906:26ce:: with SMTP id u14mr9764536ejc.78.1602181410314; Thu, 08 Oct 2020 11:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602181410; cv=none; d=google.com; s=arc-20160816; b=Ptmb8RVqembSjae0kS3qcS52LxCl0Pug5Yu9ZZzdd4wEG2IAsUlckgXpB2Je1DZwGS lCxvWXZAWj3d6mAlK2UbXfx+B2rE9cg2XBdvaTTL/vHpF+yOaBDo716ZxjJpO5E3pGjg pgTGV5JO2U9loeRedNzeS/s5pvJS8MwEsWE2WfmmLut5yJRjDj8QjI0GY9cDcWnGFUaX 5WG9qT4g60VfST6NrnxMSgxMz7rJ3BDuAaTT99GZPI+WUN7pEAU+BwKlQmFvAClcOpbL Jrcm9q5UJ0ZT7eT/OJ10L/YHIDFQWyJvVQ4J2tDGMhvciRx0yGjOEZ9DJwGAVNVCxP0V 1MWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=baQALmr0nd/6aVpSHT4Rjxf/ucSA0n2jSwRjgVzHBf0=; b=X9AN4yj735blAbWlfyjia6i0lf1dmhivpdWNmfnG1f5RZGFmdUYGQoWgh/+gU6H3vy ciySH5b/DQOdkbuUWJ9It2HmF9vVoJh2arRLFCYlWdfUoqS3GBXGDLz7JWJJFbl57DGa t7yMd1LelCSHqfgYWzsdueTLHXt1lGmmslIFprsyyMjehUnTE3VnDuXmjmJM0JaX+bYE hcqMaW1O23n9gh/tqcYFjPcUNiKVGEui7i0dNKQpjcGV8ICC1zugetC6YoebAJS14QdV eYv0vlxvtis2oSJ7QVVKQwXa6KbhH767aGPlWIlDWnLn7MneM2Rnv9peVifsj6qy3FUG p+iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@metanate.com header.s=stronger header.b=k1BgalpQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metanate.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si1000988ejf.718.2020.10.08.11.23.07; Thu, 08 Oct 2020 11:23:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@metanate.com header.s=stronger header.b=k1BgalpQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metanate.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730038AbgJHQqN (ORCPT + 99 others); Thu, 8 Oct 2020 12:46:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729965AbgJHQqN (ORCPT ); Thu, 8 Oct 2020 12:46:13 -0400 X-Greylist: delayed 1088 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 08 Oct 2020 09:46:13 PDT Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1321CC061755; Thu, 8 Oct 2020 09:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Content-Type:Reply-To:Content-ID:Content-Description: In-Reply-To:References; bh=baQALmr0nd/6aVpSHT4Rjxf/ucSA0n2jSwRjgVzHBf0=; b=k1 BgalpQSPZMjJBQPbOZFal6K15jRA5YqSN2OBpL7b7XxGECTsSPacSFBthLoXYZe5spWaLEyNEacJ0 CijgNih5NLesEmBGPBZtuToOdfvssMeA735j4GBiT5a1zphUNz0NGL1d/EkZj8X3U+xD/euBuP4H/ OG9ZeRHTsSQQ++YsNLjjLjZCXq0Kh0uMOrzM2Paap0jOK6IaxpPv7dRK4EMTkaFW0x88WTCSu0017 up266Co2VpVIoQKSkic2imHkb4qyXVAk2XryTidv9UkePZWVx2p2gb9EwZlzce47cUieif6IyqVbu dY8vC6O1MuUJS7FSzYeroolEZYpWtZkQ==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kQYlr-0004HE-FZ; Thu, 08 Oct 2020 17:27:59 +0100 From: John Keeping To: netdev@vger.kernel.org Cc: John Keeping , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: stmmac: Don't call _irqoff() with hardirqs enabled Date: Thu, 8 Oct 2020 17:27:49 +0100 Message-Id: <20201008162749.860521-1-john@metanate.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated: YES Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With threadirqs, stmmac_interrupt() is called on a thread with hardirqs enabled so we cannot call __napi_schedule_irqoff(). Under lockdep it leads to: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 285 at kernel/softirq.c:598 __raise_softirq_irqoff+0x6c/0x1c8 IRQs not disabled as expected Modules linked in: brcmfmac hci_uart btbcm cfg80211 brcmutil CPU: 0 PID: 285 Comm: irq/41-eth0 Not tainted 5.4.69-rt39 #1 Hardware name: Rockchip (Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0xa8/0xe0) [] (dump_stack) from [] (__warn+0xe0/0xfc) [] (__warn) from [] (warn_slowpath_fmt+0x7c/0xa4) [] (warn_slowpath_fmt) from [] (__raise_softirq_irqoff+0x6c/0x1c8) [] (__raise_softirq_irqoff) from [] (stmmac_interrupt+0x388/0x4e0) [] (stmmac_interrupt) from [] (irq_forced_thread_fn+0x28/0x64) [] (irq_forced_thread_fn) from [] (irq_thread+0x124/0x260) [] (irq_thread) from [] (kthread+0x154/0x164) [] (kthread) from [] (ret_from_fork+0x14/0x38) Exception stack(0xeb7b5fb0 to 0xeb7b5ff8) 5fa0: 00000000 00000000 00000000 00000000 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 irq event stamp: 48 hardirqs last enabled at (50): [] prb_unlock+0x7c/0x8c hardirqs last disabled at (51): [] prb_lock+0x58/0x100 softirqs last enabled at (0): [] copy_process+0x550/0x1654 softirqs last disabled at (25): [] irq_forced_thread_fn+0x0/0x64 ---[ end trace 0000000000000002 ]--- Use __napi_schedule() instead which will save & restore the interrupt state. Fixes: 4ccb45857c2c ("net: stmmac: Fix NAPI poll in TX path when in multi-queue") Signed-off-by: John Keeping --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 220626a8d499..c331b829f60a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2145,7 +2145,7 @@ static int stmmac_napi_check(struct stmmac_priv *priv, u32 chan) spin_lock_irqsave(&ch->lock, flags); stmmac_disable_dma_irq(priv, priv->ioaddr, chan, 1, 0); spin_unlock_irqrestore(&ch->lock, flags); - __napi_schedule_irqoff(&ch->rx_napi); + __napi_schedule(&ch->rx_napi); } } @@ -2154,7 +2154,7 @@ static int stmmac_napi_check(struct stmmac_priv *priv, u32 chan) spin_lock_irqsave(&ch->lock, flags); stmmac_disable_dma_irq(priv, priv->ioaddr, chan, 0, 1); spin_unlock_irqrestore(&ch->lock, flags); - __napi_schedule_irqoff(&ch->tx_napi); + __napi_schedule(&ch->tx_napi); } } -- 2.28.0