Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1696298pxu; Thu, 8 Oct 2020 19:32:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPoQfRF3k5GIYQpz6f9/9TPBf4pKHZBIiIn/TfZY33UGekUhs/UNX8DaZppJL1pju3s9jt X-Received: by 2002:a50:e447:: with SMTP id e7mr8502446edm.263.1602210729090; Thu, 08 Oct 2020 19:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602210729; cv=none; d=google.com; s=arc-20160816; b=oy+yYB12Vr4mCw1S+KXSjdM4Z5VsUIzYXbqn1p2hjME4YRPVFE1PKKSBqzzdFvzTKA SyFLXYPgc7Piv3xsnvOT5HP+GB73zQEzVIBN4dNJv9qUENpQB5nJYSiNkQ4WnALulcHV 7WjzNJqBjnED0bTkO/XV01eZ9RAKBn3i0oORbhP3deeFOh+V8yMa3ApDebzUbbpZh65E RZb2on8dsRckwurm/xqB2UYMeB2tW3OYwswoOrh8CyWvM0REoGut6NZ7e4KUd2fusH+I /z35vJRcDLJfdmcs0APbynA9x0M4OvgkKUcEaTOI0GEy9exwTVmVCusewD4ZKKizZ8Zs 2f8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AEjSqknP1oCJUZw0NkEtwBPT55uFfupDNX0nujX92jY=; b=DFIZRf1b+rraDVv2Yndq6btdV8cYzzIviDhG3T9uyz+4c/8V4vvlFkYEt3zRi/r5+L h5xtuv2ValozruZOendR0aysZ437fEPZtK3rSIt6PR/oPm/xp9mcQ141zSAo11eeoXJZ NM2q+B0y6e4BmS+Uf9cG1XHo/pTGCwsiDejQQnA43ZoJpH4+WPRI7FFdRepZfWVhOd1o h2L8p8YnWjAerQuV8djuevk3UZKJ2zzSn6x2cLKt3sseM9nNxzGEV+OCcNswasVoEJmf qzxyPeFb5n/mF/qtXTX4tBhhCKW540ZF/sb8LyZVvrvYL3n5rHix63Yu0F3yLuLi7yYP Y8Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GWrG7ZlJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nq4si5485970ejb.678.2020.10.08.19.31.46; Thu, 08 Oct 2020 19:32:09 -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 header.i=@gmail.com header.s=20161025 header.b=GWrG7ZlJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729254AbgJHXqN (ORCPT + 99 others); Thu, 8 Oct 2020 19:46:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbgJHXqN (ORCPT ); Thu, 8 Oct 2020 19:46:13 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4C5EC0613D2; Thu, 8 Oct 2020 16:46:12 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id t21so7563324eds.6; Thu, 08 Oct 2020 16:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AEjSqknP1oCJUZw0NkEtwBPT55uFfupDNX0nujX92jY=; b=GWrG7ZlJxcztuWXZUvIrAfhi9uwncN6XEo0oq2M8JMsQwFXvq8h68Sr9KLnM+ZwIfa Owsc9GtFHci0SVMizGU3PBTiCPtPLSbsvkZ2pfupp3lsTOVandmq650Z36VYdeVoujtU V3wEarJGtCdTo5AWhh9NS8bMTcmMv6nn/3Ybmc8J12fZCJuojQqB1b/P4nuyqDa6+lJ7 o9NMkI3LWj+Uh/44vGL39oJVrS02UexTPTNFI0vuMVNdQhUulySxkkOAN0rK1duWzhEe rSla9Lin8zL2p51R84dvU3fIftLx3rxgXwkRgKbkwDkLDNQ9lwzRUaC/opKsDcDp1pQK 2Vvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AEjSqknP1oCJUZw0NkEtwBPT55uFfupDNX0nujX92jY=; b=hUHTEEjPtiEFFcpatX90Gi3ekii7bRD2RbMP4yMSeLCfM62wpmv7nyejHp+xtWrAJH hbQArM5c876pyu6iqKJlLbWHF5OgIxwJCcv11Sen7+WZTfMIoZSk8da061hSkqs2Hie3 UPsdLnfau2G+isAtrG4S+5INgA3/tbqaA/TMIxXGyKiHyoI2HA6u0eP921rjdrsq8dbI 7SoGetHD/TxLFLO/kmXAHODJ7Zqf/LuAe89wSCqgmiI3fGaywMmyv+Ud16uW8dpjYgqV mvvxEiUhhFpWZv9/pc15BS4avOG8NifbNlcCDwNT+ehhYIPG/cDsc+7DPSGDWMiOg4/9 kc1A== X-Gm-Message-State: AOAM530WaTXL9W9veWNQpKizdDsgUM3ELFWlDjHWP1J7c+oX9e7Us91w ZpMgkhDYJuVacd6V0By/G60= X-Received: by 2002:aa7:ccd9:: with SMTP id y25mr11332579edt.375.1602200771361; Thu, 08 Oct 2020 16:46:11 -0700 (PDT) Received: from skbuf ([188.26.229.171]) by smtp.gmail.com with ESMTPSA id n4sm5189280ejj.19.2020.10.08.16.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 16:46:10 -0700 (PDT) Date: Fri, 9 Oct 2020 02:46:09 +0300 From: Vladimir Oltean To: John Keeping Cc: netdev@vger.kernel.org, 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: Re: [PATCH] net: stmmac: Don't call _irqoff() with hardirqs enabled Message-ID: <20201008234609.x3iy65g445hmmt73@skbuf> References: <20201008162749.860521-1-john@metanate.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201008162749.860521-1-john@metanate.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2020 at 05:27:49PM +0100, John Keeping wrote: > 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 > --- Don't get me wrong, this is so cool that the new lockdep warning is really helping out finding real bugs, but the patch that adds that warning (https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=cdabce2e3dff7e4bcef73473987618569d178af3) isn't in 5.4.69-rt39, is it?