diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2022-03-08 11:29:04 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-09 14:59:14 +0000 |
commit | 0dbdf819f4c12337fbe5c8551d97f312a44a7d87 (patch) | |
tree | 449cc2f18982cbadc52bdff6f6696bff457e7605 /drivers/net/ethernet/microchip/lan966x/lan966x_main.h | |
parent | 2c9ec169f70bb13f71cf91cf018680e6e4fc8ce6 (diff) |
net: lan966x: Add spinlock for frame transmission from CPU.
The registers used to inject a frame to one of the ports is shared
between all the net devices. Therefore, there can be race conditions for
accessing the registers when two processes send frames at the same time
on different ports.
To fix this, add a spinlock around the function
'lan966x_port_ifh_xmit()'.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/lan966x/lan966x_main.h')
-rw-r--r-- | drivers/net/ethernet/microchip/lan966x/lan966x_main.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h index 058e43531818..ae282da1da74 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h @@ -108,6 +108,8 @@ struct lan966x { u8 base_mac[ETH_ALEN]; + spinlock_t tx_lock; /* lock for frame transmition */ + struct net_device *bridge; u16 bridge_mask; u16 bridge_fwd_mask; |