mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
To: Biju Das <biju.das.jz@bp.renesas.com>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v2 0/2] reset: rzg2l-usbphy-ctrl: Add suspend to RAM support
Date: Tue, 16 Dec 2025 11:03:54 +0200	[thread overview]
Message-ID: <3d8896c7-9ba8-43f2-8464-a94acdf82ba3@tuxon.dev> (raw)
In-Reply-To: <TY3PR01MB11346D053263D4E4C367F1EA186A5A@TY3PR01MB11346.jpnprd01.prod.outlook.com>

Hi, Biju,

On 12/7/25 13:02, Biju Das wrote:
> Hi Claudiu,
> 
>> -----Original Message-----
>> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
>> Sent: 05 December 2025 10:00
>> Subject: Re: [PATCH v2 0/2] reset: rzg2l-usbphy-ctrl: Add suspend to RAM support
>>
>> Hi, Biju,
>>
>> On 12/5/25 10:53, Biju Das wrote:
>>>
>>>
>>> Hi Claudiu,
>>>
>>>> -----Original Message-----
>>>> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
>>>> Sent: 04 December 2025 18:26
>>>> Subject: Re: [PATCH v2 0/2] reset: rzg2l-usbphy-ctrl: Add suspend to
>>>> RAM support
>>>>
>>>> Hi, Philipp,
>>>>
>>>> Could you please let me know if there's anything I should do for this series?
>>>
>>> If rzg2l_usbphy_ctrl_suspend() fails, What is the probability that it
>>> will suspend again without any issue
>>
>> How can I measure this?
>>
>> The idea with this code was the following: if any instruction of suspend fails, the suspend is
>> aborted, thus code in rzg2l_usbphy_ctrl_suspend() is trying to restore the runtime state of the HW so
>> that no runtime users of it to be affected. This is also how core suspend code is doing, e.g.
>> suspend_devices_and_enter().
> 
> After rechecking, the cleanup() in the suspend code making usage count unbalanced.
> 
> Eg:
>  Suspend returns error with the following usage count incremented 
> 
> static int rzg2l_usbphy_ctrl_suspend(struct device *dev)
> {
> reset_deassert:
> +	reset_control_deassert(priv->rstc);
> +rpm_resume:
> +	pm_runtime_resume_and_get(dev);
> +	return ret;
> }
> 
> 
> The suspend error code invokes device resume[1] and in that you are again calling
> reset_control_deassert() and pm_runtime_resume_and_get() which makes the usage
> count unbalanced forever.
> 
> So, looks like the current logic in the Add suspend to RAM support patch is wrong.

Seeing [1], [2], [3] being posted by you, and [2] following the same
pattern as proposed in this patch, are you still considering the approach
in this patch being wrong ?

Thank you,
Claudiu

[1]
https://lore.kernel.org/all/20251207124742.96526-1-biju.das.jz@bp.renesas.com
[2]
https://lore.kernel.org/all/20251208152133.269316-8-biju.das.jz@bp.renesas.com
[3]
https://lore.kernel.org/all/20251208101356.101379-1-biju.das.jz@bp.renesas.com

  reply	other threads:[~2025-12-16  9:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 13:27 Claudiu
2025-11-10 13:27 ` [PATCH v2 1/2] reset: rzg2l-usbphy-ctrl: Propagate the return value of regmap_field_update_bits() Claudiu
2025-11-10 13:27 ` [PATCH v2 2/2] reset: rzg2l-usbphy-ctrl: Add suspend/resume support Claudiu
2025-12-04 18:25 ` [PATCH v2 0/2] reset: rzg2l-usbphy-ctrl: Add suspend to RAM support Claudiu Beznea
2025-12-05  8:53   ` Biju Das
2025-12-05  9:59     ` Claudiu Beznea
2025-12-05 10:17       ` Biju Das
2025-12-05 10:46         ` Claudiu Beznea
2025-12-05 10:57           ` Biju Das
2025-12-05 11:55             ` Biju Das
2025-12-05 13:29               ` Claudiu Beznea
2025-12-05 13:45                 ` Biju Das
2025-12-05 14:01                   ` Claudiu Beznea
2025-12-05 14:15                     ` Biju Das
2025-12-06  9:44                     ` Biju Das
2025-12-07 11:02       ` Biju Das
2025-12-16  9:03         ` Claudiu Beznea [this message]
2025-12-16  9:16           ` Biju Das

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=3d8896c7-9ba8-43f2-8464-a94acdf82ba3@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=p.zabel@pengutronix.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

all inboxes | Powered by JetHome®