Re: [PATCH v2 1/5] net: marvell: prestera: fix driver reload

From: Andrew Lunn
Date: Wed Mar 20 2024 - 18:58:32 EST


On Wed, Mar 20, 2024 at 07:20:04PM +0200, Elad Nachman wrote:
> From: Elad Nachman <enachman@xxxxxxxxxxx>
>
> Driver rmmod after insmod would fail because API call to reset the switch
> HW and restart the firmware CPU code loading procedure was missing in
> driver removal code handler.
>
> Firmware reset and reload is needed as the firmware termination will make
> the firmware loader change its state machine to the firmware loading state,
> and thus will be able to load new firmware, which is done at the beginning
> of the probing of the prestera_pci module.
>
> Without this reset, the firmware loader will stay in the wrong state,
> causing the next firmware loading phase in the probe to fail.

What is missing from this is an explanation why you need to reload the
firmware at the next re-probe. That just seems like a waste of time if
you have already loaded it once.

Andrew