Skip to content

Commit ee5fe4b

Browse files
Niklas Casselgregkh
authored andcommitted
net: stmmac: discard disabled flags in interrupt status register
[ Upstream commit 1b84ca1 ] The interrupt status register in both dwmac1000 and dwmac4 ignores interrupt enable (for dwmac4) / interrupt mask (for dwmac1000). Therefore, if we want to check only the bits that can actually trigger an irq, we have to filter the interrupt status register manually. Commit 0a764db ("stmmac: Discard masked flags in interrupt status register") fixed this for dwmac1000. Fix the same issue for dwmac4. Just like commit 0a764db ("stmmac: Discard masked flags in interrupt status register"), this makes sure that we do not get spurious link up/link down prints. Signed-off-by: Niklas Cassel <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 26bebd5 commit ee5fe4b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,12 @@ static int dwmac4_irq_status(struct mac_device_info *hw,
562562
struct stmmac_extra_stats *x)
563563
{
564564
void __iomem *ioaddr = hw->pcsr;
565-
u32 intr_status;
565+
u32 intr_status = readl(ioaddr + GMAC_INT_STATUS);
566+
u32 intr_enable = readl(ioaddr + GMAC_INT_EN);
566567
int ret = 0;
567568

568-
intr_status = readl(ioaddr + GMAC_INT_STATUS);
569+
/* Discard disabled bits */
570+
intr_status &= intr_enable;
569571

570572
/* Not used events (e.g. MMC interrupts) are not handled. */
571573
if ((intr_status & mmc_tx_irq))

0 commit comments

Comments
 (0)