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: Fri Oct 30 2026 - 09:26:34 EST


On Fri, Oct 30, 2026 at 12:30:16PM +0100, Kory Maincent wrote:
>
>
> On 10/23/26 23:54, Carlo Szelinsky wrote:
> > On Fri, 23 Oct 2026 08:13:34 +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> > > [Severity: High]
> > > Do admin_state_enabled and isr_pd_detected really mean the PI is powered?
> >
> > Kory, a question about pending PIs. A PI can be admin enabled with a
> > PD detected but without power: when there was not enough budget when
> > it was enabled or when the PD was detected, or when a PI with higher
> > priority took its budget. Such a PI passes the check in
> > pse_pi_update_pw_budget(), so setting a power limit reserves budget
> > for it if the limit fits. When the PI is powered later,
> > pse_pi_allocate_pw_budget_static_prio() sets pw_allocated_mW again,
> > and the budget reserved before is never freed.
> >
> > This was the same before my patch. Should set_pw_limit skip a pending
> > PI, for example with pse_pi_is_admin_enable_pending()? If yes, I would
> > send that as a separate patch.
>
> Sorry for the late reply.
> No, I don't think we should skip setting power limit for a pending PI.
> Lowering the power limit of a PI could allow this pending PI to be powered
> again with a smaller power budget.

Ack, makes sense.

Best Regards,
Oleksij
--
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 |