Skip to content

Commit 909ebd5

Browse files
committed
Merge branch 'stmmac-irq-fixes-cleanups'
Niklas Cassel says: ==================== stmmac irq fixes/cleanups A couple of small stmmac irq fixes/cleanups. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents faefaa9 + 1029117 commit 909ebd5

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ static void dwmac1000_core_init(struct mac_device_info *hw,
7474
/* Mask GMAC interrupts */
7575
value = GMAC_INT_DEFAULT_MASK;
7676

77-
if (hw->pmt)
78-
value &= ~GMAC_INT_DISABLE_PMT;
7977
if (hw->pcs)
8078
value &= ~GMAC_INT_DISABLE_PCS;
8179

drivers/net/ethernet/stmicro/stmmac/dwmac4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
#define GMAC_PCS_IRQ_DEFAULT (GMAC_INT_RGSMIIS | GMAC_INT_PCS_LINK | \
9999
GMAC_INT_PCS_ANE)
100100

101-
#define GMAC_INT_DEFAULT_MASK (GMAC_INT_PMT_EN | GMAC_INT_LPI_EN)
101+
#define GMAC_INT_DEFAULT_ENABLE (GMAC_INT_PMT_EN | GMAC_INT_LPI_EN)
102102

103103
enum dwmac4_irq_status {
104104
time_stamp_irq = 0x00001000,

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ static void dwmac4_core_init(struct mac_device_info *hw,
6161

6262
writel(value, ioaddr + GMAC_CONFIG);
6363

64-
/* Mask GMAC interrupts */
65-
value = GMAC_INT_DEFAULT_MASK;
66-
if (hw->pmt)
67-
value |= GMAC_INT_PMT_EN;
64+
/* Enable GMAC interrupts */
65+
value = GMAC_INT_DEFAULT_ENABLE;
66+
6867
if (hw->pcs)
6968
value |= GMAC_PCS_IRQ_DEFAULT;
7069

@@ -572,10 +571,12 @@ static int dwmac4_irq_status(struct mac_device_info *hw,
572571
struct stmmac_extra_stats *x)
573572
{
574573
void __iomem *ioaddr = hw->pcsr;
575-
u32 intr_status;
574+
u32 intr_status = readl(ioaddr + GMAC_INT_STATUS);
575+
u32 intr_enable = readl(ioaddr + GMAC_INT_EN);
576576
int ret = 0;
577577

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

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

0 commit comments

Comments
 (0)