net: stmmac: discard disabled flags in interrupt status register

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/1b84ca187510f60f00f4e15255043ce19bb30410
Commit:     1b84ca187510f60f00f4e15255043ce19bb30410
Parent:     faefaa97215a0c05105d7ae180fe1a3b5979ad1f
Refname:    refs/heads/master
Author:     Niklas Cassel <[email protected]>
AuthorDate: Fri Feb 9 17:22:45 2018 +0100
Committer:  David S. Miller <[email protected]>
CommitDate: Fri Feb 9 14:23:04 2018 -0500

    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 0a764db10337 ("stmmac: Discard masked flags in interrupt status
    register") fixed this for dwmac1000. Fix the same issue for dwmac4.
    
    Just like commit 0a764db10337 ("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]>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index ed222b20fcf1..1e0a7668b752 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -572,10 +572,12 @@ static int dwmac4_irq_status(struct mac_device_info *hw,
 			     struct stmmac_extra_stats *x)
 {
 	void __iomem *ioaddr = hw->pcsr;
-	u32 intr_status;
+	u32 intr_status = readl(ioaddr + GMAC_INT_STATUS);
+	u32 intr_enable = readl(ioaddr + GMAC_INT_EN);
 	int ret = 0;
 
-	intr_status = readl(ioaddr + GMAC_INT_STATUS);
+	/* Discard disabled bits */
+	intr_status &= intr_enable;
 
 	/* Not used events (e.g. MMC interrupts) are not handled. */
 	if ((intr_status & mmc_tx_irq))
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.