mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Oltean <olteanv@gmail.com>,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, driver-core@lists.linux.dev
Subject: Re: [PATCH net-next v16 0/6] net: dsa: mxl862xx: devlink flash and rescue
Date: Sat, 19 Sep 2026 10:04:14 +0100	[thread overview]
Message-ID: <aq5QDmuQnqQTudca@makrotopia.org> (raw)
In-Reply-To: <20260918180709.2fe12c2c@kernel.org>

On Fri, 18 Sep 2026 18:07:09 -0700 Jakub Kicinski wrote:
> 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?

The reload plumbing itself would look much like the flash_update hook
this series adds: reload_up/reload_down trampolines in the shared
dsa_devlink_ops forwarding to new dsa_switch_ops callbacks, plus
reload_actions. So "DSA has no reload" is not really the obstacle.

The difference is what the callbacks have to do. flash_update is a
pure forward to the driver. reload_* has to reinitialise the switch
while its devlink instance stays alive, since the reload command runs
through it. In DSA that instance is allocated and freed inside
dsa_switch_setup() and dsa_switch_teardown(), bracketing
ops->setup()/ops->teardown(), and the ports, tagger and user netdevs
come up a level higher in dsa_tree_setup(). So reload would need a new
DSA-core path that reinitialises a switch, and its ports, without
tearing down its devlink instance, and in a multi-switch tree touches
only the one switch.

The deferred re-probe avoids all of that by reusing the existing
unbind/register path, which rebuilds everything, a fresh devlink
instance included, so it needs nothing new in the DSA core. And the
helper it uses, device_schedule_reprobe(), is not something this
series invents just to sidestep reload: it should also replace the
open-coded deferred self-reprobe that iwlwifi, hci_h5 and btintel_pcie
already carry[1], where the work function ends by freeing its own
module text from under a racing rmmod. It is worth having on that
merit alone, with mxl862xx its first user and those conversions to
follow. So the re-probe leans on driver-core infrastructure that is
useful regardless; driving this through devlink reload instead would
add the DSA-core reinit path in addition to that helper, which those
three drivers still want, so it is more new code overall than a swap.

For that reason, and because the re-probe is what I have tested, I would
rather keep it, but I will add the DSA reload path if you feel firmware
activation on DSA should go through devlink reload. Either way the
rescue-mode detection at probe stays, since a switch found in MCUboot
has to register something for devlink to be reachable at all.

Cheers,

Daniel

[1]: https://lore.kernel.org/all/cover.1787281239.git.daniel@makrotopia.org/

      reply	other threads:[~2026-09-19  9:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 13:09 Daniel Golle
2026-09-15 13:09 ` [PATCH net-next v16 1/6] net: dsa: add devlink flash_update callback to dsa_switch_ops Daniel Golle
2026-09-15 13:09 ` [PATCH net-next v16 2/6] net: dsa: mxl862xx: add SMDIO clause-22 register access Daniel Golle
2026-09-15 13:09 ` [PATCH net-next v16 3/6] driver core: add device_schedule_reprobe() Daniel Golle
2026-09-15 13:10 ` [PATCH net-next v16 4/6] net: dsa: mxl862xx: add devlink flash_update and info_get Daniel Golle
2026-09-15 13:10 ` [PATCH net-next v16 5/6] net: dsa: mxl862xx: recover switch stuck in MCUboot rescue mode Daniel Golle
2026-09-15 13:11 ` [PATCH net-next v16 6/6] net: dsa: mxl862xx: document devlink flash and info support Daniel Golle
2026-09-19  1:07 ` [PATCH net-next v16 0/6] net: dsa: mxl862xx: devlink flash and rescue Jakub Kicinski
2026-09-19  9:04   ` Daniel Golle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aq5QDmuQnqQTudca@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=andrew@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=dakr@kernel.org \
    --cc=davem@davemloft.net \
    --cc=driver-core@lists.linux.dev \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®