net: lan966x: Add spinlock for frame transmission from CPU.
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Tue, 8 Mar 2022 10:29:04 +0000 (11:29 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Mar 2022 14:59:14 +0000 (14:59 +0000)
commit0dbdf819f4c12337fbe5c8551d97f312a44a7d87
tree449cc2f18982cbadc52bdff6f6696bff457e7605
parent2c9ec169f70bb13f71cf91cf018680e6e4fc8ce6
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>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.h