🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24841

Re: [PATCH net] net: pse-pd: realtek-pse-mcu: ensure MCU does dynamic power management

#24841
From: netdev-bot+sashiko
Date: Mon, 30 Nov 2026 23:47
91 lines
11151 bytes
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
Technical Details
Message-ID: <179608244650.3146.5191319119181327382@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374527-linux-kernel-netdev=dewy.ru
References: <20261129234635.3357243-1-jonas@jonasjelonek.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374527-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <179608244650.3146.5191319119181327382@kernel.org>
References: <20261129234635.3357243-1-jonas@jonasjelonek.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1568277"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:vHHxWtiFx62tujruba8yfZEPp+M= sha256:DADxuwNpZR/NMntql/Lg0vTxbVZfxAhG9Ijng63NNaQ=
	sha1:sePBtWf0yyIqD/YmgjeWyekG2iU= sha256:cGOfymzn1MxANUvbXAnRqK0xPrs9m/4mAryuaLL/z/s=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 1F897126019; Tue,  1 Dec 2026 02:47:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id zbw_fqDJ1FWS;
	Tue,  1 Dec 2026 02:47:40 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-374527-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 01E79126015; Tue,  1 Dec 2026 02:47:30 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 15C7F601A62; Mon, 30 Nov 2026 23:47:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796082449;
	b=wcKPK6vkdPWGs7H7Ywn6PhoVhJZm8poboG+IqPqCo5FEVt1TrErXbnF8IkhCGkHCY8Ji
	 tS2FA9+e5D8+qX3RUJnacvaiumN+Nrl8er5t5a2hexde99MTEepljUJJjduk4Re7gRVsY
	 AxqOOA223cgMg2z25g5qLOPDl41IUwlN2oxRAnaJMDqdb63PqMchFe/Dx4d+iH9qf4d74
	 EoOZ/1dELPaaezn0D9+ugk9uZNgIAKB+slLgKtt2pGRFnwIHuQPsamXHjNsaN3S9v9yAt
	 y6HU+ZOgJJ0X3gV6hetXsEkSfdoxWLP+eO1D71EbdSwpyPRGub0bHIQInou9R6RioCQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796082449;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=MGdJ0Rvx4wdY67pv8D1fdVaU5YBErkizg7yoiyI0AFI=;
	b=c6FuWdPpUAr/yh4Q1FEJVTm8oo4X0ntms7j8SHzwIiQBLwmiyud+jVwPjBihnmhuk6d3
	 x7JlmHOpKjY+bhodaXx8Jqe1G/myW16cTB6hvEn5HliBIwT9YuWwk/Lb/QO+ZrXLYQmLt
	 qqCVYJzN/UvwEb7M71NElEqEwZl+L4cOupDS5Qh2/qUfYMi8GOCk3HujWTyVAWGdbHj/g
	 ba2VdYWMgxMjVWR/xZ50K1gGnsAm4yBLqMU6J8QOup+CwIRXOWP00BIKKJs3Dv1SQA8sN
	 B1J1GUKmlW2jGQ2wNKnuFCZIZRDzFeK290YUrSL9iQAXIYMU6NtX5Emd7kt8Wr3Uzrw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q16EjExJ;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id E4BCE606A331;
	Mon, 30 Nov 2026 23:47:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q16EjExJ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796082448;
	b=b2IoSXpmeXSfECIdI7MC5BqEn1ljV3D5vKoRBzo4AzCh23nBHd7E6uyCYCiFoYIMcdli
	 sK+H81c4O8iCCtmZUhxGb3Dqbk3rhyCbI+/Wl2Aqdhok0Bf/dFyWBIGf6/ZkceBsjDwDS
	 O5eHcGoSISUBlStblhjTsPG+TukY00YtWk7GR4I/7g6Q2e4jY+Yde7+zGK+Je+SwOi37v
	 c/j4wBl6//CQGqHQuIQo7iKR4vlxWq67oTQ6bh+lBW4TVPd+05u1wNO9iOT4yuPePlUKB
	 kYGO809+NRsGtbWKSCCA2+qGf3LQNjY5b/hfdkqUeIHP+lqCjtcSqrGDbIA3b6x7Lqw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796082448;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=MGdJ0Rvx4wdY67pv8D1fdVaU5YBErkizg7yoiyI0AFI=;
	b=SmlNs0QFPdBBkwyg00UCVOZZQeM2BVIbLIJbebn+Fxq67aYLG9vKlvfUS0gK93xzid4n
	 LTP2E8NncswDN9fKIGHcGA+YCL0BFFqz9NjKBuWoi2DWec45S8UmxBBeeA7pkoGi0aMNv
	 z/iXsuvK5kEYQjYtN24eDgXX0Sjf0dgtXKaS2cDSnBfPxQBRPTRVB4jRF2z/eNzyNvtL7
	 L6IoVgPZK1oH1TW3ZXLzEEgZOQj5gUw4v1LCD1E1YnNYm1PVdYORciq3GkkvdbTcxq7YN
	 vzByTQ773zybCc92SU2/TW7PmHFvZX76Vc64vx9x7YBW0MBGt5Nh2CCwtjy8vRWUvjw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q16EjExJ;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EF72606A31A;
	Mon, 30 Nov 2026 23:47:27 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id F35C81F000C1;
	Mon, 30 Nov 2026 23:47:26 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796082447;
	bh=MGdJ0Rvx4wdY67pv8D1fdVaU5YBErkizg7yoiyI0AFI=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Q16EjExJ5eBqAIRz2OQQu8ZNp6hSSHNJjYEWncEblDUQdYKUunQ1/vHqGEL2CDHHI
	 OMK8iqIOgbv3/nmHr09+Ha5fwjuc7aSdb7oj6WlQnaSG4OsEpJkhNHCyF7fvdb3zVn
	 UiYMcz6iuzZozAQv32VJKtjJ094dNKYc8EMPt5xZNnuGSQkQQLSTMMR2Qd6JUgZvAY
	 PZQmPyUN+13cP0ZnmLI8YPZuuSFmkQmSPIgmquCmSQnvaPZb7gq0xRvML+vR8RK/4E
	 rg26Osqc4JrQCy0wjKNCgV2T0WEz3zjLbDxVSRYCrXq7LDBuVo3sRZtaOtNmYFMmlo
	 WITw1i6hRfCrg==
X-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
X-In-Reply-To: <20261129234635.3357243-1-jonas@jonasjelonek.de>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list