Skip to contentSkip to conversation

net: pse-pd: realtek-pse-mcu: add RTL8238C device ID

PATCH Applied John 5 participants 5 messages Nov 15 – Nov 19

Subsystems (4)
lore
Share & tools
lore

John

author
#0 lore raw

PATCH 1/1 net: pse-pd: realtek-pse-mcu: add RTL8238C device ID

From: John Audia <[email protected]>

Some Ubiquiti USW Pro Max 16 PoE units (boardrevision 3) carry a PSE MCU that reports device id 0x0238, so probe fails with "unknown PSE id 0x238". poemgr names this id RTL8238C.

The high byte of the id follows the chip revision, as with RTL8239 (0x0039) and RTL8239C (0x0139), so add RTL8238C with the same power limits and power limit command as the RTL8238B (0x0138). Tested on such a unit, PoE works on all ports used.

---
 drivers/net/pse-pd/realtek-pse-mcu-core.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/pse-pd/realtek-pse-mcu-core.c +12 -0
index c70b09ca2012..9ae61184b573 100644
@@ -43,6 +43,7 @@
 #include "realtek-pse-mcu.h"
 
 #define RTPSE_MCU_DEVICE_ID_RTL8238B		0x0138
+#define RTPSE_MCU_DEVICE_ID_RTL8238C		0x0238
 #define RTPSE_MCU_DEVICE_ID_RTL8239		0x0039
 #define RTPSE_MCU_DEVICE_ID_RTL8239C		0x0139
 #define RTPSE_MCU_DEVICE_ID_BCM59111		0xe111
@@ -159,6 +160,14 @@ static const struct rtpse_mcu_chip_info rtl8238b_info = {
 	.pw_set_lsb_mW = 200,
 };
 
+static const struct rtpse_mcu_chip_info rtl8238c_info = {
+	.max_mW_per_port = 30000,
+	.name = "RTL8238C",
+	.pw_read_lsb_mW = 200,
+	.pw_set_cmd = RTPSE_MCU_CMD_PORT_SET_POWER_LIMIT,
+	.pw_set_lsb_mW = 200,
+};
+
 static const struct rtpse_mcu_chip_info rtl8239_info = {
 	.max_mW_per_port = 90000,
 	.name = "RTL8239",
@@ -746,6 +755,9 @@ static int rtpse_mcu_discover(struct rtpse_mcu_ctrl *pse, struct rtpse_mcu_info
 	case RTPSE_MCU_DEVICE_ID_RTL8238B:
 		pse->chip = &rtl8238b_info;
 		break;
+	case RTPSE_MCU_DEVICE_ID_RTL8238C:
+		pse->chip = &rtl8238c_info;
+		break;
 	case RTPSE_MCU_DEVICE_ID_RTL8239:
 		pse->chip = &rtl8239_info;
 		break;
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider.

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] The new RTL8238C entry (rtl8238c_info, drivers/net/pse- pd/realtek-pse-mcu-core.c:163) copies every RTL8238B value:…

--

net: pse-pd: realtek-pse-mcu: add RTL8238C device ID

This commit adds PSE MCU device id 0x0238 (RTL8238C) to the realtek PSE MCU driver. Some Ubiquiti USW Pro Max 16 PoE units ship with this MCU, and before this change probe failed on them. The new entry reuses the RTL8238B power limits, LSB scaling and power limit command.

Quoted 4 lines
drivers/net/pse-pd/realtek-pse-mcu-core.c +0 -0
index c70b09ca20122..9ae61184b5734 100644

[ ... ]

drivers/net/pse-pd/realtek-pse-mcu-core.c static const struct rtpse_mcu_chip_info rtl8238b_info = { · line 169

Quoted 11 lines
drivers/net/pse-pd/realtek-pse-mcu-core.c +7 -0
@@ -159,6 +160,14 @@ static const struct rtpse_mcu_chip_info rtl8238b_info = {
 	.pw_set_lsb_mW = 200,
 };
 
+static const struct rtpse_mcu_chip_info rtl8238c_info = {
+	.max_mW_per_port = 30000,
+	.name = "RTL8238C",
+	.pw_read_lsb_mW = 200,
+	.pw_set_cmd = RTPSE_MCU_CMD_PORT_SET_POWER_LIMIT,
+	.pw_set_lsb_mW = 200,
+};

[Severity: Medium]
Is there a source that confirms these values for id 0x0238?

The commit message cites poemgr for the name. The argument that the high byte tracks the chip revision shows the id numbering is consistent, but it doesn't say anything about the units or the power rating the MCU firmware uses. The same table already has chips with different units:
RTL8239 and RTL8239C use 400 mW LSBs, the EXT set command and a 90 W cap.

These four fields set everything the driver programs and reads back for power limits. In rtpse_mcu_port_set_pw_limit():

	if (max_mW < 0 || max_mW > chip->max_mW_per_port)
		return -ERANGE;
	...
	prg_val = min_t(unsigned int, DIV_ROUND_UP(max_mW, chip->pw_set_lsb_mW), U8_MAX);

and in rtpse_mcu_port_get_pw_limit():

	return min_t(u32, config.max_power * pse->chip->pw_read_lsb_mW,
		     pse->chip->max_mW_per_port);

Suppose the 0x0238 firmware uses 0.4 W units like the RTL8239 family. A 30 W request would then go out as raw 150, and the MCU would enforce about 60 W. The read-back would be off by 2x, and the min_t() clamp to 30000 would hide that, so ethtool would report a limit the hardware doesn't enforce.

Now suppose the part supports more than 30 W per port. Valid requests would then fail with -ERANGE, and get_pw_limit would report less than the real limit.

The commit message says "PoE works on all ports used". That covers power delivery under the MCU's default limits. Was a set/get round trip also tested on this unit, for example setting 15 W, reading 15 W back and checking that the MCU enforces it? Vendor material that confirms the units and per-port cap would also settle this.

[ ... ]

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/EEsDzyK4pKqMZ9P6eCtfk5Qp2SXyprlFB4e4uQ7_O1iw3BuvnNm95DKBxuHy-mp3vdmUWhob9UWOzN9VWXoYyQIADqKPNvJt_gfaLaWpSkU%3D%40proton.me
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to John
Quoted 10 lines · John

From: John Audia <[email protected]>

Some Ubiquiti USW Pro Max 16 PoE units (boardrevision 3) carry a PSE MCU that reports device id 0x0238, so probe fails with "unknown PSE id 0x238". poemgr names this id RTL8238C.

The high byte of the id follows the chip revision, as with RTL8239 (0x0039) and RTL8239C (0x0139), so add RTL8238C with the same power limits and power limit command as the RTL8238B (0x0138). Tested on such a unit, PoE works on all ports used.

Thank you!

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Reviewed-by on v1 1/1
#3 lore raw
In reply to John
Quoted 6 lines · John

From: John Audia <[email protected]>

Some Ubiquiti USW Pro Max 16 PoE units (boardrevision 3) carry a PSE MCU that reports device id 0x0238, so probe fails with "unknown PSE id 0x238". poemgr names this id RTL8238C.

Quoted 8 lines

The high byte of the id follows the chip revision, as with RTL8239 (0x0039) and RTL8239C (0x0139), so add RTL8238C with the same power limits and power limit command as the RTL8238B (0x0138). Tested on such a unit, PoE works on all ports used.

Best,
Jonas

#4 lore raw
In reply to John
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Sun, 15 Nov 2026 09:40:01 +0000 you wrote:

From: John Audia <[email protected]>

Some Ubiquiti USW Pro Max 16 PoE units (boardrevision 3) carry a PSE MCU that reports device id 0x0238, so probe fails with "unknown PSE id 0x238". poemgr names this id RTL8238C.

Quoted 6 lines

The high byte of the id follows the chip revision, as with RTL8239 (0x0039) and RTL8239C (0x0139), so add RTL8238C with the same power limits and power limit command as the RTL8238B (0x0138). Tested on such a unit, PoE works on all ports used.

[...]

Here is the summary with links:
- [net-next] net: pse-pd: realtek-pse-mcu: add RTL8238C device ID

    https://git.kernel.org/netdev/net-next/c/48198bec8475

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html