All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Erico Nunes <nunes.erico@gmail.com>
Cc: Qiang Yu <yuq825@gmail.com>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm/lima: Fix opp clkname setting in case of missing regulator
Date: Thu, 27 Oct 2022 13:35:19 +0530	[thread overview]
Message-ID: <20221027080519.lfpduyt7jcwh3b4k@vireshk-i7> (raw)
In-Reply-To: <20221027073200.3885839-1-nunes.erico@gmail.com>

On 27-10-22, 09:32, Erico Nunes wrote:
> Commit d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()")
> introduced a regression as it may undo the clk_names setting in case
> the optional regulator is missing. This resulted in test and performance
> regressions with lima.
> 
> Restore the old behavior where clk_names is set separately so it is not
> undone in case of a missing optional regulator.
> 
> Fixes: d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()")
> Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
> ---
> v2: revert back to using devm_pm_opp_set_clkname and
> devm_pm_opp_set_regulators
> ---
>  drivers/gpu/drm/lima/lima_devfreq.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c
> index 011be7ff51e1..bc8fb4e38d0a 100644
> --- a/drivers/gpu/drm/lima/lima_devfreq.c
> +++ b/drivers/gpu/drm/lima/lima_devfreq.c
> @@ -112,11 +112,6 @@ int lima_devfreq_init(struct lima_device *ldev)
>  	unsigned long cur_freq;
>  	int ret;
>  	const char *regulator_names[] = { "mali", NULL };
> -	const char *clk_names[] = { "core", NULL };
> -	struct dev_pm_opp_config config = {
> -		.regulator_names = regulator_names,
> -		.clk_names = clk_names,
> -	};
>  
>  	if (!device_property_present(dev, "operating-points-v2"))
>  		/* Optional, continue without devfreq */
> @@ -124,7 +119,15 @@ int lima_devfreq_init(struct lima_device *ldev)
>  
>  	spin_lock_init(&ldevfreq->lock);
>  
> -	ret = devm_pm_opp_set_config(dev, &config);
> +	/*
> +	 * clkname is set separately so it is not affected by the optional
> +	 * regulator setting which may return error.
> +	 */
> +	ret = devm_pm_opp_set_clkname(dev, "core");
> +	if (ret)
> +		return ret;
> +
> +	ret = devm_pm_opp_set_regulators(dev, regulator_names);
>  	if (ret) {
>  		/* Continue if the optional regulator is missing */
>  		if (ret != -ENODEV)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Erico Nunes <nunes.erico@gmail.com>
Cc: lima@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, Qiang Yu <yuq825@gmail.com>
Subject: Re: [PATCH v2] drm/lima: Fix opp clkname setting in case of missing regulator
Date: Thu, 27 Oct 2022 13:35:19 +0530	[thread overview]
Message-ID: <20221027080519.lfpduyt7jcwh3b4k@vireshk-i7> (raw)
In-Reply-To: <20221027073200.3885839-1-nunes.erico@gmail.com>

On 27-10-22, 09:32, Erico Nunes wrote:
> Commit d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()")
> introduced a regression as it may undo the clk_names setting in case
> the optional regulator is missing. This resulted in test and performance
> regressions with lima.
> 
> Restore the old behavior where clk_names is set separately so it is not
> undone in case of a missing optional regulator.
> 
> Fixes: d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()")
> Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
> ---
> v2: revert back to using devm_pm_opp_set_clkname and
> devm_pm_opp_set_regulators
> ---
>  drivers/gpu/drm/lima/lima_devfreq.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c
> index 011be7ff51e1..bc8fb4e38d0a 100644
> --- a/drivers/gpu/drm/lima/lima_devfreq.c
> +++ b/drivers/gpu/drm/lima/lima_devfreq.c
> @@ -112,11 +112,6 @@ int lima_devfreq_init(struct lima_device *ldev)
>  	unsigned long cur_freq;
>  	int ret;
>  	const char *regulator_names[] = { "mali", NULL };
> -	const char *clk_names[] = { "core", NULL };
> -	struct dev_pm_opp_config config = {
> -		.regulator_names = regulator_names,
> -		.clk_names = clk_names,
> -	};
>  
>  	if (!device_property_present(dev, "operating-points-v2"))
>  		/* Optional, continue without devfreq */
> @@ -124,7 +119,15 @@ int lima_devfreq_init(struct lima_device *ldev)
>  
>  	spin_lock_init(&ldevfreq->lock);
>  
> -	ret = devm_pm_opp_set_config(dev, &config);
> +	/*
> +	 * clkname is set separately so it is not affected by the optional
> +	 * regulator setting which may return error.
> +	 */
> +	ret = devm_pm_opp_set_clkname(dev, "core");
> +	if (ret)
> +		return ret;
> +
> +	ret = devm_pm_opp_set_regulators(dev, regulator_names);
>  	if (ret) {
>  		/* Continue if the optional regulator is missing */
>  		if (ret != -ENODEV)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

  reply	other threads:[~2022-10-27  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27  7:32 [PATCH v2] drm/lima: Fix opp clkname setting in case of missing regulator Erico Nunes
2022-10-27  8:05 ` Viresh Kumar [this message]
2022-10-27  8:05   ` Viresh Kumar
2022-10-31 10:35   ` Erico Nunes
2022-10-31 10:35     ` Erico Nunes
2022-11-14 12:03     ` Qiang Yu
2022-11-14 12:03       ` Qiang Yu

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=20221027080519.lfpduyt7jcwh3b4k@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lima@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nunes.erico@gmail.com \
    --cc=yuq825@gmail.com \
    /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.