Skip to content

Commit 1b84ca1

Browse files
Niklas Casseldavem330
authored andcommitted
net: stmmac: discard disabled flags in interrupt status register
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]>
1 parent faefaa9 commit 1b84ca1

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
@@ -572,10 +572,12 @@ static int dwmac4_irq_status(struct mac_device_info *hw,
572572
struct stmmac_extra_stats *x)
573573
{
574574
void __iomem *ioaddr = hw->pcsr;
575-
u32 intr_status;
575+
u32 intr_status = readl(ioaddr + GMAC_INT_STATUS);
576+
u32 intr_enable = readl(ioaddr + GMAC_INT_EN);
576577
int ret = 0;
577578

578-
intr_status = readl(ioaddr + GMAC_INT_STATUS);
579+
/* Discard disabled bits */
580+
intr_status &= intr_enable;
579581

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

0 commit comments

Comments
 (0)