mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
net: stmmac: dwxgmac2: Only clear interrupts that are active
[ Upstream commit fcc509eb10 ]
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: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4ef0d67c28
commit
fcfdb4022c
@@ -260,6 +260,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
|
||||
struct stmmac_extra_stats *x, u32 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;
|
||||
|
||||
/* ABNORMAL interrupts */
|
||||
@@ -279,8 +280,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
|
||||
x->normal_irq_n++;
|
||||
|
||||
if (likely(intr_status & XGMAC_RI)) {
|
||||
u32 value = readl(ioaddr + XGMAC_DMA_CH_INT_EN(chan));
|
||||
if (likely(value & XGMAC_RIE)) {
|
||||
if (likely(intr_en & XGMAC_RIE)) {
|
||||
x->rx_normal_irq_n++;
|
||||
ret |= handle_rx;
|
||||
}
|
||||
@@ -292,7 +292,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
|
||||
}
|
||||
|
||||
/* Clear interrupts */
|
||||
writel(~0x0, ioaddr + XGMAC_DMA_CH_STATUS(chan));
|
||||
writel(intr_en & intr_status, ioaddr + XGMAC_DMA_CH_STATUS(chan));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user