netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: pse-pd: pd692x0: Skip power budget configuration when undefined
@ 2025-08-20 13:33 Kory Maincent
  2025-08-21  4:22 ` Oleksij Rempel
  2025-08-21 15:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Kory Maincent @ 2025-08-20 13:33 UTC (permalink / raw)
  To: Oleksij Rempel, Kory Maincent (Dent Project), Jakub Kicinski,
	netdev, linux-kernel
  Cc: thomas.petazzoni, Andrew Lunn, David S. Miller, Eric Dumazet,
	Paolo Abeni

If the power supply's power budget is not defined in the device tree,
the current code still requests power and configures the PSE manager
with a 0W power limit, which is undesirable behavior.

Skip power budget configuration entirely when the budget is zero,
avoiding unnecessary power requests and preventing invalid 0W limits
from being set on the PSE manager.

Fixes: 359754013e6a ("net: pse-pd: pd692x0: Add support for PSE PI priority feature")
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 drivers/net/pse-pd/pd692x0.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c
index 395f6c662175..f4e91ba64a66 100644
--- a/drivers/net/pse-pd/pd692x0.c
+++ b/drivers/net/pse-pd/pd692x0.c
@@ -1041,6 +1041,10 @@ pd692x0_configure_managers(struct pd692x0_priv *priv, int nmanagers)
 		int pw_budget;
 
 		pw_budget = regulator_get_unclaimed_power_budget(supply);
+		if (!pw_budget)
+			/* Do nothing if no power budget */
+			continue;
+
 		/* Max power budget per manager */
 		if (pw_budget > 6000000)
 			pw_budget = 6000000;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: pse-pd: pd692x0: Skip power budget configuration when undefined
  2025-08-20 13:33 [PATCH net] net: pse-pd: pd692x0: Skip power budget configuration when undefined Kory Maincent
@ 2025-08-21  4:22 ` Oleksij Rempel
  2025-08-21 15:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Oleksij Rempel @ 2025-08-21  4:22 UTC (permalink / raw)
  To: Kory Maincent
  Cc: Jakub Kicinski, netdev, linux-kernel, thomas.petazzoni,
	Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni

On Wed, Aug 20, 2025 at 03:33:21PM +0200, Kory Maincent wrote:
> If the power supply's power budget is not defined in the device tree,
> the current code still requests power and configures the PSE manager
> with a 0W power limit, which is undesirable behavior.
> 
> Skip power budget configuration entirely when the budget is zero,
> avoiding unnecessary power requests and preventing invalid 0W limits
> from being set on the PSE manager.
> 
> Fixes: 359754013e6a ("net: pse-pd: pd692x0: Add support for PSE PI priority feature")
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>

Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>

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 |

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: pse-pd: pd692x0: Skip power budget configuration when undefined
  2025-08-20 13:33 [PATCH net] net: pse-pd: pd692x0: Skip power budget configuration when undefined Kory Maincent
  2025-08-21  4:22 ` Oleksij Rempel
@ 2025-08-21 15:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-21 15:00 UTC (permalink / raw)
  To: Kory Maincent
  Cc: o.rempel, kuba, netdev, linux-kernel, thomas.petazzoni,
	andrew+netdev, davem, edumazet, pabeni

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 20 Aug 2025 15:33:21 +0200 you wrote:
> If the power supply's power budget is not defined in the device tree,
> the current code still requests power and configures the PSE manager
> with a 0W power limit, which is undesirable behavior.
> 
> Skip power budget configuration entirely when the budget is zero,
> avoiding unnecessary power requests and preventing invalid 0W limits
> from being set on the PSE manager.
> 
> [...]

Here is the summary with links:
  - [net] net: pse-pd: pd692x0: Skip power budget configuration when undefined
    https://git.kernel.org/netdev/net/c/7ef353879f71

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-21 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 13:33 [PATCH net] net: pse-pd: pd692x0: Skip power budget configuration when undefined Kory Maincent
2025-08-21  4:22 ` Oleksij Rempel
2025-08-21 15:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).