LKML Archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Kory Maincent <kory.maincent@bootlin.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Mark Brown <broonie@kernel.org>,
	Kyle Swenson <kyle.swenson@est.tech>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: PoE complex usage of regulator API
Date: Sat, 27 Apr 2024 00:41:19 +0200	[thread overview]
Message-ID: <57a79abd-722c-4907-b0e7-2396392ae675@lunn.ch> (raw)
In-Reply-To: <20240426124253.56fd0933@kmaincent-XPS-13-7390>

> Let's begin simple, in PSE world we are more talking about power.
> Would it be ok to add a regulator_get/set_power_limit() and
> regulator_get_power() callback to regulator API. Would regulator API have
> interest to such callbacks?

Could you define this API in more details.

I'm assuming this is mostly about book keeping? When a regulator is
created, we want to say is can deliver up to X Kilowatts. We then want
to allocate power to ports. So there needs to be a call asking it to
allocate part of X to a consumer, which could fail if there is not
sufficient power budget left. And there needs to be a call to release
such an allocation.

We are probably not so much interested in what the actual current
power draw is, assuming there is no wish to over provision?

There is in theory a potential second user of this. Intel have been
looking at power control for SFPs. Typically they are guaranteed a
minimum of 1.5W. However, they can operate at higher power
classes. You can have boards with multiple SFPs, with a theoretical
maximum power draw more than what the supply can supply. So you need
similar sort of power budget book keeping to allocate power to an SFP
cage before telling the SFP module it can swap to a higher power
class. I say this is theoretical, because the device Intel is working
on has this hidden away in firmware. But maybe sometime in the future
somebody will want Linux doing this.

      Andrew

  reply	other threads:[~2024-04-26 22:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 10:42 PoE complex usage of regulator API Kory Maincent
2024-04-26 22:41 ` Andrew Lunn [this message]
2024-04-29 12:52   ` Kory Maincent
2024-04-29 14:32     ` Oleksij Rempel
2024-04-29 14:57       ` Andrew Lunn
2024-04-29 15:58         ` Oleksij Rempel
2024-04-29 15:58         ` Mark Brown
2024-04-29 15:47   ` Mark Brown
2024-04-29 15:38 ` Mark Brown
2024-04-29 17:28   ` Kory Maincent
2024-04-30  2:23     ` Mark Brown
2024-04-30  6:48       ` Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57a79abd-722c-4907-b0e7-2396392ae675@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=broonie@kernel.org \
    --cc=kory.maincent@bootlin.com \
    --cc=kyle.swenson@est.tech \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).