Commit ca3943c4 authored by David S. Miller's avatar David S. Miller

Merge tag 'linux-can-fixes-for-4.17-20180510' of...

Merge tag 'linux-can-fixes-for-4.17-20180510' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can

Marc Kleine-Budde says:

====================
this is a pull request for net/master consisting of 2 patches.

Both patches are from Lukas Wunner and fix two problems found in the
hi311x CAN driver under high load situations.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2fdae034 32bee8f4
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
#define HI3110_STAT_BUSOFF BIT(2) #define HI3110_STAT_BUSOFF BIT(2)
#define HI3110_STAT_ERRP BIT(3) #define HI3110_STAT_ERRP BIT(3)
#define HI3110_STAT_ERRW BIT(4) #define HI3110_STAT_ERRW BIT(4)
#define HI3110_STAT_TXMTY BIT(7)
#define HI3110_BTR0_SJW_SHIFT 6 #define HI3110_BTR0_SJW_SHIFT 6
#define HI3110_BTR0_BRP_SHIFT 0 #define HI3110_BTR0_BRP_SHIFT 0
...@@ -427,8 +428,10 @@ static int hi3110_get_berr_counter(const struct net_device *net, ...@@ -427,8 +428,10 @@ static int hi3110_get_berr_counter(const struct net_device *net,
struct hi3110_priv *priv = netdev_priv(net); struct hi3110_priv *priv = netdev_priv(net);
struct spi_device *spi = priv->spi; struct spi_device *spi = priv->spi;
mutex_lock(&priv->hi3110_lock);
bec->txerr = hi3110_read(spi, HI3110_READ_TEC); bec->txerr = hi3110_read(spi, HI3110_READ_TEC);
bec->rxerr = hi3110_read(spi, HI3110_READ_REC); bec->rxerr = hi3110_read(spi, HI3110_READ_REC);
mutex_unlock(&priv->hi3110_lock);
return 0; return 0;
} }
...@@ -735,10 +738,7 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) ...@@ -735,10 +738,7 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id)
} }
} }
if (intf == 0) if (priv->tx_len && statf & HI3110_STAT_TXMTY) {
break;
if (intf & HI3110_INT_TXCPLT) {
net->stats.tx_packets++; net->stats.tx_packets++;
net->stats.tx_bytes += priv->tx_len - 1; net->stats.tx_bytes += priv->tx_len - 1;
can_led_event(net, CAN_LED_EVENT_TX); can_led_event(net, CAN_LED_EVENT_TX);
...@@ -748,6 +748,9 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) ...@@ -748,6 +748,9 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id)
} }
netif_wake_queue(net); netif_wake_queue(net);
} }
if (intf == 0)
break;
} }
mutex_unlock(&priv->hi3110_lock); mutex_unlock(&priv->hi3110_lock);
return IRQ_HANDLED; return IRQ_HANDLED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment