]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: stmmac: dwxgmac2: Also use TBU interrupt to clean TX path
authorJose Abreu <jose.abreu@synopsys.com>
Tue, 19 Feb 2019 09:38:49 +0000 (10:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Feb 2019 23:42:34 +0000 (15:42 -0800)
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 withe XGMAC2 this increased performance.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c

index d6bb953685fa68fa1dac574b5f5718d90879f087..37d5e6fe74737f6c82acc223e2c93b043b7bb9f4 100644 (file)
 #define XGMAC_AIE                      BIT(14)
 #define XGMAC_RBUE                     BIT(7)
 #define XGMAC_RIE                      BIT(6)
+#define XGMAC_TBUE                     BIT(2)
 #define XGMAC_TIE                      BIT(0)
 #define XGMAC_DMA_INT_DEFAULT_EN       (XGMAC_NIE | XGMAC_AIE | XGMAC_RBUE | \
-                                       XGMAC_RIE | XGMAC_TIE)
+                                       XGMAC_RIE | XGMAC_TBUE | XGMAC_TIE)
 #define XGMAC_DMA_CH_Rx_WATCHDOG(x)    (0x0000313c + (0x80 * (x)))
 #define XGMAC_RWT                      GENMASK(7, 0)
 #define XGMAC_DMA_CH_STATUS(x)         (0x00003160 + (0x80 * (x)))
 #define XGMAC_FBE                      BIT(12)
 #define XGMAC_RBU                      BIT(7)
 #define XGMAC_RI                       BIT(6)
+#define XGMAC_TBU                      BIT(2)
 #define XGMAC_TPS                      BIT(1)
 #define XGMAC_TI                       BIT(0)
 
index c5e25580a43fa59e926ed0f78ae6830826b1438a..2ba712b48a89ab3f71997666845b1804ef450e88 100644 (file)
@@ -283,12 +283,10 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
                x->normal_irq_n++;
 
                if (likely(intr_status & XGMAC_RI)) {
-                       if (likely(intr_en & XGMAC_RIE)) {
-                               x->rx_normal_irq_n++;
-                               ret |= handle_rx;
-                       }
+                       x->rx_normal_irq_n++;
+                       ret |= handle_rx;
                }
-               if (likely(intr_status & XGMAC_TI)) {
+               if (likely(intr_status & (XGMAC_TI | XGMAC_TBU))) {
                        x->tx_normal_irq_n++;
                        ret |= handle_tx;
                }