From: netdev-bot+sashiko@kernel.org
To: jonas@jonasjelonek.de
Cc: o.rempel@pengutronix.de, kory.maincent@bootlin.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, russell@personaltelco.net
Subject: Re: [PATCH net] net: pse-pd: realtek-pse-mcu: ensure MCU does dynamic power management
Date: Mon, 30 Nov 2026 23:47:26 +0000 [thread overview]
Message-ID: <179608244650.3146.5191319119181327382@kernel.org> (raw)
In-Reply-To: <20261129234635.3357243-1-jonas@jonasjelonek.de>
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] In drivers/net/pse-pd/realtek-pse-mcu-core.c,
rtpse_mcu_register() now forces the MCU into mode 0x02, "dynamic, with…
--
net: pse-pd: realtek-pse-mcu: ensure MCU does dynamic power management
This commit adds a SET_POWER_MGMT_MODE command to both dialects: 0x17
for Gen1 and 0x10 for Gen2. rtpse_mcu_register() issues it to put the
MCU into dynamic power management with port priority (mode 0x02). Probe
fails if the command fails, and the mode is selected before the
disable-ports GPIO is deasserted.
> diff --git a/drivers/net/pse-pd/realtek-pse-mcu-core.c b/drivers/net/pse-pd/realtek-pse-mcu-core.c
> index c70b09ca20122..e382045932e9e 100644
> --- a/drivers/net/pse-pd/realtek-pse-mcu-core.c
> +++ b/drivers/net/pse-pd/realtek-pse-mcu-core.c
[ ... ]
> @@ -369,6 +373,26 @@ static int rtpse_mcu_set_global_state(struct rtpse_mcu_ctrl *pse, bool enable)
> return (resp.payload[0] == 0x0) ? 0 : -EIO;
> }
>
> +static int rtpse_mcu_set_power_mgmt_mode(struct rtpse_mcu_ctrl *pse)
> +{
> + struct rtpse_mcu_msg req, resp;
> + const struct rtpse_mcu_opcode *opc;
> + int ret;
> +
> + opc = &pse->dialect->opcode[RTPSE_MCU_CMD_SET_POWER_MGMT_MODE];
> + if (!opc->valid)
> + return -EOPNOTSUPP;
> +
> + rtpse_mcu_msg_init(&req, opc->op);
> + req.payload[0] = RTPSE_MCU_POWER_MGMT_DYNAMIC_PRIO;
[Severity: Medium]
Is the global power budget that this mode checks against ever set?
This function writes only the mode byte. enum rtpse_mcu_cmd has no
budget command, and neither the Gen1 nor the Gen2 opcode table maps
one. In the Gen1 command family, 0x18 (next to 0x17) is the set global
power budget command.
The only budget reference in the driver is in rtpse_mcu_register():
pse->pcdev.supp_budget_eval_strategies = PSE_BUDGET_EVAL_STRAT_DYNAMIC;
pse.h says PSE_BUDGET_EVAL_STRAT_DYNAMIC compares "the current
consumption per ports compared to the total power budget". It also
says this mode "is managed by the PSE controller". pse_core does not do
its own budget accounting for this strategy.
If a board's firmware defaults to a non-managed mode, the MCU used to
ignore its stored budget. With this patch, every probe makes the MCU
enforce whatever budget the firmware holds.
If that budget is below the real supply, or zero, could PDs be refused
or shed? If it is above what the PSU can deliver, could the PSU be
over-committed?
The commit message says the driver should "ensure that the MCU performs
dynamic power management with priorities as advertised". Should the
budget also be programmed here, or at least read back and logged, so
that the policy is actually established?
> +
> + ret = rtpse_mcu_do_xfer(pse, &req, &resp);
> + if (ret)
> + return ret;
> +
> + return (resp.payload[0] == 0x0) ? 0 : -EIO;
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129234635.3357243-1-jonas%40jonasjelonek.de
prev parent reply other threads:[~2026-11-30 23:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 23:46 Jonas Jelonek
2026-11-29 23:48 ` netdev-bot+sinfo
2026-11-30 0:25 ` Russell Senior
2026-11-30 15:09 ` Kory Maincent
2026-11-30 23:47 ` netdev-bot+sashiko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179608244650.3146.5191319119181327382@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jonas@jonasjelonek.de \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=russell@personaltelco.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®