From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EAD0C433E1 for ; Thu, 23 Jul 2020 18:26:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E78D207BB for ; Thu, 23 Jul 2020 18:26:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="ebarM5uI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727820AbgGWS01 (ORCPT ); Thu, 23 Jul 2020 14:26:27 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:31341 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbgGWS00 (ORCPT ); Thu, 23 Jul 2020 14:26:26 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595528785; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Message-ID: Date: Subject: In-Reply-To: References: Cc: To: From: Sender; bh=n1W6ocoKrcYfitGwsuovGrOv9EGxLgCgVMXxSlmwsjY=; b=ebarM5uIZMa6As2qwhzYoSGcGUfQgRO2IIOAaP55JZTvd3ZRbNgQ07xbzJ1j2DCRt583p8Vw p2a3vVX7xBSq1TJfv22kc0jZ3/N5UhshYpnlmBf1bBeYR+1BvaXEOjXcxyelaaMB8Wjo8oE0 DEFpR8MkQkKSVeiLbqY5Vx/na38= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n10.prod.us-west-2.postgun.com with SMTP id 5f19d6515b75bcda60cc9288 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 23 Jul 2020 18:26:25 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 12821C43395; Thu, 23 Jul 2020 18:26:25 +0000 (UTC) Received: from Pillair (unknown [183.83.71.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: pillair) by smtp.codeaurora.org (Postfix) with ESMTPSA id 42796C433C9; Thu, 23 Jul 2020 18:26:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 42796C433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=pillair@codeaurora.org From: "Rakesh Pillai" To: "'Johannes Berg'" , Cc: , , , , , , , References: <1595351666-28193-1-git-send-email-pillair@codeaurora.org> <1595351666-28193-2-git-send-email-pillair@codeaurora.org> <0dbdef912f9d61521011f638200fd451a3530568.camel@sipsolutions.net> In-Reply-To: <0dbdef912f9d61521011f638200fd451a3530568.camel@sipsolutions.net> Subject: RE: [RFC 1/7] mac80211: Add check for napi handle before WARN_ON Date: Thu, 23 Jul 2020 23:56:18 +0530 Message-ID: <003201d6611e$c54a1c90$4fde55b0$@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQG1Bu1FBYi7G1oVhHY/01uT1gSslwIktOPGArPni2WpMWqJMA== Content-Language: en-us Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > -----Original Message----- > From: Johannes Berg > Sent: Wednesday, July 22, 2020 6:26 PM > To: Rakesh Pillai ; ath10k@lists.infradead.org > Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; > kvalo@codeaurora.org; davem@davemloft.net; kuba@kernel.org; > netdev@vger.kernel.org; dianders@chromium.org; evgreen@chromium.org > Subject: Re: [RFC 1/7] mac80211: Add check for napi handle before > WARN_ON >=20 > On Tue, 2020-07-21 at 22:44 +0530, Rakesh Pillai wrote: > > The function ieee80211_rx_napi can be now called > > from a thread context as well, with napi context > > being NULL. > > > > Hence add the napi context check before giving out > > a warning for softirq count being 0. > > > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 > > > > Signed-off-by: Rakesh Pillai > > --- > > net/mac80211/rx.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c > > index a88ab6f..1e703f1 100644 > > --- a/net/mac80211/rx.c > > +++ b/net/mac80211/rx.c > > @@ -4652,7 +4652,7 @@ void ieee80211_rx_napi(struct ieee80211_hw > *hw, struct ieee80211_sta *pubsta, > > struct ieee80211_supported_band *sband; > > struct ieee80211_rx_status *status =3D IEEE80211_SKB_RXCB(skb); > > > > - WARN_ON_ONCE(softirq_count() =3D=3D 0); > > + WARN_ON_ONCE(napi && softirq_count() =3D=3D 0); >=20 > FWIW, I'm pretty sure this is incorrect - we make assumptions on > softirqs being disabled in mac80211 for serialization and in place of > some locking, I believe. >=20 I checked this, but let me double confirm. But after this change, no packet is submitted from driver in a softirq = context. So ideally this should take care of serialization. > johannes