diff options
Diffstat (limited to 'drivers/net/can/sun4i_can.c')
| -rw-r--r-- | drivers/net/can/sun4i_can.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c index b0c80859f746..1ac2090a1721 100644 --- a/drivers/net/can/sun4i_can.c +++ b/drivers/net/can/sun4i_can.c | |||
| @@ -539,6 +539,13 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status) | |||
| 539 | } | 539 | } |
| 540 | stats->rx_over_errors++; | 540 | stats->rx_over_errors++; |
| 541 | stats->rx_errors++; | 541 | stats->rx_errors++; |
| 542 | |||
| 543 | /* reset the CAN IP by entering reset mode | ||
| 544 | * ignoring timeout error | ||
| 545 | */ | ||
| 546 | set_reset_mode(dev); | ||
| 547 | set_normal_mode(dev); | ||
| 548 | |||
| 542 | /* clear bit */ | 549 | /* clear bit */ |
| 543 | sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG); | 550 | sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG); |
| 544 | } | 551 | } |
| @@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id) | |||
| 653 | netif_wake_queue(dev); | 660 | netif_wake_queue(dev); |
| 654 | can_led_event(dev, CAN_LED_EVENT_TX); | 661 | can_led_event(dev, CAN_LED_EVENT_TX); |
| 655 | } | 662 | } |
| 656 | if (isrc & SUN4I_INT_RBUF_VLD) { | 663 | if ((isrc & SUN4I_INT_RBUF_VLD) && |
| 657 | /* receive interrupt */ | 664 | !(isrc & SUN4I_INT_DATA_OR)) { |
| 665 | /* receive interrupt - don't read if overrun occurred */ | ||
| 658 | while (status & SUN4I_STA_RBUF_RDY) { | 666 | while (status & SUN4I_STA_RBUF_RDY) { |
| 659 | /* RX buffer is not empty */ | 667 | /* RX buffer is not empty */ |
| 660 | sun4i_can_rx(dev); | 668 | sun4i_can_rx(dev); |
