From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=212.227.126.130 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795996022; b=bPpAR9CzQW8SBIKlmCxcA6pvifPoR/EB0imSrqIbHGGm2f51x4qlyQMycA5PKrvBWfI3 V2f9/S/e7+4jpZfCSqDzSImAQxQugP74Kzfu/ZIA9n68+qOxTkkRnL5QqLKD6BxPFk6Rw KNt1j2Li5dTBJW1/GAL/o5ZScApdzyT4ySfZqM6r3sXPW9IYd4mxQk714a5zsTotM4qyj 1vU2NhMU0w+jPG6bHF7P11J2bhnQAB6AU2fdvPm9tuKpKNAcwHFLiTkjgfn0zFYR5P1M1 nyC+vC6mIhEv9seCXkj8sv/WBykc6y2nZqVweE/COHomiQ3qb0THB+a2/eynb63+/bA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795996022; h=DMARC-Filter:DKIM2-Signature:Message-Instance:DKIM-Signature: X-UI-Sender-Class:Received:Message-ID:Date:MIME-Version:User-Agent: Subject:Content-Language:To:Cc:References:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-Provags-ID:X-Spam-Flag: UI-OutboundReport; bh=IT98LuQQZXsCZG3VhB7/VaA/3GWJ6agvYh7X81vHP7I=; b=CEezmd+1tWOQitMFCBhiTYFBsb8PPeq/+dD8XecY593jnzu3Rjsv9ioGDec8m10xf3vI 9Cx4LpTDLWme2FtXcbB1l8sNxQWVbjNFzbq99n/kBURFC7t1rrGV1Fyw9jpMvRpb0gH+u qq9A8R5rtd+oiF5OFRMNawoLt0jL2PgZlXrTG/XMlUG95THLsxoJT4BsuIRgXklc99/LT vEd2izy9hgVOgdIiN6ziuGQM682Lj6Ums8zIampJrNERkdOUj+svLF4AeYM2USHvXFaaR zYCh9rG8rsWEwoMAf+X0HMEDzIoVy5Nbgf+RY1GCMdX6Cxt2J/u60Tn0dHmhKW7rqyQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=jonasjelonek.de; spf=pass smtp.mailfrom=jonasjelonek.de; dkim=pass header.d=jonasjelonek.de header.i=jonas@jonasjelonek.de header.a=rsa-sha256 header.s=s1-ionos header.b=lppOJOs9; arc=none smtp.remote-ip=212.227.126.130 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06124606A31C for ; Sun, 29 Nov 2026 23:47:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 06124606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=jonasjelonek.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jonasjelonek.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=jonasjelonek.de header.i=jonas@jonasjelonek.de header.a=rsa-sha256 header.s=s1-ionos header.b=lppOJOs9 DKIM2-Signature: i=1; m=1; t=1795996020; mf=PGpvbmFzQGpvbmFzamVsb25lay5kZT4=; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; d=jonasjelonek.de; s=s1-ionos:rsa-sha256:GZ8H61hdrEBuEyM7thyOYN/ZGOU5 ASWNv2UwwghOmohO8zGuTS4Bkd3+ah+hRyCfwU1rO4KUgAa4fgXDL85KMCUxfoZ7lks4BEfkug7 mCskHemUZVm2S7TgJ22RCCdN573nIWzj+aLKe9vowjU6/c2A4KvTnoTGIb5gWT+8M2/yLDjOQPK PN3eaKKJIIVfjgMyB/0uDVtXuRq4T6uGnYY+emkWhJMJxTZsyFD3y+wmN+ikFdJT7u6gn07pvLJ VeDs/YcJaggde4WVHzPmudyku/cz0x80wFTW+/A9zPcRB91kM4sKl2anqmDg7WRg6n8bkdqkQYm N7V3NJhQl8d0vQ==; Message-Instance: m=1; h=sha256: wYZT5JRjlcN5XSjLXg2BL9Xikd13NfFuiS1+l/mq6is=: NIn+bhkGnnmyIvLtLAj558h+sE9+0HiiEVWRV5NfO3w=, sha512: PB9/lh6yb1q0jJhLJl/KW45y6xfieQXu1VWojxotSUlyuavWnDSjvwZjctLbOpyuSLhaK6PSBlEq9wUyQQEJ6w==: 4FRN5D8No3Z0lKBN3L7bLo3VgEuTqIWLxYdINER/zl7eNSJOXnhydG3Km2L8bCHeeZxTQ4LOM4LpCqxyJxs5mw==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jonasjelonek.de; s=s1-ionos; t=1795995970; x=1796600770; i=jonas@jonasjelonek.de; bh=IT98LuQQZXsCZG3VhB7/VaA/3GWJ6agvYh7X81vHP7I=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=lppOJOs92+ahsV8ciMSWtfzjTOKZ+uE/LiHRpjW1XoKdyw5PQW4pXcqxC8wcMO2d ZuZde6eKOzLdeRaEvAjQX6nDK1M9HF5FRaqHH5aeLwCiqV3cCSDoobC7dZkAznRs5 7GpL55HLomfGxlLTXKs4HPWko1r7sV6tzri1pXcyybGqITkMeJwvlAKjkVh9MRyt+ 9Xzo9/HfOhTVxAi7mITeVK3K0CqeapVn1sUKk1GH/ckIl1NeoCuFQCzIk7a0GGWKJ hpqJwNrrs1kEqrXXpIRXbWEQmhzq6D/IpJiF6nzqaRA1CuqNVU6B34mfgcpV/eZgi 5egoc4cwnnyL6WLsnQ== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from client.hidden.invalid by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MMXYN-1xpDFu3c7L-00Yqg3; Mon, 30 Nov 2026 00:46:09 +0100 Message-ID: <3c52e800-fed6-4687-8b5d-96d104ace2c5@jonasjelonek.de> Date: Mon, 30 Nov 2026 00:46:07 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2 2/3] net: pse-pd: realtek-pse-mcu: ensure MCU does dynamic power management Content-Language: en-US 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 References: <20261116115224.1454885-3-jonas@jonasjelonek.de> <179506764349.3136.14504567519359431973@kernel.org> From: Jonas Jelonek In-Reply-To: <179506764349.3136.14504567519359431973@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ZK8PqdYVAuljDhyLGUAsFzjXd5+ZTAUBU7ANbN5Okxh3ibRc1SQ 5xDOtSx0faCpkPhwGOJGqHIpiQ70wYS980ven+xErClE+SwIP3UbXz8iEpO/6gyXpsqW0bb I8Q5NL6+2wYXnXyM7ctTwFbPfjbhSVrSjDo0W2x3T8mpzQu/LUlhpP2kJVH3YUOcNP2pBI/ 7/XcdAuppKdiUjCP/NUYw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:5H8GpzgPfzo=;GtbniLw3m7RYmrw1aeLstVebVOp vtzlFGlW9mpmE3cZhRnUDz5UDKa7PsSqdKj6ygW+PSWW1UT4x3Ddp6w3POD71NtrhczXzbdom kp2QO5TjByE9k02+ZMLPrGZdY29NC2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kdooCrU 2uUzMbB/FhruK7lNzjXTXRhc/LqZ4dI2DoKV08/vZlupehA/o5p5POlnc6NKVxws9plzBTgAI 9dqd7MUiNETH8maAXtWYeeGPQXypmABA8QIQ1XesYwcERwPWdrZU+TDs2uke09Y2yfWuF0Bwa rfEGpeVxjw/UsvIejIv/zyk8Z7ofqwFG2r6sOW5NMI1Ok64WJknslixLxza8Di3TJ1DScdf0k iqRgJE0UylVNwMArLw2sCK/X5aPDIihVopR+sNvkx0RkbA26tZwImYIXwcQw3btWhFRtiI6fq oKaIYVviPrwXSb99/8QmmWQRWVX9qSscv5FBGkOEvwi7TE6wfPi93XEiNvFoI4fkc2wGmAzd9 A90hseIn9rkXteKaniIVZvOyXc6ZLD4e+n26CRHBjpbG+sl5q01n+E/xyoCXQFEcook/eBCml vVAzr1OjuptncwCpQlySNCrUwE5UvMrqkvS0vWHn3IL2W9WqN1J0pl+tvx9NbBvYs6TERcX+J 0J9sNEyhnldW4RwP5Rl/xwrFJt6g0uy3an9Ybzay3I4eyOM22fbfGs35jMqcl+1NyTWM66NNA kQ1L9j 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 =C2=B7 High: 0 =C2=B7 Medium: 1 =C2=B7 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 patchwo= rk > know by including "pw-bot: cr" as a separate line at the end of your rep= ly > (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=E2=80=A6 > - [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= =E2=80=A6 > - [Low] In this commit, the comment above the 'disable-ports' GPIO > request in rtpse_mcu_register() (drivers/net/pse-pd/realtek-pse-mcu-= =E2=80=A6 > > -- > > 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 actuall= y 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/ps= e-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; >> =20 >> + /* ensure the MCU does dynamic power management with priorities */ >> + ret =3D 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] =3D=3D 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 on= ly >> * after the MCU is confirmed, so a discover failure never ungates th= e > [Severity: Low] > This isn't a bug, but this comment still names only discovery as the ste= p > 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