]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit41b0876f8d3fd0e213cae8dff81e278d91c9004a
tree449cc2f18982cbadc52bdff6f6696bff457e7605
parent5ab9047ab92d7491d4adc55b74e2e08fad2ff935
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