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=-6.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 38F76C4742F for ; Tue, 29 Sep 2020 20:36:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B259B2076B for ; Tue, 29 Sep 2020 20:36:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VmCI2D2N"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="e77qSX7G" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729689AbgI2Ugj (ORCPT ); Tue, 29 Sep 2020 16:36:39 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:49846 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729602AbgI2UgZ (ORCPT ); Tue, 29 Sep 2020 16:36:25 -0400 Message-Id: <20200929203502.769744809@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1601411780; 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=xQW4uASz9uqznLJIj4qcsFxH9Z8YREJkeiGPclI3SY4=; b=VmCI2D2Ny+qH7axYUwaHrPzomt90DEvNPUFa4athxXyOldRwucZi+mpjH9cQpb7UMMgzEb MQs1EqyE2gm/hUycQGdCuv6ym0XqNHpQtDWesd8GQxGa7V/a2/XeRTQeCOi2+yP48VjE0B NWY9OJIr76Z0C2KFu6M+xQTpBcNgw4txtbJ+ATRSRWYBCn8fHrtffIem0LRZiVblqiEbFE Ld7FipKjWWXNWIpDPynM42KDrzIGh5Hvt9lBpsf6tdpH+P8OQc7oPB4dSLkyFIIhwMPO3m Tq+PSzuBOVUV2kJa9paJLjzsTZ+Gr/PqDAll9JLXUTwC2XTmgPcUpoKWi43CcA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1601411780; 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=xQW4uASz9uqznLJIj4qcsFxH9Z8YREJkeiGPclI3SY4=; b=e77qSX7G44v7lcRfnWC4fJIgUIsPLTFgN73WQthw0m+L1lyZJXW7/Sici4zIQS1FFRHOHC csgNmx1IMIAG72Cg== Date: Tue, 29 Sep 2020 22:25:42 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Paul McKenney , Matthew Wilcox , Christian Benvenuti , Govindarajulu Varadarajan <_govind@gmx.com>, Dave Miller , Jakub Kicinski , netdev@vger.kernel.org, Jonathan Corbet , Mauro Carvalho Chehab , linux-doc@vger.kernel.org, Sebastian Andrzej Siewior , 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 , Kalle Valo , linux-wireless@vger.kernel.org, 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 , Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , libertas-dev@lists.infradead.org, Pascal Terjan , Ping-Ke Shih Subject: [patch V2 33/36] net: libertas: Use netif_rx_any_context() References: <20200929202509.673358734@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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. libertas 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 Acked-by: Kalle Valo --- drivers/net/wireless/marvell/libertas/rx.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) --- a/drivers/net/wireless/marvell/libertas/rx.c +++ b/drivers/net/wireless/marvell/libertas/rx.c @@ -147,10 +147,7 @@ int lbs_process_rxed_packet(struct lbs_p dev->stats.rx_packets++; skb->protocol = eth_type_trans(skb, dev); - if (in_interrupt()) - netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_any_context(skb); ret = 0; done: @@ -265,11 +262,7 @@ static int process_rxed_802_11_packet(st dev->stats.rx_packets++; skb->protocol = eth_type_trans(skb, priv->dev); - - if (in_interrupt()) - netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_any_context(skb); ret = 0; From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Date: Tue, 29 Sep 2020 22:25:42 +0200 Subject: [Intel-wired-lan] [patch V2 33/36] net: libertas: Use netif_rx_any_context() References: <20200929202509.673358734@linutronix.de> Message-ID: <20200929203502.769744809@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: 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. libertas 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 Acked-by: Kalle Valo --- drivers/net/wireless/marvell/libertas/rx.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) --- a/drivers/net/wireless/marvell/libertas/rx.c +++ b/drivers/net/wireless/marvell/libertas/rx.c @@ -147,10 +147,7 @@ int lbs_process_rxed_packet(struct lbs_p dev->stats.rx_packets++; skb->protocol = eth_type_trans(skb, dev); - if (in_interrupt()) - netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_any_context(skb); ret = 0; done: @@ -265,11 +262,7 @@ static int process_rxed_802_11_packet(st dev->stats.rx_packets++; skb->protocol = eth_type_trans(skb, priv->dev); - - if (in_interrupt()) - netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_any_context(skb); ret = 0;