]> git.itanic.dy.fi Git - linux-stable/commit
lan966x: Fix unloading/loading of the driver
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Mon, 22 May 2023 12:00:38 +0000 (14:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:17:25 +0000 (14:17 +0100)
commit73d4e55a4e2c936fbe2a6f749e2803e880b5251e
tree3b836a382daf8b2ea062fd7237687abab123823a
parent965e9cccbe6b9c7b379908cebcb5e3a47f20dd5e
lan966x: Fix unloading/loading of the driver

commit 600761245952d7f70280add6ce02894f1528992b upstream.

It was noticing that after a while when unloading/loading the driver and
sending traffic through the switch, it would stop working. It would stop
forwarding any traffic and the only way to get out of this was to do a
power cycle of the board. The root cause seems to be that the switch
core is initialized twice. Apparently initializing twice the switch core
disturbs the pointers in the queue systems in the HW, so after a while
it would stop sending the traffic.
Unfortunetly, it is not possible to use a reset of the switch here,
because the reset line is connected to multiple devices like MDIO,
SGPIO, FAN, etc. So then all the devices will get reseted when the
network driver will be loaded.
So the fix is to check if the core is initialized already and if that is
the case don't initialize it again.

Fixes: db8bcaad5393 ("net: lan966x: add the basic lan966x driver")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230522120038.3749026-1-horatiu.vultur@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c