All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neha Malcom Francis <n-francis@ti.com>
To: Frieder Schrempf <frieder.schrempf@kontron.de>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Jaehoon Chung <jh80.chung@samsung.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	<u-boot@lists.denx.de>,
	Samuel Holland <samuel.holland@sifive.com>,
	Wadim Egorov <w.egorov@phytec.de>, Heiko Schocher <hs@denx.de>,
	Fabio Estevam <festevam@denx.de>
Subject: Re: [PATCH 2/2] imx: power-domain: Enable refcounting on imx8mp
Date: Tue, 22 Jul 2025 10:13:13 +0530	[thread overview]
Message-ID: <d15f3fef-247c-4f07-be57-dc36a5c09202@ti.com> (raw)
In-Reply-To: <0a2c9ba5-a0fa-4cd7-9e29-0874cf085f2c@kontron.de>

Hi Frieder

On 21/07/25 21:31, Frieder Schrempf wrote:
> Hi Miquel,
> 
> Am 25.04.25 um 08:49 schrieb Miquel Raynal:
>> Prevent enabling/disabling multiple times the same power domain to avoid
>> breakages due to the same power domains being referenced several times
>> by different device nodes.
>>
>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> 
> I've stumbled upon some issue that seems to be related to this patch. I
> saw you already had to bother with other breakages of existing
> boards/platforms in the previous implementation. Unfortunately it looks
> like this still causes some kind of regression in my case.
> 
> I'm working with an i.MX8MM board (kontron-sl-mx8mm_defconfig) and I see
> a crash as soon as I do "usb start" and then "usb stop" (log for the
> latter see below).
> 
> As soon as I revert this patch everything starts to work fine again. Do
> you have any suggestions? The power-domains involved here are pgc_otg1
> and pgc_hsiomix defined in imx8mm.dtsi.
> 
> Thanks
> Frieder
> 
> 
> => usb stop
> stopping USB..
> Sending event 6/(unknown) to spy 'efi_disk del'
> Sending event 6/(unknown) to spy 'efi_disk del'
> Looking for power-domain@0
> Looking for power-domain@0
>       - checking gpc@303a0000
>       - checking power-domain@0
>    - result for power-domain@0: power-domain@0 (ret=0)
>    - result for power-domain@0: power-domain@0 (ret=0)
> "Synchronous Abort" handler, esr 0x96000005, far 0x4ebacdc50
> elr: 0000000040249c94 lr : 0000000040249c6c (reloc)
> elr: 00000000fff4ec94 lr : 00000000fff4ec6c
> x0 : 0000000000000001 x1 : 00000000fbf22750
> x2 : 00000003efbab500 x3 : 00000000fffcdfb0
> x4 : 0000000000000020 x5 : 0000000000000020
> x6 : 00000000fbeea10f x7 : 00000000fbeea3d7
> x8 : 00000000fffffffe x9 : 00000000fbeea1ec
> x10: 00000000fbeea280 x11: 00000000ffffffd8
> x12: 00000000fbeeb1b0 x13: 00000000fbeeb1b0
> x14: 0000000000000002 x15: 0000000000000000
> x16: 00000000fff4edc4 x17: 0000000000000000
> x18: 00000000fbef4db0 x19: 00000004ebacdc50
> x20: 00000000fbeeace8 x21: 00000000fbf21ad0
> x22: 0000000000000000 x23: 0000000000000001
> x24: 0000000000000000 x25: 00000000fbf28f10
> x26: 0000000000000000 x27: 00000000fbf2ad40
> x28: 00000000fbf2ada0 x29: 00000000fbeeac70
> 
> Code: f9400693 d37ef662 ab130833 54000140 (b8626820)
> Resetting CPU ...
> 
> 
>> ---
>>  drivers/power/domain/imx8m-power-domain.c | 4 ++++
>>  drivers/power/domain/imx8mp-hsiomix.c     | 4 ++++
>>  drivers/power/domain/imx8mp-mediamix.c    | 4 ++++
>>  3 files changed, 12 insertions(+)
>>
>> diff --git a/drivers/power/domain/imx8m-power-domain.c b/drivers/power/domain/imx8m-power-domain.c
>> index e54ba5d9a5476f678fb48fb16e7217b031acd78a..b44aae78e6de9733e1e53bbec80f54562487a76b 100644
>> --- a/drivers/power/domain/imx8m-power-domain.c
>> +++ b/drivers/power/domain/imx8m-power-domain.c
>> @@ -506,8 +506,12 @@ static int imx8m_power_domain_bind(struct udevice *dev)
>>  static int imx8m_power_domain_probe(struct udevice *dev)
>>  {
>>  	struct imx8m_power_domain_plat *pdata = dev_get_plat(dev);
>> +	struct power_domain_plat *plat = dev_get_uclass_plat(dev);
>>  	int ret;
>>  
>> +	/* Every subdomain has its own device node */
>> +	plat->subdomains = 1;
>> +
>>  	/* Nothing to do for non-"power-domain" driver instances. */
>>  	if (!strstr(dev->name, "power-domain"))
>>  		return 0;
>> diff --git a/drivers/power/domain/imx8mp-hsiomix.c b/drivers/power/domain/imx8mp-hsiomix.c
>> index 455ad53ef525e18ae45068fa5d8c2be8a1b79335..1ca43880ef56a03ae10e70f7e260022acc447dbb 100644
>> --- a/drivers/power/domain/imx8mp-hsiomix.c
>> +++ b/drivers/power/domain/imx8mp-hsiomix.c
>> @@ -201,8 +201,12 @@ int imx8mp_hsiomix_bind(struct udevice *dev)
>>  static int imx8mp_hsiomix_probe(struct udevice *dev)
>>  {
>>  	struct imx8mp_hsiomix_priv *priv = dev_get_priv(dev);
>> +	struct power_domain_plat *plat = dev_get_uclass_plat(dev);
>>  	int ret;
>>  
>> +	/* Definitions are in imx8mp-power.h */
>> +	plat->subdomains = 5;


Enabling LOG_DEBUG on drivers/power/domain/power-domain-uclass.c may
help further

Looks like setting of plat->subdomains needs updation? PD of HSIOMIX is
17 (plat->subdomains is 5?)

Looking at the numerous imx* devicetrees; plat->subdomains looks to be
very different across each platform so hardcoding it in the probe of the
power driver may not be a good idea I think?

>> +
>>  	priv->base = dev_read_addr_ptr(dev);
>>  
>>  	ret = clk_get_by_name(dev, "usb", &priv->clk_usb);
>> diff --git a/drivers/power/domain/imx8mp-mediamix.c b/drivers/power/domain/imx8mp-mediamix.c
>> index 78c32ca3d3a87febdefd5d128d39d817674b8d32..504c22f7d3631363d76eb21e43afd854258d4ea5 100644
>> --- a/drivers/power/domain/imx8mp-mediamix.c
>> +++ b/drivers/power/domain/imx8mp-mediamix.c
>> @@ -143,9 +143,13 @@ static int imx8mp_mediamix_bind(struct udevice *dev)
>>  
>>  static int imx8mp_mediamix_probe(struct udevice *dev)
>>  {
>> +	struct power_domain_plat *plat = dev_get_uclass_plat(dev);
>>  	struct imx8mp_mediamix_priv *priv = dev_get_priv(dev);
>>  	int ret;
>>  
>> +	/* Definitions are in imx8mp-power.h */
>> +	plat->subdomains = 9;
>> +
>>  	priv->base = dev_read_addr_ptr(dev);
>>  
>>  	ret = clk_get_by_name(dev, "apb", &priv->clk_apb);
>>
> 

-- 
Thanking You
Neha Malcom Francis

  reply	other threads:[~2025-07-22  4:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25  6:49 [PATCH 0/2] power-domain: Enable uclass refcounting Miquel Raynal
2025-04-25  6:49 ` [PATCH 1/2] power-domain: Add support for refcounting (again) Miquel Raynal
2025-04-25  8:57   ` Wadim Egorov
2025-04-25  9:49   ` Neha Malcom Francis
2025-04-25 11:12   ` Heiko Schocher
2025-04-25  6:49 ` [PATCH 2/2] imx: power-domain: Enable refcounting on imx8mp Miquel Raynal
2025-04-25 11:13   ` Heiko Schocher
2025-07-21 16:01   ` Frieder Schrempf
2025-07-22  4:43     ` Neha Malcom Francis [this message]
2025-07-22  7:26     ` Frieder Schrempf
2025-07-22  8:32       ` Frieder Schrempf
2025-04-25  8:56 ` [PATCH 0/2] power-domain: Enable uclass refcounting Wadim Egorov
2025-04-28 16: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=d15f3fef-247c-4f07-be57-dc36a5c09202@ti.com \
    --to=n-francis@ti.com \
    --cc=festevam@denx.de \
    --cc=frieder.schrempf@kontron.de \
    --cc=hs@denx.de \
    --cc=jh80.chung@samsung.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=samuel.holland@sifive.com \
    --cc=sjg@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=w.egorov@phytec.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.