Skip to content

Commit 4f795b2

Browse files
cavagiudavem330
authored andcommitted
stmmac: mask mmc interrupts
We need to mask the MMC irq otherwise if we raise the mmc interrupts that are not handled the driver loops in the handler. In fact, by default all mmc counters (only used for stats) are managed in SW and registers are cleared on each READ. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ba9bb43 commit 4f795b2

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎drivers/net/ethernet/stmicro/stmmac/stmmac_main.c‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,15 @@ static void stmmac_mmc_setup(struct stmmac_priv *priv)
781781
unsigned int mode = MMC_CNTRL_RESET_ON_READ | MMC_CNTRL_COUNTER_RESET |
782782
MMC_CNTRL_PRESET | MMC_CNTRL_FULL_HALF_PRESET;
783783

784-
/* Do not manage MMC IRQ (FIXME) */
784+
/* Mask MMC irq, counters are managed in SW and registers
785+
* are cleared on each READ eventually. */
785786
dwmac_mmc_intr_all_mask(priv->ioaddr);
786-
dwmac_mmc_ctrl(priv->ioaddr, mode);
787-
memset(&priv->mmc, 0, sizeof(struct stmmac_counters));
787+
788+
if (priv->dma_cap.rmon) {
789+
dwmac_mmc_ctrl(priv->ioaddr, mode);
790+
memset(&priv->mmc, 0, sizeof(struct stmmac_counters));
791+
} else
792+
pr_info(" No MAC Management Counters available");
788793
}
789794

790795
static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv)
@@ -1012,8 +1017,7 @@ static int stmmac_open(struct net_device *dev)
10121017
memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats));
10131018
priv->xstats.threshold = tc;
10141019

1015-
if (priv->dma_cap.rmon)
1016-
stmmac_mmc_setup(priv);
1020+
stmmac_mmc_setup(priv);
10171021

10181022
/* Start the ball rolling... */
10191023
DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name);

0 commit comments

Comments
 (0)