Re: [PATCH net v2 06/14] net: pse-pd: check the PI state under the lock when setting a power limit
From: Oleksij Rempel
Date: Thu Oct 22 2026 - 00:48:01 EST
On Tue, Oct 20, 2026 at 07:12:41PM +0200, Carlo Szelinsky wrote:
> pse_ethtool_set_pw_limit() checks whether the PI is powered without
> pcdev->lock. pse_isr() changes that state under the lock, so if the PD
> disconnects in between, budget is reserved for a port that is no longer
> powered.
>
> Do the check in pse_pi_update_pw_budget() under the lock, and report
> whether the budget was changed, so the rollback after a failed
> regulator_set_current_limit() runs only then. This also rolls back a
> budget that started from zero, which the old code skipped.
>
> Found by code inspection. Not reproduced.
>
> Fixes: ffef61d6d273 ("net: pse-pd: Add support for budget evaluation strategies")
> Reviewed-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>
> Signed-off-by: Carlo Szelinsky <github@xxxxxxxxxxxx>
Acked-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Thank you!
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |