Re: [PATCH net-next v13 1/6] net: dsa: add devlink flash_update callback to dsa_switch_ops

From: Andrew Lunn

Date: Tue Sep 08 2026 - 08:30:54 EST


On Mon, Sep 07, 2026 at 07:37:37PM +0100, Daniel Golle wrote:
> Add a devlink_flash_update callback to dsa_switch_ops so that DSA
> drivers can support devlink dev flash without open-coding the devlink
> plumbing. Like the other trampolines in net/dsa/devlink.c, the op
> returns -EOPNOTSUPP when the driver does not implement the callback;
> the devlink core will then have fetched the firmware file from
> userspace before the request fails, which is acceptable for an
> operation as infrequent as a firmware update.
>
> The devlink core calls the op with the devlink instance lock held and
> without rtnl_lock, whereas DSA serialises its switch and port ops
> under rtnl_lock, so a driver has to serialise a flash against its own
> ops itself.
>
> Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew