public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>, cwchoi00@gmail.com
Cc: lukasz.luba@arm.com, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, Rob Herring <robh@kernel.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	"open list:ARM MALI PANFROST DRM DRIVER" 
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v5 3/4] PM / devfreq: panfrost: Use devfreq cooling device registration
Date: Mon, 8 Mar 2021 09:51:46 +0000	[thread overview]
Message-ID: <59627ba5-2602-73cd-c24c-b6695a4fd650@arm.com> (raw)
In-Reply-To: <20210308091646.28096-3-daniel.lezcano@linaro.org>

On 08/03/2021 09:16, Daniel Lezcano wrote:
> The devfreq core code is able to register the devfreq device as a
> cooling device if the 'is_cooling_device' flag is set in the profile.
> 
> Use this flag and remove the cooling device registering code.
> 
> Tested on rock960.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>   drivers/gpu/drm/panfrost/panfrost_devfreq.c | 14 +-------------
>   drivers/gpu/drm/panfrost/panfrost_devfreq.h |  3 ---
>   2 files changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> index 56b3f5935703..4d96edf1bc54 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> @@ -3,7 +3,6 @@
>   
>   #include <linux/clk.h>
>   #include <linux/devfreq.h>
> -#include <linux/devfreq_cooling.h>
>   #include <linux/platform_device.h>
>   #include <linux/pm_opp.h>
>   
> @@ -80,6 +79,7 @@ static struct devfreq_dev_profile panfrost_devfreq_profile = {
>   	.polling_ms = 50, /* ~3 frames */
>   	.target = panfrost_devfreq_target,
>   	.get_dev_status = panfrost_devfreq_get_dev_status,
> +	.is_cooling_device = true,
>   };
>   
>   int panfrost_devfreq_init(struct panfrost_device *pfdev)
> @@ -90,7 +90,6 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
>   	struct device *dev = &pfdev->pdev->dev;
>   	struct devfreq *devfreq;
>   	struct opp_table *opp_table;
> -	struct thermal_cooling_device *cooling;
>   	struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq;
>   
>   	opp_table = dev_pm_opp_set_regulators(dev, pfdev->comp->supply_names,
> @@ -139,12 +138,6 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
>   	}
>   	pfdevfreq->devfreq = devfreq;
>   
> -	cooling = devfreq_cooling_em_register(devfreq, NULL);
> -	if (IS_ERR(cooling))
> -		DRM_DEV_INFO(dev, "Failed to register cooling device\n");
> -	else
> -		pfdevfreq->cooling = cooling;
> -
>   	return 0;
>   
>   err_fini:
> @@ -156,11 +149,6 @@ void panfrost_devfreq_fini(struct panfrost_device *pfdev)
>   {
>   	struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq;
>   
> -	if (pfdevfreq->cooling) {
> -		devfreq_cooling_unregister(pfdevfreq->cooling);
> -		pfdevfreq->cooling = NULL;
> -	}
> -
>   	if (pfdevfreq->opp_of_table_added) {
>   		dev_pm_opp_of_remove_table(&pfdev->pdev->dev);
>   		pfdevfreq->opp_of_table_added = false;
> diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h
> index db6ea48e21f9..470f5c974703 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h
> +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h
> @@ -9,14 +9,11 @@
>   
>   struct devfreq;
>   struct opp_table;
> -struct thermal_cooling_device;
> -
>   struct panfrost_device;
>   
>   struct panfrost_devfreq {
>   	struct devfreq *devfreq;
>   	struct opp_table *regulators_opp_table;
> -	struct thermal_cooling_device *cooling;
>   	bool opp_of_table_added;
>   
>   	ktime_t busy_time;
> 


  reply	other threads:[~2021-03-08  9:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08  9:16 [PATCH v5 1/4] PM / devfreq: Register devfreq as a cooling device on demand Daniel Lezcano
2021-03-08  9:16 ` [PATCH v5 2/4] PM / devfreq: msm: Use devfreq cooling device registration Daniel Lezcano
2021-03-08  9:16 ` [PATCH v5 3/4] PM / devfreq: panfrost: " Daniel Lezcano
2021-03-08  9:51   ` Steven Price [this message]
2021-03-08  9:16 ` [PATCH v5 4/4] PM / devfreq: lima: " Daniel Lezcano
2021-03-08  9:51 ` [PATCH v5 1/4] PM / devfreq: Register devfreq as a cooling device on demand Steven Price
2021-03-08  9:53 ` Lukasz Luba
2021-03-08 12:00   ` Daniel Lezcano
2021-03-08 12:04     ` Lukasz Luba

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=59627ba5-2602-73cd-c24c-b6695a4fd650@arm.com \
    --to=steven.price@arm.com \
    --cc=airlied@linux.ie \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=cwchoi00@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=robh@kernel.org \
    --cc=tomeu.vizoso@collabora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox