diff options
| author | David S. Miller <davem@davemloft.net> | 2017-11-11 21:52:01 +0900 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-11-11 21:52:01 +0900 |
| commit | 92d28828179675176cd90293699b394b6d22ce68 (patch) | |
| tree | a59ab85f275679d36aeea7bc998f0c350569f0f0 /drivers/net/can/sun4i_can.c | |
| parent | be234ba93c61927fd881e7c033a1cf31237d2742 (diff) | |
| parent | 4f7116757b4bd99e4ef2636c7d957a6d63035d11 (diff) | |
| download | talos-op-linux-92d28828179675176cd90293699b394b6d22ce68.tar.gz talos-op-linux-92d28828179675176cd90293699b394b6d22ce68.zip | |
Merge tag 'linux-can-fixes-for-4.14-20171110' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says:
====================
pull-request: can 2017-11-10
this is a pull request for net/master.
The first patch by Richard Schütz for the c_can driver removes the false
indication to support triple sampling for d_can. Gerhard Bertelsmann's
patch for the sun4i driver improves the RX overrun handling. The patch
by Stephane Grosjean for the peak_canfd driver adds the PCI ids for
various new PCIe/M2 interfaces. Marek Vasut's patch for the ifi driver
fix transmitter delay calculation.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
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) } stats->rx_over_errors++; stats->rx_errors++; + + /* reset the CAN IP by entering reset mode + * ignoring timeout error + */ + set_reset_mode(dev); + set_normal_mode(dev); + /* clear bit */ sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG); } @@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id) netif_wake_queue(dev); can_led_event(dev, CAN_LED_EVENT_TX); } - if (isrc & SUN4I_INT_RBUF_VLD) { - /* receive interrupt */ + if ((isrc & SUN4I_INT_RBUF_VLD) && + !(isrc & SUN4I_INT_DATA_OR)) { + /* receive interrupt - don't read if overrun occurred */ while (status & SUN4I_STA_RBUF_RDY) { /* RX buffer is not empty */ sun4i_can_rx(dev); |

