All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikko Perttunen <mperttunen@nvidia.com>
To: "Thierry Reding" <thierry.reding@kernel.org>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Uwe Kleine-König" <ukleinek@kernel.org>
Cc: linux-pwm@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH v1 3/6] pwm: tegra: Use devm function for pm_runtime_enable()
Date: Wed, 15 Jul 2026 13:31:47 +0900	[thread overview]
Message-ID: <MAZ-TeVzRkyeyWYe-mCm7g@nvidia.com> (raw)
In-Reply-To: <a7b7386ee7705b25cc1cd345c188e14978ab2e9d.1784030076.git.ukleinek@kernel.org>

On Tuesday, July 14, 2026 9:02 PM Uwe Kleine-König wrote:
> This simplifies the error paths as pwm_runtime_disable() is called
> automatatically by the driver core.

Typo, s/ta//

> 
> Note that pwm_runtime_disable() is the right function to undo
> pm_runtime_enable(); pm_runtime_force_suspend() "should only be used
> during system-wide PM transitions to sleep states".
> 
> Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
> ---
>  drivers/pwm/pwm-tegra.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
> index dba9a05675e3..e99e1c5b18c3 100644
> --- a/drivers/pwm/pwm-tegra.c
> +++ b/drivers/pwm/pwm-tegra.c
> @@ -361,7 +361,10 @@ static int tegra_pwm_probe(struct platform_device *pdev)
>  		 */
>  		return ret;
>  
> -	pm_runtime_enable(dev);
> +	ret = devm_pm_runtime_enable(dev);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "Failed to enable runtime PM\n");
> +
>  	ret = pm_runtime_resume_and_get(dev);
>  	if (ret)
>  		return dev_err_probe(dev, ret, "Failed to runtime resume device\n");
> @@ -410,7 +413,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
>  	return 0;
>  put_pm:
>  	pm_runtime_put_sync_suspend(dev);
> -	pm_runtime_force_suspend(dev);
>  	return ret;
>  }
>  
> @@ -422,8 +424,6 @@ static void tegra_pwm_remove(struct platform_device *pdev)
>  	pwmchip_remove(chip);
>  
>  	reset_control_assert(pc->rst);
> -
> -	pm_runtime_force_suspend(&pdev->dev);

I'm guessing the pm_runtime_force_suspend was there to runtime_suspend
the device if it was on. I agree that pm_runtime_force_suspend is not
the right way to do that, but some replacement would be needed.

Thank you
Mikko

>  }
>  
>  static int __maybe_unused tegra_pwm_runtime_suspend(struct device *dev)
> -- 
> 2.55.0.11.g153666a7d9bb
> 
> 





  reply	other threads:[~2026-07-15  4:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 12:02 [PATCH v1 0/6] pwm: tegra: Cleanups and .get_state() Uwe Kleine-König
2026-07-14 12:02 ` [PATCH v1 1/6] pwm: tegra: Check for match_data being NULL Uwe Kleine-König
2026-07-15  4:11   ` Mikko Perttunen
2026-07-14 12:02 ` [PATCH v1 2/6] pwm: tegra: Make use of dev_err_probe() Uwe Kleine-König
2026-07-15  4:17   ` Mikko Perttunen
2026-07-14 12:02 ` [PATCH v1 3/6] pwm: tegra: Use devm function for pm_runtime_enable() Uwe Kleine-König
2026-07-15  4:31   ` Mikko Perttunen [this message]
2026-07-14 12:02 ` [PATCH v1 4/6] pwm: tegra: Simplify using devm_reset_control_get_exclusive_deasserted() Uwe Kleine-König
2026-07-14 12:12   ` Philipp Zabel
2026-07-14 14:07     ` Uwe Kleine-König
2026-07-15  4:50       ` Mikko Perttunen
2026-07-14 12:02 ` [PATCH v1 5/6] pwm: tegra: Simplify using devm_pwmchip_add() Uwe Kleine-König
2026-07-14 12:02 ` [PATCH v1 6/6] pwm: tegra: Implement .get_state() Uwe Kleine-König
2026-07-15  5:09   ` Mikko Perttunen
2026-07-15 12:28   ` Ola Chr. Vaage

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=MAZ-TeVzRkyeyWYe-mCm7g@nvidia.com \
    --to=mperttunen@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@kernel.org \
    --cc=ukleinek@kernel.org \
    /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.