lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241030182211.748c216e@kmaincent-XPS-13-7390>
Date: Wed, 30 Oct 2024 18:22:11 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Mark Brown <broonie@...nel.org>
Cc: Andrew Lunn <andrew@...n.ch>, Oleksij Rempel <o.rempel@...gutronix.de>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
 <pabeni@...hat.com>, Jonathan Corbet <corbet@....net>, Donald Hunter
 <donald.hunter@...il.com>, Rob Herring <robh@...nel.org>, Andrew Lunn
 <andrew+netdev@...n.ch>, Simon Horman <horms@...nel.org>, Heiner Kallweit
 <hkallweit1@...il.com>, Russell King <linux@...linux.org.uk>, Liam Girdwood
 <lgirdwood@...il.com>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
 linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
 linux-doc@...r.kernel.org, Kyle Swenson <kyle.swenson@....tech>, Dent
 Project <dentproject@...uxfoundation.org>, kernel@...gutronix.de, Maxime
 Chevallier <maxime.chevallier@...tlin.com>
Subject: Re: [PATCH RFC net-next v2 11/18] regulator: Add support for power
 budget description

On Wed, 30 Oct 2024 17:03:06 +0000
Mark Brown <broonie@...nel.org> wrote:

> On Wed, Oct 30, 2024 at 05:53:13PM +0100, Kory Maincent wrote:
> 
> > +/**
> > + * regulator_get_power_budget - get regulator total power budget
> > + * @regulator: regulator source
> > + *
> > + * Return: Power budget of the regulator in mW.
> > + */
> > +int regulator_get_power_budget(struct regulator *regulator)
> > +{
> > +	return regulator->rdev->constraints->pw_budget;
> > +}  
> 
> This is going to go badly with multiple consumers...

On my series the available power budget of the PIs (which are consumers) is
managed in the PSE core in the PSE power domain (patch 13). We could move it
directly to regulator API.

> > +static inline int regulator_get_power_budget(struct regulator *regulator)
> > +{
> > +	return 0;
> > +}  
> 
> We should probably default to INT_MAX here and in the case where we do
> have support, that way consumers will fail gracefully when no budget is
> specified.

That's true. Thanks!

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ