Re: [PATCH net-next v2 2/3] net: phy: realtek: return MDIO read errors from hwmon

From
Andrew Lunn <andrew@lunn.ch>
Date
2026-11-07 17:18:57
Also in
linux-devicetree, lkml
Reply to
Hleb Shauchenka via B4 Relay, 2026-11-07
On Sat, Nov 07, 2026 at 06:00:46PM +0100, Hleb Shauchenka via B4 Relay wrote:
From: Hleb Shauchenka <redacted>

rtl822x_hwmon_read() masks or shifts the value returned by
phy_read_mmd() without checking it and returns success, so a failed
MDIO read is reported as a temperature: -EIO reads as -2.5 C and
-ETIMEDOUT as -55 C.

Return the error instead. Once the sensor feeds a thermal zone, the
thermal core then keeps its previous state rather than acting on a
bogus reading.

The problem was found by an AI review of the previous posting, and
this patch was prepared with AI assistance (Claude Opus 5.5). It is
build-tested only: I could not provoke a failed MDIO read on hardware.

Fixes: 33700ca45b7d ("net: phy: realtek: add hwmon support for temp sensor on RTL822x")
Fixes are not wanted when targeting net-next.

You need to decide, is this a bug which bothers people, so should be
for net, have a Fixes, tag and Cc: stable. Or it is a problem which
nobody cares about, so can be in net-next as just normal development
work.


    Andrew

---
pw-bot: cr
Thread (8 messages) 8 messages, 3 authors, last reply 12h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help