* [PATCH net-next] net: phy: realtek: register hwmon thermal zones
@ 2026-11-03 11:21 Hleb Shauchenka via B4 Relay
2026-11-03 13:41 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Hleb Shauchenka via B4 Relay @ 2026-11-03 11:21 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Hleb Shauchenka
From: Hleb Shauchenka <me@marleb.org>
The Realtek PHY hwmon device exposes the PHY temperature, but its
channel info lacks HWMON_C_REGISTER_TZ, so the hwmon core does not
register the sensor with the thermal framework and device-tree
thermal zones that reference the PHY cannot bind.
Set the flag, as the Aquantia PHY driver does. This lets the RTL8261N
sensors on the Zyxel XGS1250-12 B1 drive the chassis fan through
thermal cooling maps.
Tested on a Zyxel XGS1250-12 B1 with OpenWrt's Linux 6.18.55: the
three PHY thermal zones register, and an emulated 85 C reading on one
of them (CONFIG_THERMAL_EMULATION) switches the fan on through the
existing 80 C trip and off again once cleared.
This patch was prepared with AI assistance (Claude Opus 5.5 and Sol
6.1), which also helped investigate the problem and run the tests on
my switch.
Signed-off-by: Hleb Shauchenka <me@marleb.org>
---
drivers/net/phy/realtek/realtek_hwmon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/phy/realtek/realtek_hwmon.c b/drivers/net/phy/realtek/realtek_hwmon.c
index ac96e2d1e..e6235df28 100644
--- a/drivers/net/phy/realtek/realtek_hwmon.c
+++ b/drivers/net/phy/realtek/realtek_hwmon.c
@@ -51,6 +51,7 @@ static const struct hwmon_ops rtl822x_hwmon_ops = {
};
static const struct hwmon_channel_info * const rtl822x_hwmon_info[] = {
+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX),
NULL
};
---
base-commit: 7b6ab4dbc156e2f96419715130b3d5738a306c93
change-id: 20261103-realtek-hwmon-tz-95237a921bf9
Best regards,
--
Hleb Shauchenka <me@marleb.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: phy: realtek: register hwmon thermal zones
2026-11-03 11:21 [PATCH net-next] net: phy: realtek: register hwmon thermal zones Hleb Shauchenka via B4 Relay
@ 2026-11-03 13:41 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2026-11-03 13:41 UTC (permalink / raw)
To: me
Cc: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
On Tue, Nov 03, 2026 at 12:21:28PM +0100, Hleb Shauchenka via B4 Relay wrote:
> From: Hleb Shauchenka <me@marleb.org>
>
> The Realtek PHY hwmon device exposes the PHY temperature, but its
> channel info lacks HWMON_C_REGISTER_TZ, so the hwmon core does not
> register the sensor with the thermal framework and device-tree
> thermal zones that reference the PHY cannot bind.
>
> Set the flag, as the Aquantia PHY driver does. This lets the RTL8261N
> sensors on the Zyxel XGS1250-12 B1 drive the chassis fan through
> thermal cooling maps.
>
> Tested on a Zyxel XGS1250-12 B1 with OpenWrt's Linux 6.18.55: the
> three PHY thermal zones register, and an emulated 85 C reading on one
> of them (CONFIG_THERMAL_EMULATION) switches the fan on through the
> existing 80 C trip and off again once cleared.
>
> This patch was prepared with AI assistance (Claude Opus 5.5 and Sol
> 6.1), which also helped investigate the problem and run the tests on
> my switch.
>
> Signed-off-by: Hleb Shauchenka <me@marleb.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-03 13:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 11:21 [PATCH net-next] net: phy: realtek: register hwmon thermal zones Hleb Shauchenka via B4 Relay
2026-11-03 13:41 ` Andrew Lunn
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®