All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support
@ 2025-01-11 20:48 Heiner Kallweit
  2025-01-11 20:49 ` [PATCH net-next v2 1/3] net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on RTL8125/RTL8126 Heiner Kallweit
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Heiner Kallweit @ 2025-01-11 20:48 UTC (permalink / raw)
  To: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, Andrew Lunn
  Cc: netdev@vger.kernel.org

This adds hwmon support for the temperature sensor on RTL822x.
It's available on the standalone versions of the PHY's, and on the
internal PHY's of RTL8125B(P)/RTL8125D/RTL8126.

v2:
- patch 2: move Realtek PHY driver to its own subdirectory
- patch 3: remove alarm attribute

Heiner Kallweit (3):
  net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on
    RTL8125/RTL8126
  net: phy: move realtek PHY driver to its own subdirectory
  net: phy: realtek: add hwmon support for temp sensor on RTL822x

 drivers/net/phy/Kconfig                       |  5 +-
 drivers/net/phy/Makefile                      |  2 +-
 drivers/net/phy/realtek/Kconfig               | 11 +++
 drivers/net/phy/realtek/Makefile              |  4 +
 drivers/net/phy/realtek/realtek.h             | 10 +++
 drivers/net/phy/realtek/realtek_hwmon.c       | 79 +++++++++++++++++++
 .../phy/{realtek.c => realtek/realtek_main.c} | 24 +++++-
 7 files changed, 128 insertions(+), 7 deletions(-)
 create mode 100644 drivers/net/phy/realtek/Kconfig
 create mode 100644 drivers/net/phy/realtek/Makefile
 create mode 100644 drivers/net/phy/realtek/realtek.h
 create mode 100644 drivers/net/phy/realtek/realtek_hwmon.c
 rename drivers/net/phy/{realtek.c => realtek/realtek_main.c} (98%)

-- 
2.47.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH net-next v2 1/3] net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on RTL8125/RTL8126
  2025-01-11 20:48 [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support Heiner Kallweit
@ 2025-01-11 20:49 ` Heiner Kallweit
  2025-01-11 21:41   ` Andrew Lunn
  2025-01-11 20:50 ` [PATCH net-next v2 2/3] net: phy: move realtek PHY driver to its own subdirectory Heiner Kallweit
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Heiner Kallweit @ 2025-01-11 20:49 UTC (permalink / raw)
  To: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, Andrew Lunn
  Cc: netdev@vger.kernel.org

RTL8125/RTL8126 don't support MMD access to the internal PHY, but
provide a mechanism to access at least all MDIO_MMD_VEND2 registers.
By exposing this mechanism standard MMD access functions can be used
to access the MDIO_MMD_VEND2 registers.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/realtek.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index f65d7f1f3..af9874143 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -736,7 +736,11 @@ static int rtlgen_read_mmd(struct phy_device *phydev, int devnum, u16 regnum)
 {
 	int ret;
 
-	if (devnum == MDIO_MMD_PCS && regnum == MDIO_PCS_EEE_ABLE) {
+	if (devnum == MDIO_MMD_VEND2) {
+		rtl821x_write_page(phydev, regnum >> 4);
+		ret = __phy_read(phydev, 0x10 + ((regnum & 0xf) >> 1));
+		rtl821x_write_page(phydev, 0);
+	} else if (devnum == MDIO_MMD_PCS && regnum == MDIO_PCS_EEE_ABLE) {
 		rtl821x_write_page(phydev, 0xa5c);
 		ret = __phy_read(phydev, 0x12);
 		rtl821x_write_page(phydev, 0);
@@ -760,7 +764,11 @@ static int rtlgen_write_mmd(struct phy_device *phydev, int devnum, u16 regnum,
 {
 	int ret;
 
-	if (devnum == MDIO_MMD_AN && regnum == MDIO_AN_EEE_ADV) {
+	if (devnum == MDIO_MMD_VEND2) {
+		rtl821x_write_page(phydev, regnum >> 4);
+		ret = __phy_write(phydev, 0x10 + ((regnum & 0xf) >> 1), val);
+		rtl821x_write_page(phydev, 0);
+	} else if (devnum == MDIO_MMD_AN && regnum == MDIO_AN_EEE_ADV) {
 		rtl821x_write_page(phydev, 0xa5d);
 		ret = __phy_write(phydev, 0x10, val);
 		rtl821x_write_page(phydev, 0);
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net-next v2 2/3] net: phy: move realtek PHY driver to its own subdirectory
  2025-01-11 20:48 [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support Heiner Kallweit
  2025-01-11 20:49 ` [PATCH net-next v2 1/3] net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on RTL8125/RTL8126 Heiner Kallweit
@ 2025-01-11 20:50 ` Heiner Kallweit
  2025-01-11 21:42   ` Andrew Lunn
  2025-01-11 20:51 ` [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x Heiner Kallweit
  2025-01-14 23:00 ` [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support patchwork-bot+netdevbpf
  3 siblings, 1 reply; 12+ messages in thread
From: Heiner Kallweit @ 2025-01-11 20:50 UTC (permalink / raw)
  To: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, Andrew Lunn
  Cc: netdev@vger.kernel.org

In preparation of adding a source file with hwmon support, move the
Realtek PHY driver to its own subdirectory and rename realtek.c to
realtek_main.c.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/Kconfig                               | 5 +----
 drivers/net/phy/Makefile                              | 2 +-
 drivers/net/phy/realtek/Kconfig                       | 5 +++++
 drivers/net/phy/realtek/Makefile                      | 3 +++
 drivers/net/phy/{realtek.c => realtek/realtek_main.c} | 0
 5 files changed, 10 insertions(+), 5 deletions(-)
 create mode 100644 drivers/net/phy/realtek/Kconfig
 create mode 100644 drivers/net/phy/realtek/Makefile
 rename drivers/net/phy/{realtek.c => realtek/realtek_main.c} (100%)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index dc625f2b3..e043d3ef1 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -350,10 +350,7 @@ config QSEMI_PHY
 	help
 	  Currently supports the qs6612
 
-config REALTEK_PHY
-	tristate "Realtek PHYs"
-	help
-	  Supports the Realtek 821x PHY.
+source "drivers/net/phy/realtek/Kconfig"
 
 config RENESAS_PHY
 	tristate "Renesas PHYs"
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 39b72b464..c8dac6e92 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -95,7 +95,7 @@ obj-$(CONFIG_NXP_CBTX_PHY)	+= nxp-cbtx.o
 obj-$(CONFIG_NXP_TJA11XX_PHY)	+= nxp-tja11xx.o
 obj-y				+= qcom/
 obj-$(CONFIG_QSEMI_PHY)		+= qsemi.o
-obj-$(CONFIG_REALTEK_PHY)	+= realtek.o
+obj-$(CONFIG_REALTEK_PHY)	+= realtek/
 obj-$(CONFIG_RENESAS_PHY)	+= uPD60620.o
 obj-$(CONFIG_ROCKCHIP_PHY)	+= rockchip.o
 obj-$(CONFIG_SMSC_PHY)		+= smsc.o
diff --git a/drivers/net/phy/realtek/Kconfig b/drivers/net/phy/realtek/Kconfig
new file mode 100644
index 000000000..5b9e6e6db
--- /dev/null
+++ b/drivers/net/phy/realtek/Kconfig
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config REALTEK_PHY
+	tristate "Realtek PHYs"
+	help
+	  Currently supports RTL821x/RTL822x and fast ethernet PHYs
diff --git a/drivers/net/phy/realtek/Makefile b/drivers/net/phy/realtek/Makefile
new file mode 100644
index 000000000..996a80642
--- /dev/null
+++ b/drivers/net/phy/realtek/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+realtek-y			+= realtek_main.o
+obj-$(CONFIG_REALTEK_PHY)	+= realtek.o
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek/realtek_main.c
similarity index 100%
rename from drivers/net/phy/realtek.c
rename to drivers/net/phy/realtek/realtek_main.c
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x
  2025-01-11 20:48 [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support Heiner Kallweit
  2025-01-11 20:49 ` [PATCH net-next v2 1/3] net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on RTL8125/RTL8126 Heiner Kallweit
  2025-01-11 20:50 ` [PATCH net-next v2 2/3] net: phy: move realtek PHY driver to its own subdirectory Heiner Kallweit
@ 2025-01-11 20:51 ` Heiner Kallweit
  2025-01-11 21:52   ` Andrew Lunn
  2025-01-21 16:10   ` Geert Uytterhoeven
  2025-01-14 23:00 ` [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support patchwork-bot+netdevbpf
  3 siblings, 2 replies; 12+ messages in thread
From: Heiner Kallweit @ 2025-01-11 20:51 UTC (permalink / raw)
  To: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, Andrew Lunn
  Cc: netdev@vger.kernel.org

This adds hwmon support for the temperature sensor on RTL822x.
It's available on the standalone versions of the PHY's, and on
the integrated PHY's in RTL8125B/RTL8125D/RTL8126.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/realtek/Kconfig         |  6 ++
 drivers/net/phy/realtek/Makefile        |  1 +
 drivers/net/phy/realtek/realtek.h       | 10 ++++
 drivers/net/phy/realtek/realtek_hwmon.c | 79 +++++++++++++++++++++++++
 drivers/net/phy/realtek/realtek_main.c  | 12 ++++
 5 files changed, 108 insertions(+)
 create mode 100644 drivers/net/phy/realtek/realtek.h
 create mode 100644 drivers/net/phy/realtek/realtek_hwmon.c

diff --git a/drivers/net/phy/realtek/Kconfig b/drivers/net/phy/realtek/Kconfig
index 5b9e6e6db..31935f147 100644
--- a/drivers/net/phy/realtek/Kconfig
+++ b/drivers/net/phy/realtek/Kconfig
@@ -3,3 +3,9 @@ config REALTEK_PHY
 	tristate "Realtek PHYs"
 	help
 	  Currently supports RTL821x/RTL822x and fast ethernet PHYs
+
+config REALTEK_PHY_HWMON
+	def_bool REALTEK_PHY && HWMON
+	depends on !(REALTEK_PHY=y && HWMON=m)
+	help
+	  Optional hwmon support for the temperature sensor
diff --git a/drivers/net/phy/realtek/Makefile b/drivers/net/phy/realtek/Makefile
index 996a80642..dd21cf87f 100644
--- a/drivers/net/phy/realtek/Makefile
+++ b/drivers/net/phy/realtek/Makefile
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 realtek-y			+= realtek_main.o
+realtek-$(CONFIG_REALTEK_PHY_HWMON) += realtek_hwmon.o
 obj-$(CONFIG_REALTEK_PHY)	+= realtek.o
diff --git a/drivers/net/phy/realtek/realtek.h b/drivers/net/phy/realtek/realtek.h
new file mode 100644
index 000000000..a39b44fa1
--- /dev/null
+++ b/drivers/net/phy/realtek/realtek.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef REALTEK_H
+#define REALTEK_H
+
+#include <linux/phy.h>
+
+int rtl822x_hwmon_init(struct phy_device *phydev);
+
+#endif /* REALTEK_H */
diff --git a/drivers/net/phy/realtek/realtek_hwmon.c b/drivers/net/phy/realtek/realtek_hwmon.c
new file mode 100644
index 000000000..1ecb410bb
--- /dev/null
+++ b/drivers/net/phy/realtek/realtek_hwmon.c
@@ -0,0 +1,79 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * HWMON support for Realtek PHY's
+ *
+ * Author: Heiner Kallweit <hkallweit1@gmail.com>
+ */
+
+#include <linux/hwmon.h>
+#include <linux/phy.h>
+
+#include "realtek.h"
+
+#define RTL822X_VND2_TSALRM				0xa662
+#define RTL822X_VND2_TSRR				0xbd84
+#define RTL822X_VND2_TSSR				0xb54c
+
+static int rtl822x_hwmon_get_temp(int raw)
+{
+	if (raw >= 512)
+		raw -= 1024;
+
+	return 1000 * raw / 2;
+}
+
+static int rtl822x_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
+			      u32 attr, int channel, long *val)
+{
+	struct phy_device *phydev = dev_get_drvdata(dev);
+	int raw;
+
+	switch (attr) {
+	case hwmon_temp_input:
+		raw = phy_read_mmd(phydev, MDIO_MMD_VEND2, RTL822X_VND2_TSRR) & 0x3ff;
+		*val = rtl822x_hwmon_get_temp(raw);
+		break;
+	case hwmon_temp_max:
+		/* Chip reduces speed to 1G if threshold is exceeded */
+		raw = phy_read_mmd(phydev, MDIO_MMD_VEND2, RTL822X_VND2_TSSR) >> 6;
+		*val = rtl822x_hwmon_get_temp(raw);
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static const struct hwmon_ops rtl822x_hwmon_ops = {
+	.visible = 0444,
+	.read = rtl822x_hwmon_read,
+};
+
+static const struct hwmon_channel_info * const rtl822x_hwmon_info[] = {
+	HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX),
+	NULL
+};
+
+static const struct hwmon_chip_info rtl822x_hwmon_chip_info = {
+	.ops = &rtl822x_hwmon_ops,
+	.info = rtl822x_hwmon_info,
+};
+
+int rtl822x_hwmon_init(struct phy_device *phydev)
+{
+	struct device *hwdev, *dev = &phydev->mdio.dev;
+	const char *name;
+
+	/* Ensure over-temp alarm is reset. */
+	phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, RTL822X_VND2_TSALRM, 3);
+
+	name = devm_hwmon_sanitize_name(dev, dev_name(dev));
+	if (IS_ERR(name))
+		return PTR_ERR(name);
+
+	hwdev = devm_hwmon_device_register_with_info(dev, name, phydev,
+						     &rtl822x_hwmon_chip_info,
+						     NULL);
+	return PTR_ERR_OR_ZERO(hwdev);
+}
diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
index af9874143..38149958d 100644
--- a/drivers/net/phy/realtek/realtek_main.c
+++ b/drivers/net/phy/realtek/realtek_main.c
@@ -14,6 +14,8 @@
 #include <linux/delay.h>
 #include <linux/clk.h>
 
+#include "realtek.h"
+
 #define RTL821x_PHYSR				0x11
 #define RTL821x_PHYSR_DUPLEX			BIT(13)
 #define RTL821x_PHYSR_SPEED			GENMASK(15, 14)
@@ -820,6 +822,15 @@ static int rtl822x_write_mmd(struct phy_device *phydev, int devnum, u16 regnum,
 	return ret;
 }
 
+static int rtl822x_probe(struct phy_device *phydev)
+{
+	if (IS_ENABLED(CONFIG_REALTEK_PHY_HWMON) &&
+	    phydev->phy_id != RTL_GENERIC_PHYID)
+		return rtl822x_hwmon_init(phydev);
+
+	return 0;
+}
+
 static int rtl822xb_config_init(struct phy_device *phydev)
 {
 	bool has_2500, has_sgmii;
@@ -1519,6 +1530,7 @@ static struct phy_driver realtek_drvs[] = {
 		.match_phy_device = rtl_internal_nbaset_match_phy_device,
 		.name           = "Realtek Internal NBASE-T PHY",
 		.flags		= PHY_IS_INTERNAL,
+		.probe		= rtl822x_probe,
 		.get_features   = rtl822x_get_features,
 		.config_aneg    = rtl822x_config_aneg,
 		.read_status    = rtl822x_read_status,
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next v2 1/3] net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on RTL8125/RTL8126
  2025-01-11 20:49 ` [PATCH net-next v2 1/3] net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on RTL8125/RTL8126 Heiner Kallweit
@ 2025-01-11 21:41   ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2025-01-11 21:41 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, netdev@vger.kernel.org

On Sat, Jan 11, 2025 at 09:49:31PM +0100, Heiner Kallweit wrote:
> RTL8125/RTL8126 don't support MMD access to the internal PHY, but
> provide a mechanism to access at least all MDIO_MMD_VEND2 registers.
> By exposing this mechanism standard MMD access functions can be used
> to access the MDIO_MMD_VEND2 registers.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next v2 2/3] net: phy: move realtek PHY driver to its own subdirectory
  2025-01-11 20:50 ` [PATCH net-next v2 2/3] net: phy: move realtek PHY driver to its own subdirectory Heiner Kallweit
@ 2025-01-11 21:42   ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2025-01-11 21:42 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, netdev@vger.kernel.org

On Sat, Jan 11, 2025 at 09:50:19PM +0100, Heiner Kallweit wrote:
> In preparation of adding a source file with hwmon support, move the
> Realtek PHY driver to its own subdirectory and rename realtek.c to
> realtek_main.c.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x
  2025-01-11 20:51 ` [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x Heiner Kallweit
@ 2025-01-11 21:52   ` Andrew Lunn
  2025-01-11 22:30     ` Heiner Kallweit
  2025-01-21 16:10   ` Geert Uytterhoeven
  1 sibling, 1 reply; 12+ messages in thread
From: Andrew Lunn @ 2025-01-11 21:52 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, netdev@vger.kernel.org

> +config REALTEK_PHY_HWMON
> +	def_bool REALTEK_PHY && HWMON
> +	depends on !(REALTEK_PHY=y && HWMON=m)
> +	help
> +	  Optional hwmon support for the temperature sensor

We frequently end up with build problems with HWMON. All the other
PHYs use:

        depends on HWMON || HWMON=n

We have not yet seen 0-day report issues with your earlier patchsets
versions, but maybe we should keep it the same as all other PHYs? But
maybe it is actually the same, if you apply De Morgan's Law?

	Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x
  2025-01-11 21:52   ` Andrew Lunn
@ 2025-01-11 22:30     ` Heiner Kallweit
  2025-01-12 16:39       ` Andrew Lunn
  0 siblings, 1 reply; 12+ messages in thread
From: Heiner Kallweit @ 2025-01-11 22:30 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, netdev@vger.kernel.org

On 11.01.2025 22:52, Andrew Lunn wrote:
>> +config REALTEK_PHY_HWMON
>> +	def_bool REALTEK_PHY && HWMON
>> +	depends on !(REALTEK_PHY=y && HWMON=m)
>> +	help
>> +	  Optional hwmon support for the temperature sensor
> 
> We frequently end up with build problems with HWMON. All the other
> PHYs use:
> 
>         depends on HWMON || HWMON=n
> 

The situation is different here. In the other cases HWMON is used from
the main source file. If HWMON=n, then the main source file can be
built as module or be built-in, and the stubs of the HWMON functions
are used.

In my case, if HWMON=n, I want REALTEK_PHY_HWMON to be n, because
then I omit building realtek_hwmon.c (see Makefile).

> We have not yet seen 0-day report issues with your earlier patchsets
> versions, but maybe we should keep it the same as all other PHYs? But
> maybe it is actually the same, if you apply De Morgan's Law?
> 
> 	Andrew

Heiner

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x
  2025-01-11 22:30     ` Heiner Kallweit
@ 2025-01-12 16:39       ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2025-01-12 16:39 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, netdev@vger.kernel.org

> In my case, if HWMON=n, I want REALTEK_PHY_HWMON to be n, because
> then I omit building realtek_hwmon.c (see Makefile).

Thanks for the explanation.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support
  2025-01-11 20:48 [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support Heiner Kallweit
                   ` (2 preceding siblings ...)
  2025-01-11 20:51 ` [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x Heiner Kallweit
@ 2025-01-14 23:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-14 23:00 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: pabeni, kuba, davem, edumazet, horms, linux, andrew, netdev

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 11 Jan 2025 21:48:29 +0100 you wrote:
> This adds hwmon support for the temperature sensor on RTL822x.
> It's available on the standalone versions of the PHY's, and on the
> internal PHY's of RTL8125B(P)/RTL8125D/RTL8126.
> 
> v2:
> - patch 2: move Realtek PHY driver to its own subdirectory
> - patch 3: remove alarm attribute
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/3] net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on RTL8125/RTL8126
    https://git.kernel.org/netdev/net-next/c/3d483a10327f
  - [net-next,v2,2/3] net: phy: move realtek PHY driver to its own subdirectory
    https://git.kernel.org/netdev/net-next/c/1416a9b2ba71
  - [net-next,v2,3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x
    https://git.kernel.org/netdev/net-next/c/33700ca45b7d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x
  2025-01-11 20:51 ` [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x Heiner Kallweit
  2025-01-11 21:52   ` Andrew Lunn
@ 2025-01-21 16:10   ` Geert Uytterhoeven
  2025-01-23 20:12     ` Heiner Kallweit
  1 sibling, 1 reply; 12+ messages in thread
From: Geert Uytterhoeven @ 2025-01-21 16:10 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, Andrew Lunn,
	netdev@vger.kernel.org, linux-hwmon

 	Hi Heiner,

CC hwmon

On Sat, 11 Jan 2025, Heiner Kallweit wrote:
> This adds hwmon support for the temperature sensor on RTL822x.
> It's available on the standalone versions of the PHY's, and on
> the integrated PHY's in RTL8125B/RTL8125D/RTL8126.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Thanks for your patch, which is now commit 33700ca45b7d2e16
("net: phy: realtek: add hwmon support for temp sensor on
RTL822x") in net-next.

> --- a/drivers/net/phy/realtek/Kconfig
> +++ b/drivers/net/phy/realtek/Kconfig
> @@ -3,3 +3,9 @@ config REALTEK_PHY
> 	tristate "Realtek PHYs"
> 	help
> 	  Currently supports RTL821x/RTL822x and fast ethernet PHYs
> +
> +config REALTEK_PHY_HWMON
> +	def_bool REALTEK_PHY && HWMON
> +	depends on !(REALTEK_PHY=y && HWMON=m)
> +	help
> +	  Optional hwmon support for the temperature sensor

So this is optional, but as the symbol is invisible, it cannot be
disabled by the user. Is that intentional?

Gr{oetje,eeting}s,

 						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
 							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x
  2025-01-21 16:10   ` Geert Uytterhoeven
@ 2025-01-23 20:12     ` Heiner Kallweit
  0 siblings, 0 replies; 12+ messages in thread
From: Heiner Kallweit @ 2025-01-23 20:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Paolo Abeni, Jakub Kicinski, David Miller, Eric Dumazet,
	Simon Horman, Russell King - ARM Linux, Andrew Lunn,
	netdev@vger.kernel.org, linux-hwmon

On 21.01.2025 17:10, Geert Uytterhoeven wrote:
>     Hi Heiner,
> 
> CC hwmon
> 
> On Sat, 11 Jan 2025, Heiner Kallweit wrote:
>> This adds hwmon support for the temperature sensor on RTL822x.
>> It's available on the standalone versions of the PHY's, and on
>> the integrated PHY's in RTL8125B/RTL8125D/RTL8126.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> 
> Thanks for your patch, which is now commit 33700ca45b7d2e16
> ("net: phy: realtek: add hwmon support for temp sensor on
> RTL822x") in net-next.
> 
>> --- a/drivers/net/phy/realtek/Kconfig
>> +++ b/drivers/net/phy/realtek/Kconfig
>> @@ -3,3 +3,9 @@ config REALTEK_PHY
>>     tristate "Realtek PHYs"
>>     help
>>       Currently supports RTL821x/RTL822x and fast ethernet PHYs
>> +
>> +config REALTEK_PHY_HWMON
>> +    def_bool REALTEK_PHY && HWMON
>> +    depends on !(REALTEK_PHY=y && HWMON=m)
>> +    help
>> +      Optional hwmon support for the temperature sensor
> 
> So this is optional, but as the symbol is invisible, it cannot be
> disabled by the user. Is that intentional?
> 
Well, it isn't intentional in either direction.
Thanks for the hint, I should make it user-visible.

> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-01-23 20:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-11 20:48 [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support Heiner Kallweit
2025-01-11 20:49 ` [PATCH net-next v2 1/3] net: phy: realtek: add support for reading MDIO_MMD_VEND2 regs on RTL8125/RTL8126 Heiner Kallweit
2025-01-11 21:41   ` Andrew Lunn
2025-01-11 20:50 ` [PATCH net-next v2 2/3] net: phy: move realtek PHY driver to its own subdirectory Heiner Kallweit
2025-01-11 21:42   ` Andrew Lunn
2025-01-11 20:51 ` [PATCH net-next v2 3/3] net: phy: realtek: add hwmon support for temp sensor on RTL822x Heiner Kallweit
2025-01-11 21:52   ` Andrew Lunn
2025-01-11 22:30     ` Heiner Kallweit
2025-01-12 16:39       ` Andrew Lunn
2025-01-21 16:10   ` Geert Uytterhoeven
2025-01-23 20:12     ` Heiner Kallweit
2025-01-14 23:00 ` [PATCH net-next v2 0/3] net: phy: realtek: add hwmon support patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.