From: Andrew Lunn <andrew@lunn.ch>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, 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>,
Vladimir Oltean <olteanv@gmail.com>,
Russell King <linux@armlinux.org.uk>,
netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, driver-core@lists.linux.dev
Subject: Re: [PATCH net-next v19 4/6] net: dsa: mxl862xx: add devlink flash_update and info_get
Date: Sun, 4 Oct 2026 16:43:55 +0200 [thread overview]
Message-ID: <435b23c9-48ca-4cee-8bfb-70773be296ca@lunn.ch> (raw)
In-Reply-To: <6bf133505781800d1f64ea736e72c557759bb03e.1791035885.git.daniel@makrotopia.org>
On Sat, Oct 03, 2026 at 04:52:37PM +0100, Daniel Golle wrote:
> Implement "devlink dev flash" for firmware upgrade and "devlink dev
> info" for version reporting. info reports the chip part number and
> revision as the asic.id and asic.rev fixed versions, and the firmware
> version as both the running and the stored version, since the switch
> boots its firmware from its own flash; a zero part number or an all-zero
> version is omitted rather than published as a bogus match for userspace.
>
> flash validates the image and its payload CRCs, reboots the switch into
> its MCUboot loader with SYS_MISC_FW_UPDATE, transfers the image over the
> SB PDI clause-22 SMDIO protocol, and reboots into the new firmware once
> the loader has verified it. For the duration the driver closes and
> detaches the user ports so userspace cannot reopen them, closes the
> conduit, and blocks firmware API access under the MDIO bus lock so
> nothing reaches the bus after the switch has left for MCUboot. A blocked
> write reports success, so a bridge tearing its ports down over a flash
> does not see port_vlan_del() fail and leak its VLAN group. A transfer
> that fails leaves the switch in the loader; the next patch recovers it
> from there.
>
> MCUboot offers no in-place path back, so the driver reinitialises with a
> deferred re-probe scheduled through device_schedule_reprobe() from the
> previous patch, which runs in the driver core off the devlink caller's
> locks and without pinning the driver module. ->shutdown() and
> .remove() take the devlink instance lock up front, since neither goes
> through devlink and dsa_unregister_switch() frees the user netdevs
> before devlink_unregister() would: this waits out a transfer in flight,
> for as long as the transfer's own timeouts allow, rather than cutting
> it in half, and refuses a flash that starts once teardown has begun. A
> flash is refused as well until the DSA tree has finished its setup,
> since devlink registers the switch before the core creates the user
> ports.
>
> Assisted-by: LLM
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
next prev parent reply other threads:[~2026-10-04 14:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-03 15:50 [PATCH net-next v19 0/6] net: dsa: mxl862xx: devlink flash and rescue Daniel Golle
2026-10-03 15:51 ` [PATCH net-next v19 1/6] net: dsa: add devlink flash_update callback to dsa_switch_ops Daniel Golle
2026-10-03 15:51 ` [PATCH net-next v19 2/6] net: dsa: mxl862xx: add SMDIO clause-22 register access Daniel Golle
2026-10-03 15:52 ` [PATCH net-next v19 3/6] driver core: add device_schedule_reprobe() Daniel Golle
2026-10-03 15:52 ` [PATCH net-next v19 4/6] net: dsa: mxl862xx: add devlink flash_update and info_get Daniel Golle
2026-10-04 14:43 ` Andrew Lunn [this message]
2026-10-03 15:53 ` [PATCH net-next v19 5/6] net: dsa: mxl862xx: recover switch stuck in MCUboot rescue mode Daniel Golle
2026-10-04 14:45 ` Andrew Lunn
2026-10-03 15:54 ` [PATCH net-next v19 6/6] net: dsa: mxl862xx: document devlink flash and info support Daniel Golle
2026-10-04 15:56 [PATCH net-next v19 4/6] net: dsa: mxl862xx: add devlink flash_update and info_get netdev-bot+sashiko
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=435b23c9-48ca-4cee-8bfb-70773be296ca@lunn.ch \
--to=andrew@lunn.ch \
--cc=corbet@lwn.net \
--cc=dakr@kernel.org \
--cc=daniel@makrotopia.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=linux@armlinux.org.uk \
--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®