net: stmmac: xgmac: Disable FPE MMC interrupts
authorFurong Xu <0x1207@gmail.com>
Sat, 25 Nov 2023 06:01:26 +0000 (14:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:52:22 +0000 (08:52 +0100)
[ Upstream commit e54d628a2721bfbb002c19f6e8ca6746cec7640f ]

Commit aeb18dd07692 ("net: stmmac: xgmac: Disable MMC interrupts
by default") tries to disable MMC interrupts to avoid a storm of
unhandled interrupts, but leaves the FPE(Frame Preemption) MMC
interrupts enabled, FPE MMC interrupts can cause the same problem.
Now we mask FPE TX and RX interrupts to disable all MMC interrupts.

Fixes: aeb18dd07692 ("net: stmmac: xgmac: Disable MMC interrupts by default")
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Signed-off-by: Furong Xu <0x1207@gmail.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Link: https://lore.kernel.org/r/20231125060126.2328690-1-0x1207@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/mmc_core.c

index ea4910a..6a7c1d3 100644 (file)
 #define MMC_XGMAC_RX_DISCARD_OCT_GB    0x1b4
 #define MMC_XGMAC_RX_ALIGN_ERR_PKT     0x1bc
 
+#define MMC_XGMAC_TX_FPE_INTR_MASK     0x204
 #define MMC_XGMAC_TX_FPE_FRAG          0x208
 #define MMC_XGMAC_TX_HOLD_REQ          0x20c
+#define MMC_XGMAC_RX_FPE_INTR_MASK     0x224
 #define MMC_XGMAC_RX_PKT_ASSEMBLY_ERR  0x228
 #define MMC_XGMAC_RX_PKT_SMD_ERR       0x22c
 #define MMC_XGMAC_RX_PKT_ASSEMBLY_OK   0x230
@@ -352,6 +354,8 @@ static void dwxgmac_mmc_intr_all_mask(void __iomem *mmcaddr)
 {
        writel(0x0, mmcaddr + MMC_RX_INTR_MASK);
        writel(0x0, mmcaddr + MMC_TX_INTR_MASK);
+       writel(MMC_DEFAULT_MASK, mmcaddr + MMC_XGMAC_TX_FPE_INTR_MASK);
+       writel(MMC_DEFAULT_MASK, mmcaddr + MMC_XGMAC_RX_FPE_INTR_MASK);
        writel(MMC_DEFAULT_MASK, mmcaddr + MMC_XGMAC_RX_IPC_INTR_MASK);
 }