Re: [PATCH net] net: dsa: qca8k: propagate MDIO errors

From: Yongzhao Chen

Date: Mon Sep 28 2026 - 18:11:32 EST


On Sun, 27 Sep 2026 22:12:38 +0000, Sashiko wrote:
> qca8k_mdio_read() has the same pattern. Could a set_page failure unlock
> and return directly, or use a separate label, so that the MASTER_EN
> clear only runs after page 0 has been selected?

Yes. No transaction has started at that point, so there is nothing to
clean up, and the write can hit a register on another page. The next
version returns right after a failed page select. It also invalidates
the cached page, since a failed page write may still have reached the
switch.

> Doesn't the same outcome remain on this Ethernet path? Should the check
> after read_poll_timeout() in qca8k_phy_eth_command() also bail out when
> ret < 0 and ret1 == 0?

Yes. The next version stops polling on the first failed request and
returns the poll error or the timeout, so qca8k_internal_mdio_read()
falls back to the MDIO bus. The same exit path also leaked read_skb;
that is fixed too.

Both problems predate this patch. I reproduced them with a userspace
model that compiles the driver's own functions. My board (QCA8337 with
its PHYs on the SoC MDIO bus and no CPU port 0) never uses these paths,
so they are not hardware-tested. v2 will be a three-patch series with
one patch per issue.

pw-bot: cr

Thanks,
Yongzhao