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/2026…%40jonasjelonek.de