Re: [PATCH net-next v16 0/6] net: dsa: mxl862xx: devlink flash and rescue

From: Jakub Kicinski

Date: Fri Sep 18 2026 - 21:08:26 EST


On Tue, 15 Sep 2026 14:09:03 +0100 Daniel Golle wrote:
> This series adds "devlink dev flash" and "devlink dev info" support to
> the MaxLinear MxL862xx DSA driver, and makes a switch stuck in its
> MCUboot loader recoverable through the same path.
>
> The switch is flashed over the loader's clause-22 SMDIO download
> interface after the firmware API has rebooted it into MCUboot, and the
> driver reinitialises through a deferred detach and re-probe once the
> new image runs. A switch found in MCUboot at probe registers in a
> reduced rescue mode with firmware version 0.0.0, so the same flash flow
> recovers it; an interrupted download is drained in the background
> first. The deferred re-probe comes from a new driver-core helper,
> device_schedule_reprobe(), since a driver-owned work item cannot
> survive a racing rmmod, nor give up its detach once the core has
> blocked probing for a shutdown. fwupd's devlink plugin carries the
> matching quirks [17].
>
> Patch 3 is a driver-core change and patch 4 does not link without it,
> so the series needs a driver-core ack before net-next can take it.
>
> Tested on an MxL86252C switch of the BananaPi R4 Pro 8X: an upgrade
> through fwupd; a reboot issued while a flash was running, which waits
> for the transfer to finish; a host crash mid-transfer, whose wedged
> download the background drain recovered; and a power cut mid-transfer,
> after which the loader came up ready and fwupd flashed the switch from
> 0.0.0 back to a released firmware.

Having the "rescue mode" which only allows flashing a better / working
FW is fairly common these days. Did you consider driving the operation
more from user space. Let the user devlink reload into flashing mode,
and devlink reload back into normal operation mode?