net: qcom/emac: clean up some TX/RX error messages

Some of the error messages that are printed by the interrupt handlers
are poorly written.  For example, many don't include a device prefix,
so there's no indication that they are EMAC errors.

Also use rate limiting for all messages that could be printed from
interrupt context.

Signed-off-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Timur Tabi 2017-10-11 14:52:26 -05:00 committed by David S. Miller
parent df1ec1b9d0
commit 740d6f188f
2 changed files with 10 additions and 13 deletions

View File

@ -68,10 +68,10 @@ static void emac_sgmii_link_init(struct emac_adapter *adpt)
writel(val, phy->base + EMAC_SGMII_PHY_AUTONEG_CFG2); writel(val, phy->base + EMAC_SGMII_PHY_AUTONEG_CFG2);
} }
static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u32 irq_bits) static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u8 irq_bits)
{ {
struct emac_sgmii *phy = &adpt->phy; struct emac_sgmii *phy = &adpt->phy;
u32 status; u8 status;
writel_relaxed(irq_bits, phy->base + EMAC_SGMII_PHY_INTERRUPT_CLEAR); writel_relaxed(irq_bits, phy->base + EMAC_SGMII_PHY_INTERRUPT_CLEAR);
writel_relaxed(IRQ_GLOBAL_CLEAR, phy->base + EMAC_SGMII_PHY_IRQ_CMD); writel_relaxed(IRQ_GLOBAL_CLEAR, phy->base + EMAC_SGMII_PHY_IRQ_CMD);
@ -86,9 +86,8 @@ static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u32 irq_bits)
EMAC_SGMII_PHY_INTERRUPT_STATUS, EMAC_SGMII_PHY_INTERRUPT_STATUS,
status, !(status & irq_bits), 1, status, !(status & irq_bits), 1,
SGMII_PHY_IRQ_CLR_WAIT_TIME)) { SGMII_PHY_IRQ_CLR_WAIT_TIME)) {
netdev_err(adpt->netdev, net_err_ratelimited("%s: failed to clear SGMII irq: status:0x%x bits:0x%x\n",
"error: failed clear SGMII irq: status:0x%x bits:0x%x\n", adpt->netdev->name, status, irq_bits);
status, irq_bits);
return -EIO; return -EIO;
} }
@ -109,7 +108,7 @@ static irqreturn_t emac_sgmii_interrupt(int irq, void *data)
{ {
struct emac_adapter *adpt = data; struct emac_adapter *adpt = data;
struct emac_sgmii *phy = &adpt->phy; struct emac_sgmii *phy = &adpt->phy;
u32 status; u8 status;
status = readl(phy->base + EMAC_SGMII_PHY_INTERRUPT_STATUS); status = readl(phy->base + EMAC_SGMII_PHY_INTERRUPT_STATUS);
status &= SGMII_ISR_MASK; status &= SGMII_ISR_MASK;
@ -139,10 +138,8 @@ static irqreturn_t emac_sgmii_interrupt(int irq, void *data)
atomic_set(&phy->decode_error_count, 0); atomic_set(&phy->decode_error_count, 0);
} }
if (emac_sgmii_irq_clear(adpt, status)) { if (emac_sgmii_irq_clear(adpt, status))
netdev_warn(adpt->netdev, "failed to clear SGMII interrupt\n");
schedule_work(&adpt->work_thread); schedule_work(&adpt->work_thread);
}
return IRQ_HANDLED; return IRQ_HANDLED;
} }

View File

@ -148,9 +148,8 @@ static irqreturn_t emac_isr(int _irq, void *data)
goto exit; goto exit;
if (status & ISR_ERROR) { if (status & ISR_ERROR) {
netif_warn(adpt, intr, adpt->netdev, net_err_ratelimited("%s: error interrupt 0x%lx\n",
"warning: error irq status 0x%lx\n", adpt->netdev->name, status & ISR_ERROR);
status & ISR_ERROR);
/* reset MAC */ /* reset MAC */
schedule_work(&adpt->work_thread); schedule_work(&adpt->work_thread);
} }
@ -169,7 +168,8 @@ static irqreturn_t emac_isr(int _irq, void *data)
emac_mac_tx_process(adpt, &adpt->tx_q); emac_mac_tx_process(adpt, &adpt->tx_q);
if (status & ISR_OVER) if (status & ISR_OVER)
net_warn_ratelimited("warning: TX/RX overflow\n"); net_warn_ratelimited("%s: TX/RX overflow interrupt\n",
adpt->netdev->name);
exit: exit:
/* enable the interrupt */ /* enable the interrupt */