public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
	 Jaehoon Chung <jh80.chung@samsung.com>,
	Lukasz Majewski <lukma@denx.de>,
	 Sean Anderson <seanga2@gmail.com>,
	Anatolij Gustschin <agust@denx.de>,
	 Fabio Estevm <festevam@gmail.com>, Peng Fan <peng.fan@nxp.com>,
	 Mario Six <mario.six@gdsys.cc>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 u-boot@lists.denx.de,  Ian Ray <ian.ray@gehealthcare.com>,
	 Michael Nazzareno Trimarchi <michael@amarulasolutions.com>,
	 Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	 Adam Ford <aford173@gmail.com>, Marek Vasut <marex@denx.de>
Subject: Re: [PATCH v3 05/13] power-domain: Add refcounting
Date: Mon, 20 Jan 2025 11:34:27 +0100	[thread overview]
Message-ID: <87a5blu630.fsf@bootlin.com> (raw)
In-Reply-To: <CAFLszTinomkmj=gaKbX5WBPMsbr_3nxt45sQjXqKJ5q1rxcKwQ@mail.gmail.com> (Simon Glass's message of "Wed, 15 Jan 2025 06:19:29 -0700")

Hello Simon,

>>  int power_domain_on(struct power_domain *power_domain)
>>  {

...

>> +       if (priv->on_count++ > 0)
>> +               return 0;
>
> -EALREADY

...

>>  int power_domain_off(struct power_domain *power_domain)
>>  {

...

>> +       if (priv->on_count-- > 1)
>> +               return 0;
>
> -EBUSY
>
> See how the regulator uclass does it.

I really does not understand why we would like to do that.

It is perfectly normal operation to call power_domain_on/off() on the
same power domain several times in a row and there is no reason to
return an error code. It is quite the opposite, the main reason for
power domains is to act like shared regulators. Se while a regulator has
one user and doing the same action on it several times does not make
much sense and can be reported, that is not how power domains have been
thought about in the first place.

Hence, I do not agree with returning error codes in these situations,
they are misleading and they would have to be ignored anyway.

Thanks,
Miquèl

  reply	other threads:[~2025-01-20 10:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10 18:42 [PATCH v3 00/13] Add imx8mp video support Miquel Raynal
2025-01-10 18:42 ` [PATCH v3 01/13] dm: doc: Fix example Miquel Raynal
2025-01-10 18:42 ` [PATCH v3 02/13] dm: core: Add a helper to retrieve devices through graph endpoints Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 03/13] sandbox: Add a fake DSI controller and link it to the panel Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 04/13] test: dm: test-fdt: Add checks for uclass_get_device_by_endpoint() Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 05/13] power-domain: Add refcounting Miquel Raynal
2025-01-15 13:19   ` Simon Glass
2025-01-20 10:34     ` Miquel Raynal [this message]
2025-01-20 19:21       ` Simon Glass
2025-01-21  8:34         ` Miquel Raynal
2025-01-23 14:38           ` Simon Glass
2025-01-24 15:20             ` Miquel Raynal
2025-01-25 17:11               ` Simon Glass
2025-01-27 17:11                 ` Miquel Raynal
2025-01-27 17:42                   ` Simon Glass
2025-01-28  8:56                     ` Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 06/13] clk: Ensure the parent clocks are enabled while reparenting Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 07/13] clk: imx8mp: Add media related clocks Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 08/13] imx: power-domain: Describe the i.MX8 MEDIAMIX domain Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 09/13] imx: power-domain: Add support for the MEDIAMIX control block Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 10/13] video: imx: Fix Makefile in order to be able to add other imx drivers Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 11/13] video: imx: Add LDB driver Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 12/13] video: imx: Add LCDIF driver Miquel Raynal
2025-01-10 18:43 ` [PATCH v3 13/13] imx8mp_evk: Enable display support Miquel Raynal
2025-01-10 18:53   ` Fabio Estevam
2025-01-11  9:51     ` Miquel Raynal
2025-01-16 16:13       ` Fabio Estevam
2025-01-16 17:09         ` Miquel Raynal
2025-01-10 19:11   ` Fabio Estevam

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=87a5blu630.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=aford173@gmail.com \
    --cc=agust@denx.de \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=festevam@gmail.com \
    --cc=ian.ray@gehealthcare.com \
    --cc=jh80.chung@samsung.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=mario.six@gdsys.cc \
    --cc=michael@amarulasolutions.com \
    --cc=peng.fan@nxp.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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