From patchwork Sun Sep 27 19:49:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11802457 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3BE86CA for ; Sun, 27 Sep 2020 19:59:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9DA523A54 for ; Sun, 27 Sep 2020 19:59:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wj8/tcbv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8f2wzbUG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727315AbgI0T7J (ORCPT ); Sun, 27 Sep 2020 15:59:09 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:41894 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbgI0T6E (ORCPT ); Sun, 27 Sep 2020 15:58:04 -0400 Message-Id: <20200927194922.830361303@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1601236663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=aWutwpvby216c/jOr44XERgFZl4JWtXaiUmlGu9Ew5g=; b=wj8/tcbvjbHIE2iyck9XlzqXoukgZyVheOsfUEKrEo4aIBHQd2UAF6C9tE9ne+KwuYig4A a5M7VYVsc+Oywp1tcXKy8izFLMNtYmJZvshZxaHl1+kduoiNkfloFf/1VvZ8boXlgtSn67 IjDTrpZm0zDbk7eiZkcQUuor7Nvv5UQi+4ppYjuPbQDElv7mOok7bU4jx4VVLL73NQB0Na 0S6Y8ojP+Egk7zUp9PXG1Us71hG8bWKrTl6e7TDLTAoL6zyTvjKhLqZ2OokxU+YAUti1+c ZIkMhdZQ1LizZKopauzd0MRCLso4Yy7mTtcfEa060b3Ij4FjUgIXjPasNmVu/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1601236663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=aWutwpvby216c/jOr44XERgFZl4JWtXaiUmlGu9Ew5g=; b=8f2wzbUGXSB8jpn1CQ9Mvv39d3JAL0NEKIqF6hUzTpgjDiXKWzLpnuKrothTbqaZQEgcv+ ZS9Q0EULAtTY8TBg== Date: Sun, 27 Sep 2020 21:49:16 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Linus Torvalds , Paul McKenney , Matthew Wilcox , Sebastian Andrzej Siewior , Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Christian Benvenuti , Govindarajulu Varadarajan <_govind@gmx.com>, Dave Miller , Jonathan Corbet , Mauro Carvalho Chehab , linux-doc@vger.kernel.org, Luc Van Oostenryck , Jay Cliburn , Chris Snook , Vishal Kulkarni , Jeff Kirsher , intel-wired-lan@lists.osuosl.org, Shannon Nelson , Pensando Drivers , Andrew Lunn , Heiner Kallweit , Russell King , Thomas Bogendoerfer , Solarflare linux maintainers , Edward Cree , Martin Habets , Jon Mason , Daniel Drake , Ulrich Kunitz , linux-usb@vger.kernel.org, Greg Kroah-Hartman , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Stanislav Yakovlev , Stanislaw Gruszka , Johannes Berg , Emmanuel Grumbach , Luca Coelho , Intel Linux Wireless , Jouni Malinen , libertas-dev@lists.infradead.org, Pascal Terjan , Ping-Ke Shih Subject: [patch 30/35] net: mwifiex: Use netif_rx_any_context(). References: <20200927194846.045411263@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sebastian Andrzej Siewior The usage of in_interrupt() in non-core code is phased out. Ideally the information of the calling context should be passed by the callers or the functions be split as appropriate. mwifiex uses in_interupt() to select the netif_rx*() variant which matches the calling context. The attempt to consolidate the code by passing an arguemnt or by distangling it failed due lack of knowledge about this driver and because the call chains are hard to follow. As a stop gap use netif_rx_any_context() which invokes the correct code path depending on context and confines the in_interrupt() usage to core code. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Amitkumar Karwar Cc: Ganapathi Bhat Cc: Xinming Hu Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org --- drivers/net/wireless/marvell/mwifiex/uap_txrx.c | 6 +----- drivers/net/wireless/marvell/mwifiex/util.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) --- a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c @@ -350,11 +350,7 @@ int mwifiex_uap_recv_packet(struct mwifi skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE); /* Forward multicast/broadcast packet to upper layer*/ - if (in_interrupt()) - netif_rx(skb); - else - netif_rx_ni(skb); - + netif_rx_any_context(skb); return 0; } --- a/drivers/net/wireless/marvell/mwifiex/util.c +++ b/drivers/net/wireless/marvell/mwifiex/util.c @@ -488,11 +488,7 @@ int mwifiex_recv_packet(struct mwifiex_p (skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE)) skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE); - if (in_interrupt()) - netif_rx(skb); - else - netif_rx_ni(skb); - + netif_rx_any_context(skb); return 0; }