[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f3e07026-8219-4b36-b230-7f7ddd71c7ab@gmail.com>
Date: Mon, 6 Jan 2025 19:05:13 +0100
From: Heiner Kallweit <hkallweit1@...il.com>
To: Realtek linux nic maintainers <nic_swsd@...ltek.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>, David Miller <davem@...emloft.net>,
Andrew Lunn <andrew+netdev@...n.ch>, Simon Horman <horms@...nel.org>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH net-next 2/2] r8169: add support for reading over-temp
threshold
Add support for reading the over-temp threshold. If the chip temperature
exceeds this value, the chip will reduce the speed to 1Gbps (by disabling
2.5G/5G advertisement and triggering a renegotiation).
Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 38f915956..fd6ff77e8 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5357,6 +5357,11 @@ static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
raw = phy_read_paged(tp->phydev, 0xbd8, 0x12) & 0x3ff;
*val = r8169_hwmon_get_temp(raw);
break;
+ case hwmon_temp_max:
+ /* Chip reduces speed to 1G if threshold is exceeded */
+ raw = phy_read_paged(tp->phydev, 0xb54, 0x16) >> 6;
+ *val = r8169_hwmon_get_temp(raw);
+ break;
default:
return -EINVAL;
}
@@ -5370,7 +5375,7 @@ static const struct hwmon_ops r8169_hwmon_ops = {
};
static const struct hwmon_channel_info * const r8169_hwmon_info[] = {
- HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX),
NULL
};
--
2.47.1
Powered by blists - more mailing lists