diff options
| author | Timur Tabi <timur@codeaurora.org> | 2017-10-11 15:52:26 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-10-11 19:01:56 -0400 |
| commit | 740d6f188fb71ae13e3e9f7208b6b3094517509d (patch) | |
| tree | 29553181be9be0d3a225ac4a5d7bbd63b6393637 /drivers/net/ethernet/qualcomm/emac | |
| parent | df1ec1b9d0df57e96011f175418dc95b1af46821 (diff) | |
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>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/emac')
| -rw-r--r-- | drivers/net/ethernet/qualcomm/emac/emac-sgmii.c | 15 | ||||
| -rw-r--r-- | drivers/net/ethernet/qualcomm/emac/emac.c | 8 |
2 files changed, 10 insertions, 13 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c b/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c index 29ba37a08372..e8ab512ee7e3 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c +++ b/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c | |||
| @@ -68,10 +68,10 @@ static void emac_sgmii_link_init(struct emac_adapter *adpt) | |||
| 68 | writel(val, phy->base + EMAC_SGMII_PHY_AUTONEG_CFG2); | 68 | writel(val, phy->base + EMAC_SGMII_PHY_AUTONEG_CFG2); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u32 irq_bits) | 71 | static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u8 irq_bits) |
| 72 | { | 72 | { |
| 73 | struct emac_sgmii *phy = &adpt->phy; | 73 | struct emac_sgmii *phy = &adpt->phy; |
| 74 | u32 status; | 74 | u8 status; |
| 75 | 75 | ||
| 76 | writel_relaxed(irq_bits, phy->base + EMAC_SGMII_PHY_INTERRUPT_CLEAR); | 76 | writel_relaxed(irq_bits, phy->base + EMAC_SGMII_PHY_INTERRUPT_CLEAR); |
| 77 | writel_relaxed(IRQ_GLOBAL_CLEAR, phy->base + EMAC_SGMII_PHY_IRQ_CMD); | 77 | 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) | |||
| 86 | EMAC_SGMII_PHY_INTERRUPT_STATUS, | 86 | EMAC_SGMII_PHY_INTERRUPT_STATUS, |
| 87 | status, !(status & irq_bits), 1, | 87 | status, !(status & irq_bits), 1, |
| 88 | SGMII_PHY_IRQ_CLR_WAIT_TIME)) { | 88 | SGMII_PHY_IRQ_CLR_WAIT_TIME)) { |
| 89 | netdev_err(adpt->netdev, | 89 | net_err_ratelimited("%s: failed to clear SGMII irq: status:0x%x bits:0x%x\n", |
| 90 | "error: failed clear SGMII irq: status:0x%x bits:0x%x\n", | 90 | adpt->netdev->name, status, irq_bits); |
| 91 | status, irq_bits); | ||
| 92 | return -EIO; | 91 | return -EIO; |
| 93 | } | 92 | } |
| 94 | 93 | ||
| @@ -109,7 +108,7 @@ static irqreturn_t emac_sgmii_interrupt(int irq, void *data) | |||
| 109 | { | 108 | { |
| 110 | struct emac_adapter *adpt = data; | 109 | struct emac_adapter *adpt = data; |
| 111 | struct emac_sgmii *phy = &adpt->phy; | 110 | struct emac_sgmii *phy = &adpt->phy; |
| 112 | u32 status; | 111 | u8 status; |
| 113 | 112 | ||
| 114 | status = readl(phy->base + EMAC_SGMII_PHY_INTERRUPT_STATUS); | 113 | status = readl(phy->base + EMAC_SGMII_PHY_INTERRUPT_STATUS); |
| 115 | status &= SGMII_ISR_MASK; | 114 | status &= SGMII_ISR_MASK; |
| @@ -139,10 +138,8 @@ static irqreturn_t emac_sgmii_interrupt(int irq, void *data) | |||
| 139 | atomic_set(&phy->decode_error_count, 0); | 138 | atomic_set(&phy->decode_error_count, 0); |
| 140 | } | 139 | } |
| 141 | 140 | ||
| 142 | if (emac_sgmii_irq_clear(adpt, status)) { | 141 | if (emac_sgmii_irq_clear(adpt, status)) |
| 143 | netdev_warn(adpt->netdev, "failed to clear SGMII interrupt\n"); | ||
| 144 | schedule_work(&adpt->work_thread); | 142 | schedule_work(&adpt->work_thread); |
| 145 | } | ||
| 146 | 143 | ||
| 147 | return IRQ_HANDLED; | 144 | return IRQ_HANDLED; |
| 148 | } | 145 | } |
diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c index ee6f2d27502c..70c92b649b29 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac.c +++ b/drivers/net/ethernet/qualcomm/emac/emac.c | |||
| @@ -148,9 +148,8 @@ static irqreturn_t emac_isr(int _irq, void *data) | |||
| 148 | goto exit; | 148 | goto exit; |
| 149 | 149 | ||
| 150 | if (status & ISR_ERROR) { | 150 | if (status & ISR_ERROR) { |
| 151 | netif_warn(adpt, intr, adpt->netdev, | 151 | net_err_ratelimited("%s: error interrupt 0x%lx\n", |
| 152 | "warning: error irq status 0x%lx\n", | 152 | adpt->netdev->name, status & ISR_ERROR); |
| 153 | status & ISR_ERROR); | ||
| 154 | /* reset MAC */ | 153 | /* reset MAC */ |
| 155 | schedule_work(&adpt->work_thread); | 154 | schedule_work(&adpt->work_thread); |
| 156 | } | 155 | } |
| @@ -169,7 +168,8 @@ static irqreturn_t emac_isr(int _irq, void *data) | |||
| 169 | emac_mac_tx_process(adpt, &adpt->tx_q); | 168 | emac_mac_tx_process(adpt, &adpt->tx_q); |
| 170 | 169 | ||
| 171 | if (status & ISR_OVER) | 170 | if (status & ISR_OVER) |
| 172 | net_warn_ratelimited("warning: TX/RX overflow\n"); | 171 | net_warn_ratelimited("%s: TX/RX overflow interrupt\n", |
| 172 | adpt->netdev->name); | ||
| 173 | 173 | ||
| 174 | exit: | 174 | exit: |
| 175 | /* enable the interrupt */ | 175 | /* enable the interrupt */ |
