Skip to content

Commit

Permalink
Merge branch 'stmmac-irq-fixes-cleanups'
Browse files Browse the repository at this point in the history
Niklas Cassel says:

====================
stmmac irq fixes/cleanups

A couple of small stmmac irq fixes/cleanups.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Feb 9, 2018
2 parents faefaa9 + 1029117 commit 909ebd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 0 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ static void dwmac1000_core_init(struct mac_device_info *hw,
/* Mask GMAC interrupts */
value = GMAC_INT_DEFAULT_MASK;

if (hw->pmt)
value &= ~GMAC_INT_DISABLE_PMT;
if (hw->pcs)
value &= ~GMAC_INT_DISABLE_PCS;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac4.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define GMAC_PCS_IRQ_DEFAULT (GMAC_INT_RGSMIIS | GMAC_INT_PCS_LINK | \
GMAC_INT_PCS_ANE)

#define GMAC_INT_DEFAULT_MASK (GMAC_INT_PMT_EN | GMAC_INT_LPI_EN)
#define GMAC_INT_DEFAULT_ENABLE (GMAC_INT_PMT_EN | GMAC_INT_LPI_EN)

enum dwmac4_irq_status {
time_stamp_irq = 0x00001000,
Expand Down
13 changes: 7 additions & 6 deletions drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ static void dwmac4_core_init(struct mac_device_info *hw,

writel(value, ioaddr + GMAC_CONFIG);

/* Mask GMAC interrupts */
value = GMAC_INT_DEFAULT_MASK;
if (hw->pmt)
value |= GMAC_INT_PMT_EN;
/* Enable GMAC interrupts */
value = GMAC_INT_DEFAULT_ENABLE;

if (hw->pcs)
value |= GMAC_PCS_IRQ_DEFAULT;

Expand Down Expand Up @@ -572,10 +571,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))
Expand Down

0 comments on commit 909ebd5

Please sign in to comment.