Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp879476imj; Fri, 15 Feb 2019 08:17:20 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaeyl87fd+QV+wSMatUirz0fwljekxeQ6c4gEsxuc3Sz3ct46C2Jq34ny/Rzr80CYTm/iHl X-Received: by 2002:a17:902:2ba8:: with SMTP id l37mr10968938plb.243.1550247440011; Fri, 15 Feb 2019 08:17:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550247440; cv=none; d=google.com; s=arc-20160816; b=Zjm2hTsMsqyZGwOldk6MYABo6Cakqx88cVBIi4hmXrwJ2aCHv+uLfj7/4Nwch0oSu/ 3K+qLH3uNv3eTc5xmmLW/sQ1VgN63It8T79v38lai57hcfdnpsXO2vQMUCoFvVYruKUJ ru3zt0VLEt8dUDs9WH94Q83VDXXzTnqxugbgQ7UtuwCfZ0keEhYtb3+cAmnAiQevKrhs cest7RsTzd0dn7x/DyykZYD1ZF+OXiKHzKjyqfKaQCyJfmu61tJBFsm1hwqU25oQ5IEq XV5/3L+0d4TCxzQqzq6pOyYyBq2YJ8Z4GBtYONSRpp77Qw4hUJ9zYNFtyYNx2HchGNpV vitw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=XhmgcCs5sTJsH7EW44NJIlwW6EnwXpMbhokDQ54pEoA=; b=w/gn2UHWape3FsHmVOz4HkFC4fWhA6VL/3J9h0teb/G4HPi5V3hiqzUJmo2IfvsjL0 jwLT0cvfX/YK4+xQhTNnsMB2pjLHjOnfRw6pAMfe6/RAgdmg68vQTjq9FCNFjDgapBS5 Oze7kcdH/GK32OgCyNBKQLp4XkZWozPp430ho43A68KV2EeUJIYQqUYOf3+/Tqsh1zxh v9z8eKy6UHxq8xv3uKrauF9/fdotMRXRcWnl/1ZXE8Qg+ejRV6Vx8wrb+b4axniR5jFo 1JOu7s3H9xv+zuW8w24f2qqSv4X7ZIpM6zBNGaKxt/efp6mfzI0jxNdPra0z8qTs7Wz5 EucA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Tq8DXC9v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si5653117pll.248.2019.02.15.08.17.04; Fri, 15 Feb 2019 08:17:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Tq8DXC9v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395029AbfBONmx (ORCPT + 99 others); Fri, 15 Feb 2019 08:42:53 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:43898 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfBONmw (ORCPT ); Fri, 15 Feb 2019 08:42:52 -0500 Received: from mailhost1.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 65C6B10C107D; Fri, 15 Feb 2019 05:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1550238172; bh=VpbMwFSjKIjoga2jnTw3hNoJo6MpSF4+usQFNCdJYtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Tq8DXC9vkEbc0V1ftRWSCnf84rfaYQzfwndBIj7hFZr+CZAWWDC40jT0be540BrGT qIhbAx66IMpDr8SWMO9Zkl3obdcmFViUHyAaazf4fcykXFQCN4k9GtzYGRICf60rec iaJgKSBUtDPHHYfl3/nSt7wlJ4FdQrpqgctqW9TbBvUXCa5xHyP96vGdsrkIbY1AFA Uvm+AA5NEA4W0hXcTfeqCLJS/jVXyJMLwMfGyJZb3WCQ7DkiEhFvN9nx3cA8lqvobk nYUNWHmc0XVPL479AOjYGNqmunb5fMwkADIkRcYjjVJNCPsoHX1tKvowirF1A7DXjo QeSYuSxRfa5WA== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost1.synopsys.com (Postfix) with ESMTP id 06E0F5349; Fri, 15 Feb 2019 05:42:20 -0800 (PST) From: Jose Abreu To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jose Abreu , Joao Pinto , "David S . Miller" , Giuseppe Cavallaro , Alexandre Torgue Subject: [PATCH net-next 2/3] net: stmmac: dwmac4: Also use TBU interrupt to clean TX path Date: Fri, 15 Feb 2019 14:42:06 +0100 Message-Id: <7381bc27f8268376345f60d1996734805257354c.1550237884.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 TBU interrupt is a normal interrupt and can be used to trigger the cleaning of TX path. Lets check if it's active in DMA interrupt handler. While at it, refactor a little bit the function: - Don't check if RI is enabled because at function exit we will only clear the interrupts that are enabled so, no event will be missed. In my tests with GMAC5 this increased performance. Signed-off-by: Jose Abreu Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c index 49f5687879df..545cb9c47433 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c @@ -124,9 +124,9 @@ void dwmac4_disable_dma_irq(void __iomem *ioaddr, u32 chan) int dwmac4_dma_interrupt(void __iomem *ioaddr, struct stmmac_extra_stats *x, u32 chan) { - int ret = 0; - u32 intr_status = readl(ioaddr + DMA_CHAN_STATUS(chan)); + u32 intr_en = readl(ioaddr + DMA_CHAN_INTR_ENA(chan)); + int ret = 0; /* ABNORMAL interrupts */ if (unlikely(intr_status & DMA_CHAN_STATUS_AIS)) { @@ -151,16 +151,11 @@ int dwmac4_dma_interrupt(void __iomem *ioaddr, if (likely(intr_status & DMA_CHAN_STATUS_NIS)) { x->normal_irq_n++; if (likely(intr_status & DMA_CHAN_STATUS_RI)) { - u32 value; - - value = readl(ioaddr + DMA_CHAN_INTR_ENA(chan)); - /* to schedule NAPI on real RIE event. */ - if (likely(value & DMA_CHAN_INTR_ENA_RIE)) { - x->rx_normal_irq_n++; - ret |= handle_rx; - } + x->rx_normal_irq_n++; + ret |= handle_rx; } - if (likely(intr_status & DMA_CHAN_STATUS_TI)) { + if (likely(intr_status & (DMA_CHAN_STATUS_TI | + DMA_CHAN_STATUS_TBU))) { x->tx_normal_irq_n++; ret |= handle_tx; } @@ -168,12 +163,7 @@ int dwmac4_dma_interrupt(void __iomem *ioaddr, x->rx_early_irq++; } - /* Clear the interrupt by writing a logic 1 to the chanX interrupt - * status [21-0] expect reserved bits [5-3] - */ - writel((intr_status & 0x3fffc7), - ioaddr + DMA_CHAN_STATUS(chan)); - + writel(intr_status & intr_en, ioaddr + DMA_CHAN_STATUS(chan)); return ret; } -- 2.7.4