Commit fcc509eb authored by Jose Abreu's avatar Jose Abreu Committed by David S. Miller

net: stmmac: dwxgmac2: Only clear interrupts that are active

In DMA interrupt handler we were clearing all interrupts status, even
the ones that were not active. Fix this and only clear the active
interrupts.

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: default avatarJose Abreu <joabreu@synopsys.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6dea7e18
...@@ -263,6 +263,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr, ...@@ -263,6 +263,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
struct stmmac_extra_stats *x, u32 chan) struct stmmac_extra_stats *x, u32 chan)
{ {
u32 intr_status = readl(ioaddr + XGMAC_DMA_CH_STATUS(chan)); u32 intr_status = readl(ioaddr + XGMAC_DMA_CH_STATUS(chan));
u32 intr_en = readl(ioaddr + XGMAC_DMA_CH_INT_EN(chan));
int ret = 0; int ret = 0;
/* ABNORMAL interrupts */ /* ABNORMAL interrupts */
...@@ -282,8 +283,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr, ...@@ -282,8 +283,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
x->normal_irq_n++; x->normal_irq_n++;
if (likely(intr_status & XGMAC_RI)) { if (likely(intr_status & XGMAC_RI)) {
u32 value = readl(ioaddr + XGMAC_DMA_CH_INT_EN(chan)); if (likely(intr_en & XGMAC_RIE)) {
if (likely(value & XGMAC_RIE)) {
x->rx_normal_irq_n++; x->rx_normal_irq_n++;
ret |= handle_rx; ret |= handle_rx;
} }
...@@ -295,7 +295,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr, ...@@ -295,7 +295,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
} }
/* Clear interrupts */ /* Clear interrupts */
writel(~0x0, ioaddr + XGMAC_DMA_CH_STATUS(chan)); writel(intr_en & intr_status, ioaddr + XGMAC_DMA_CH_STATUS(chan));
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment