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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 23DC4C5B579 for ; Fri, 28 Jun 2019 07:30:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F04182133F for ; Fri, 28 Jun 2019 07:30:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="lU3jHS04" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726601AbfF1H30 (ORCPT ); Fri, 28 Jun 2019 03:29:26 -0400 Received: from dc8-smtprelay2.synopsys.com ([198.182.47.102]:47996 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726472AbfF1H3Z (ORCPT ); Fri, 28 Jun 2019 03:29:25 -0400 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 41332C0BF3; Fri, 28 Jun 2019 07:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1561706965; bh=JljP4Ux5d1crd/1T+kZ+zYlp3zQcsd4krS3WGWr9nMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=lU3jHS04bg+SoSklQvlWP3WPvryRWD9+fSvCnmLmtromPI5pQlkwOjF9juvPCrqr0 M4FD49+cc8GWNRJ6fwu1DtPbgOxuhKX4kTY/dX2rJDS277stiGtLRzWjYA2FnDc+wB R+v8vcJwVtYDqh58PIKPyLwjOXYKfFRhDOyyRAfah3duXM48Uz3bEmBR1v6FWGDs2S p3q/DWm6DFqARpwO5+yR4uHC/0iII5MDPARiB1TGL2JdR8wV0QGcuQNc0T1UvvOqQ/ LRZnPQXeBfdGRz45SwP9LPDJ9chu6oKHTCRF7ng8cDxXa+UBN8U0hlmSGhw9wsuPw+ ig7NohV850j6Q== Received: from de02.synopsys.com (de02.internal.synopsys.com [10.225.17.21]) by mailhost.synopsys.com (Postfix) with ESMTP id 03161A023D; Fri, 28 Jun 2019 07:29:24 +0000 (UTC) Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by de02.synopsys.com (Postfix) with ESMTP id E864C3E96A; Fri, 28 Jun 2019 09:29:23 +0200 (CEST) From: Jose Abreu To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Jose Abreu , Joao Pinto , "David S . Miller" , Giuseppe Cavallaro , Alexandre Torgue Subject: [PATCH net-next v2 09/10] net: stmmac: Only disable interrupts if NAPI is scheduled Date: Fri, 28 Jun 2019 09:29:20 +0200 Message-Id: <71814f54df40ef5e1b51536955e06f10bcaf77fe.1561706801.git.joabreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only disable the interrupts if RX NAPI gets to be scheduled. Also, schedule the TX NAPI only when the interrupts are disabled. Signed-off-by: Jose Abreu Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a629b3144a0d..3425d4dda03d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2053,12 +2053,12 @@ static int stmmac_napi_check(struct stmmac_priv *priv, u32 chan) &priv->xstats, chan); struct stmmac_channel *ch = &priv->channel[chan]; - if (status) - status |= handle_rx | handle_tx; - if ((status & handle_rx) && (chan < priv->plat->rx_queues_to_use)) { - stmmac_disable_dma_irq(priv, priv->ioaddr, chan); - napi_schedule_irqoff(&ch->rx_napi); + if (napi_schedule_prep(&ch->rx_napi)) { + stmmac_disable_dma_irq(priv, priv->ioaddr, chan); + __napi_schedule_irqoff(&ch->rx_napi); + status |= handle_tx; + } } if ((status & handle_tx) && (chan < priv->plat->tx_queues_to_use)) -- 2.7.4