aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/natsemi/sonic.h
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2020-01-23 09:07:26 +1100
committerDavid S. Miller <davem@davemloft.net>2020-01-23 21:24:36 +0100
commit865ad2f2201dc18685ba2686f13217f8b3a9c52c (patch)
tree3ef509d765bcb69bf2a1c179114ba4555b8c9a55 /drivers/net/ethernet/natsemi/sonic.h
parentnet: fsl/fman: rename IF_MODE_XGMII to IF_MODE_10G (diff)
downloadlinux-dev-865ad2f2201dc18685ba2686f13217f8b3a9c52c.tar.xz
linux-dev-865ad2f2201dc18685ba2686f13217f8b3a9c52c.zip
net/sonic: Add mutual exclusion for accessing shared state
The netif_stop_queue() call in sonic_send_packet() races with the netif_wake_queue() call in sonic_interrupt(). This causes issues like "NETDEV WATCHDOG: eth0 (macsonic): transmit queue 0 timed out". Fix this by disabling interrupts when accessing tx_skb[] and next_tx. Update a comment to clarify the synchronization properties. Fixes: efcce839360f ("[PATCH] macsonic/jazzsonic network drivers update") Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/natsemi/sonic.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/natsemi/sonic.h b/drivers/net/ethernet/natsemi/sonic.h
index 2b27f7049acb..f9506863e9d1 100644
--- a/drivers/net/ethernet/natsemi/sonic.h
+++ b/drivers/net/ethernet/natsemi/sonic.h
@@ -322,6 +322,7 @@ struct sonic_local {
int msg_enable;
struct device *device; /* generic device */
struct net_device_stats stats;
+ spinlock_t lock;
};
#define TX_TIMEOUT (3 * HZ)