mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonas Jelonek <jonas@jonasjelonek.de>
To: netdev-bot+sashiko@kernel.org
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,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	sander@svanheule.net, russell@personaltelco.net
Subject: Re: [PATCH net-next v2 2/3] net: pse-pd: realtek-pse-mcu: ensure MCU does dynamic power management
Date: Mon, 30 Nov 2026 00:46:07 +0100	[thread overview]
Message-ID: <3c52e800-fed6-4687-8b5d-96d104ace2c5@jonasjelonek.de> (raw)
In-Reply-To: <179506764349.3136.14504567519359431973@kernel.org>



On 19.11.26 06:54, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 3 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 2
>
> 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] rtpse_mcu_register() (drivers/net/pse-pd/realtek-pse-mcu-
>   core.c:854-857) now fails probe on any error from the new…
> - [Low] The commit has no Fixes: tag, but it fixes a user-visible defect
>   in the original driver commit 44566e614d84 ("net: pse-pd: add Realtek…
> - [Low] In this commit, the comment above the 'disable-ports' GPIO
>   request in rtpse_mcu_register() (drivers/net/pse-pd/realtek-pse-mcu-…
>
> --
>
> net: pse-pd: realtek-pse-mcu: ensure MCU does dynamic power management
>
> This adds a command that switches the Realtek PSE MCU to dynamic power
> management with port priorities. It uses opcode 0x17 on gen1 and 0x10 on
> gen2. rtpse_mcu_register() sends the command after discovery and before
> the disable-ports gpio is released, and probe fails if the command fails.
>
>> The MCU may have any power management mode configuration by default
>> but the driver should ensure that the MCU performs dynamic power
>> management with priorities as advertised. On certain devices, the
>> default MCU configuration ships with another default, possibly
>> preventing any power delivery.
> [Severity: Low]
> This describes a user-visible problem in the original driver. Should the
> patch carry a Fixes: tag?
>
> Since commit 44566e614d84 ("net: pse-pd: add Realtek PSE MCU core"),
> rtpse_mcu_register() has set PSE_BUDGET_EVAL_STRAT_DYNAMIC and
> pis_prio_max. It has never put the MCU into the matching mode. That
> commit's message says "Power budgeting is left to the MCU firmware; the
> driver advertises PSE_BUDGET_EVAL_STRAT_DYNAMIC accordingly".
>
> Without the tag, the stable and backport tooling won't pick this up for
> kernels that already carry the driver. Perhaps:
>
> Fixes: 44566e614d84 ("net: pse-pd: add Realtek PSE MCU core")
>
> If the patch is meant to stay in net-next with the VMAIN budget work,
> could the commit message still name the commit it fixes?

Makes sense. I'll split it out and send to net separately since it actually
isn't tied to the VMAIN budget stuff and strictly seen a fix.

>> diff --git a/drivers/net/pse-pd/realtek-pse-mcu-core.c b/drivers/net/pse-pd/realtek-pse-mcu-core.c
>> index c70b09ca20122..d8b6e05039397 100644
>> --- a/drivers/net/pse-pd/realtek-pse-mcu-core.c
>> +++ b/drivers/net/pse-pd/realtek-pse-mcu-core.c
> [ ... ]
>
>> @@ -826,6 +850,12 @@ int rtpse_mcu_register(struct rtpse_mcu_ctrl *pse)
>>  	if (ret)
>>  		return ret;
>>  
>> +	/* ensure the MCU does dynamic power management with priorities */
>> +	ret = rtpse_mcu_set_power_mgmt_mode(pse);
>> +	if (ret)
>> +		return dev_err_probe(pse->dev, ret,
>> +				     "failed to set power management mode\n");
> [Severity: Medium]
> Could this break probe on boards that worked before this patch?
>
> Both dialects now define the opcode (0x17 for gen1, 0x10 for gen2). That
> means rtpse_mcu_set_power_mgmt_mode() never takes its -EOPNOTSUPP path.
> It turns any non-zero status byte from the MCU into -EIO:
>
> 	return (resp.payload[0] == 0x0) ? 0 : -EIO;
>
> A NOT_READY reply only gets the three resends inside
> rtpse_mcu_do_xfer(). It does not get the bounded boot-retry window that
> rtpse_mcu_discover() uses.
>
> Some firmware variants may reject the command, or fail it with -EAGAIN,
> -EBADMSG or -EBADE. In that case rtpse_mcu_register() returns before the
> disable-ports gpio is requested and before devm_pse_controller_register()
> runs.
>
> On boards with the disable-ports gate, that leaves no PoE at all. On
> boards without the gate, the MCU keeps its old policy but the kernel
> registers no PSE controller. Before this patch, those boards probed as
> long as the firmware default policy was usable.
>
> Is it known that every supported gen1 and gen2 firmware accepts this
> command? The changelog mentions "change error handling", so a softer
> variant seems to have been considered. If warning and continuing is not
> safe, could the commit message explain why the failure needs to be
> fatal?

There is no known firmware version that doesn't support this command
and this quite essential command could be assumed always being
implemented. Moreover, I think failing is accurate because if not, the
driver would continue to register a PSE controller which claims dynamic
power management but actually employs a different policy in the MCU.
This is the current state, though not on purpose.

>> +
>>  	/*
>>  	 * Some boards gate all ports through a hardware line; deassert it only
>>  	 * after the MCU is confirmed, so a discover failure never ungates the
> [Severity: Low]
> This isn't a bug, but this comment still names only discovery as the step
> that has to succeed before the ports are ungated. The new
> rtpse_mcu_set_power_mgmt_mode() call above is now a precondition too.
>
> The next patch in the series, "net: pse-pd: realtek-pse-mcu: configure
> global power budget", rewrites this comment to "deassert it only after
> discovery, budget setup and management-mode selection succeed". That
> fixes it by the end of the series.
>

I'll fix it in the split-out commit.

Best,
Jonas

  parent reply	other threads:[~2026-11-29 23:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 11:52 [PATCH net-next v2 0/3] net: pse-pd: realtek-pse-mcu: establish power management configuration Jonas Jelonek
2026-11-16 11:52 ` [PATCH net-next v2 1/3] dt-bindings: net: pse-pd: realtek,pse-mcu: add VMAIN supply Jonas Jelonek
2026-11-16 11:52 ` [PATCH net-next v2 2/3] net: pse-pd: realtek-pse-mcu: ensure MCU does dynamic power management Jonas Jelonek
2026-11-19  5:54   ` netdev-bot+sashiko
2026-11-23 14:32     ` Paolo Abeni
2026-11-29 23:46     ` Jonas Jelonek [this message]
2026-11-16 11:52 ` [PATCH net-next v2 3/3] net: pse-pd: realtek-pse-mcu: configure global power budget Jonas Jelonek
2026-11-19  5:54   ` netdev-bot+sashiko

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=3c52e800-fed6-4687-8b5d-96d104ace2c5@jonasjelonek.de \
    --to=jonas@jonasjelonek.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=kory.maincent@bootlin.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=russell@personaltelco.net \
    --cc=sander@svanheule.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®