From: netdev-bot+sashiko@kernel.org
To: daniel@makrotopia.org
Cc: jiri@resnulli.us, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org,
gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org,
andrew@lunn.ch, olteanv@gmail.com, 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, 04 Oct 2026 15:56:36 +0000 [thread overview]
Message-ID: <179112939668.434549.2375428617012489937@kernel.org> (raw)
In-Reply-To: =?utf-8?q?=3C6bf133505781800d1f64ea736e72c557759bb03e=2E1791035?= =?utf-8?q?885=2Egit=2Edaniel=40makrotopia=2Eorg=3E?=
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In this patch, mxl862xx_devlink_flash_update() never checks that
the host MDIO bus can do clause-22 transactions before sending the…
--
net: dsa: mxl862xx: add devlink flash_update and info_get
This patch adds devlink dev info, which reports the asic.id, asic.rev
and firmware version. It also adds devlink dev flash, which reboots the
switch into its MCUboot loader with SYS_MISC_FW_UPDATE and sends the
image over the clause-22 SB PDI SMDIO protocol. After the flash, the
driver reinitialises through a deferred re-probe.
> diff --git a/drivers/net/dsa/mxl862xx/mxl862xx-fw.c b/drivers/net/dsa/mxl862xx/mxl862xx-fw.c
> new file mode 100644
> index 0000000000000..eae7048707870
> --- /dev/null
> +++ b/drivers/net/dsa/mxl862xx/mxl862xx-fw.c
[ ... ]
> +static int mxl862xx_flash_firmware(struct mxl862xx_priv *priv,
> + const struct firmware *fw,
> + u32 payload_size, struct devlink *dl)
> +{
> + const u8 *payload = fw->data + MXL862XX_FW_HDR_SIZE;
> + u32 word_idx = 0, data_written = 0, idx = 0;
> + unsigned long next_notify = jiffies - 1;
> + u16 word, fdata;
> + int ret, val, i;
> +
> + /* Step 1: reboot the firmware into MCUboot rescue mode */
> + ret = mxl862xx_api_wrap(priv, SYS_MISC_FW_UPDATE, NULL, 0,
> + false, false);
> + if (ret) {
> + dev_err(&priv->mdiodev->dev,
> + "flash: FW_UPDATE command failed: %pe\n",
> + ERR_PTR(ret));
> + return ret;
> + }
> +
> + /* Step 2: wait for bootloader ready */
> + mxl862xx_flash_notify(dl, "Waiting for bootloader", 0, 0);
> + ret = mxl862xx_sb_pdi_reset(priv);
> + if (ret < 0)
> + goto write_err;
[Severity: Low]
What happens here if the host MDIO bus only supports clause-45?
The normal firmware command path uses only clause-45 accessors:
drivers/net/dsa/mxl862xx/mxl862xx-host.c:mxl862xx_reg_read() {
return __mdiodev_c45_read(priv->mdiodev, MDIO_MMD_VEND1, addr);
}
So in this patch the driver can bind and run on a bus that has no
bus->read or bus->write. The SB PDI path goes through clause-22 instead:
mxl862xx_sb_pdi_reset()
mxl862xx_smdio_write()
__mdiobus_write()
and __mdiobus_write() does:
if (bus->write)
err = bus->write(bus, addr, regnum, val);
else
err = -EOPNOTSUPP;
On such a bus, the first SB PDI access fails with -EOPNOTSUPP. By then
SYS_MISC_FW_UPDATE has already set the sticky rescue bit and rebooted
the switch into MCUboot. MCUboot only offers the clause-22 SB PDI
window, so the driver has no way to reach the switch again.
Could the clause-22 capability be checked before the irreversible
SYS_MISC_FW_UPDATE is sent, for example in
mxl862xx_devlink_flash_update() before any ports are closed?
The next patch in the series, "net: dsa: mxl862xx: recover switch stuck
in MCUboot rescue mode", appears to make this unreachable.
mxl862xx_setup() there calls mxl862xx_rescue_mode_detect() over SMDIO
before any clause-45 access. On a clause-45-only bus that fails, setup
returns an error ("switch in an unusable state"), and the driver never
binds. So the problem only shows up when bisecting to this patch.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1791035885.git.daniel%40makrotopia.org
next reply other threads:[~2026-10-04 15:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-04 15:56 netdev-bot+sashiko [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-10-03 15:50 [PATCH net-next v19 0/6] net: dsa: mxl862xx: devlink flash and rescue 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
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=179112939668.434549.2375428617012489937@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=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®