Re: [PATCH net] lan966x: Fix unloading/loading of the driver

From: Simon Horman
Date: Mon May 22 2023 - 09:46:30 EST


On Mon, May 22, 2023 at 02:00:38PM +0200, Horatiu Vultur wrote:
> 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.

Ouch.

> Unfortunetly, it is not possible to use a reset of the switch here,

nit: s/Unfortunetly/Unfortunately/

> because the reset line is connected to multiple devices like MDIO,
> SGPIO, FAN, etc. So then all the devices will get reseted when the

nit: s/reseted/reset/

> 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@xxxxxxxxxxxxx>

Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>

...