Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Yongzhao Chen <yongzhao.derek@gmail.com>
Cc: netdev@vger.kernel.org, Christian Marangi <ansuelsmth@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	John Crispin <john@phrozen.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 1/3] net: dsa: qca8k: propagate MDIO errors
Date: Tue, 29 Sep 2026 02:15:41 +0200	[thread overview]
Message-ID: <12875133-1659-4507-a007-c3cfa425ec76@lunn.ch> (raw)
In-Reply-To: <20260928220629.238-2-yongzhao.derek@gmail.com>

On Tue, Sep 29, 2026 at 12:06:27AM +0200, Yongzhao Chen wrote:
> qca8k_mii_write32() ignores errors from both 16-bit half-word writes.
> Its callers (register writes and read-modify-write helpers) then return
> the earlier successful page selection or read result, incorrectly
> reporting success even when writing the switch register failed.
> 
> Propagate write errors from both the low and high half-words through the
> regmap paths and internal MDIO master transactions. Attempt to clear
> MASTER_EN even if a transaction fails, preserving the initial error, and
> report a cleanup failure if the transaction itself succeeded. Preserve
> the existing Ethernet-to-MDIO fallback order.
> 
> Propagate read errors through the internal and legacy MDIO bus callbacks
> instead of masking them as 0xffff. Returning 0xffff causes PHY
> read-modify-write callers to treat the failed read as valid register
> data, which can corrupt unrelated bits on writeback.
> 
> Stop polling when reading the MDIO busy status fails, and return the
> error immediately. Because the read helper clears its output on failure,
> checking only the BUSY bit mistakes an unsuccessful read for transaction
> completion.
> 
> Fixes: 6b93fb46480a ("net-next: dsa: add new driver for qca8xxx family")

Does this actually bother anybody? Have there been reports of actual
MDIO errors?

If not, please drop the Fixes: tag and post for net-next.

   Andrew

  parent reply	other threads:[~2026-09-29  0:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 22:06 [PATCH net v2 0/3] net: dsa: qca8k: fix MDIO error handling Yongzhao Chen
2026-09-28 22:06 ` [PATCH net v2 1/3] net: dsa: qca8k: propagate MDIO errors Yongzhao Chen
2026-09-29  0:13   ` Andrew Lunn
2026-09-29  0:15   ` Andrew Lunn [this message]
2026-09-30 21:23     ` Yongzhao Chen
2026-09-28 22:06 ` [PATCH net v2 2/3] net: dsa: qca8k: do not clear MASTER_EN after a failed page select Yongzhao Chen
2026-09-28 22:06 ` [PATCH net v2 3/3] net: dsa: qca8k: fail mgmt Ethernet MDIO access on busy wait errors Yongzhao Chen

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=12875133-1659-4507-a007-c3cfa425ec76@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=yongzhao.derek@gmail.com \
    /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