From: Wadim Egorov <w.egorov@phytec.de>
To: Neha Malcom Francis <n-francis@ti.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Tom Rini <trini@konsulko.com>
Cc: Samuel Holland <samuel.holland@sifive.com>,
Svyatoslav Ryhel <clamor95@gmail.com>,
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>,
Simon Glass <sjg@chromium.org>,
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>
Subject: Re: [PATCH v6 05/12] power-domain: Add refcounting
Date: Wed, 16 Apr 2025 16:20:06 +0300 [thread overview]
Message-ID: <94f3bd98-5854-4f09-9927-54d83cd9adeb@phytec.de> (raw)
In-Reply-To: <7f87c129-b949-493a-9df7-26e9caf9d58e@ti.com>
Am 16.04.25 um 12:50 schrieb Neha Malcom Francis:
> Hi Miquel
>
> On 16/04/25 14:36, Miquel Raynal wrote:
>> Hello,
>>
>>>>> -int power_domain_on(struct power_domain *power_domain)
>>>>> +int power_domain_on_lowlevel(struct power_domain *power_domain)
>>>>> {
>>>>> + struct power_domain_priv *priv = dev_get_uclass_priv(power_domain->dev);
>>>>> struct power_domain_ops *ops = power_domain_dev_ops(power_domain->dev);
>>>>> + int ret;
>>>>>
>>>>> debug("%s(power_domain=%p)\n", __func__, power_domain);
>>>>>
>>>>> - return ops->on ? ops->on(power_domain) : 0;
>>>>> + if (priv->on_count++ > 0)
>>>>> + return -EALREADY;
>>>>
>>>> This change is broken for power domain providers with #power-domain-cells = <1>,
>>>> which can have multiple domains per provider device. There would need to be a
>>>> separate reference count per domain, and currently the uclass doesn't know the
>>>> range of valid domain IDs.
>>>
>>> I didn't see this reply earlier, would've saved some time debugging to
>>> come to the same conclusion :) but yes this is the reason for
>>> breaking.
>>
>> That's indeed the reason, thanks a lot for figuring this out. I am
>> looking for a solution. I can reproduce on imx8mp by enabling the two
>> LCD interfaces, as they have a similar pattern as on k3 platform: a
>> single power domain node and one cell for figuring out which PD to
>> enable.
>>
>> The uclass does not save any data, so I don't have an immediate fix to
>> propose. Let me dig a bit more into that and find a solution.
>>
>
> Thanks!
>
> Meanwhile, could we revert this patch to keep the platforms from breaking?
Would be nice, just took me the same route to pin this commit and find
out about this discussion. I think more people will run into the same
issue soon
>
>
>> Thanks,
>> Miquèl
>
next prev parent reply other threads:[~2025-04-16 13:20 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 7:39 [PATCH v6 00/12] Add imx8mp video support Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 01/12] core: ofnode_graph: Fix a comment Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 02/12] dm: doc: Fix example Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 03/12] dm: core: Add a helper to retrieve devices through graph endpoints Miquel Raynal
2025-04-03 8:08 ` Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 04/12] test: dm: test-fdt: Add checks for uclass_get_device_by_endpoint() Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 05/12] power-domain: Add refcounting Miquel Raynal
2025-04-14 17:36 ` Francis, Neha
2025-04-14 18:07 ` Nishanth Menon
2025-04-14 20:06 ` Tom Rini
2025-04-14 21:00 ` Francesco Dolcini
2025-04-15 5:20 ` Neha Malcom Francis
2025-04-15 6:51 ` Francesco Dolcini
2025-04-15 8:15 ` Miquel Raynal
2025-04-15 8:59 ` Neha Malcom Francis
2025-04-15 9:50 ` Miquel Raynal
2025-04-15 9:59 ` Neha Malcom Francis
2025-04-15 10:47 ` Francesco Dolcini
2025-04-15 12:43 ` Miquel Raynal
2025-04-16 7:46 ` Neha Malcom Francis
2025-04-16 1:14 ` Samuel Holland
2025-04-16 8:36 ` Neha Malcom Francis
2025-04-16 9:06 ` Miquel Raynal
2025-04-16 9:50 ` Neha Malcom Francis
2025-04-16 13:20 ` Wadim Egorov [this message]
2025-04-16 15:49 ` Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 06/12] clk: Ensure the parent clocks are enabled while reparenting Miquel Raynal
2025-04-03 13:03 ` Adam Ford
2025-04-03 7:39 ` [PATCH v6 07/12] clk: imx8mp: Add media related clocks Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 08/12] imx: power-domain: Describe the i.MX8 MEDIAMIX domain Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 09/12] imx: power-domain: Add support for the MEDIAMIX control block Miquel Raynal
2025-04-03 12:57 ` Adam Ford
2025-04-04 6:30 ` Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 10/12] video: imx: Fix Makefile in order to be able to add other imx drivers Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 11/12] video: imx: Add LDB driver Miquel Raynal
2025-04-03 7:39 ` [PATCH v6 12/12] video: imx: Add LCDIF driver Miquel Raynal
2025-04-03 13:01 ` Adam Ford
2025-04-04 6:22 ` Miquel Raynal
2025-04-11 14:15 ` [PATCH v6 00/12] Add imx8mp video support 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=94f3bd98-5854-4f09-9927-54d83cd9adeb@phytec.de \
--to=w.egorov@phytec.de \
--cc=aford173@gmail.com \
--cc=agust@denx.de \
--cc=clamor95@gmail.com \
--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=miquel.raynal@bootlin.com \
--cc=n-francis@ti.com \
--cc=peng.fan@nxp.com \
--cc=samuel.holland@sifive.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