mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bastian Stender <bst@pengutronix.de>
To: Anson Huang <Anson.Huang@nxp.com>,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, fabio.estevam@nxp.com, robh+dt@kernel.org,
	mark.rutland@arm.com, rjw@rjwysocki.net, viresh.kumar@linaro.org,
	rui.zhang@intel.com, edubezval@gmail.com
Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
	Linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] thermal: imx: remove cpufreq cooling registration
Date: Mon, 14 May 2018 10:37:21 +0200	[thread overview]
Message-ID: <5a449fc0-4d3e-c7c7-0e9a-43efb4b909cf@pengutronix.de> (raw)
In-Reply-To: <1526285359-17978-1-git-send-email-Anson.Huang@nxp.com>

Hi,

On 05/14/2018 10:09 AM, Anson Huang wrote:
> This patch removes cpufreq cooling registration in
> thermal .probe function, cpufreq cooling should be
> done in cpufreq driver when it is ready.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

It seems you are trying to achieve something similar to a patch I sent a
couple of month ago. Unfortunately I did not have the time to rework it yet:

   https://patchwork.kernel.org/patch/10059085/

Some of the comments might apply here too.

Regards,
Bastian

> ---
>   drivers/thermal/imx_thermal.c | 16 ----------------
>   1 file changed, 16 deletions(-)
> 
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index c30dc21..8eedb97 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -9,7 +9,6 @@
>   
>   #include <linux/clk.h>
>   #include <linux/cpufreq.h>
> -#include <linux/cpu_cooling.h>
>   #include <linux/delay.h>
>   #include <linux/device.h>
>   #include <linux/init.h>
> @@ -207,7 +206,6 @@ static struct thermal_soc_data thermal_imx7d_data = {
>   struct imx_thermal_data {
>   	struct cpufreq_policy *policy;
>   	struct thermal_zone_device *tz;
> -	struct thermal_cooling_device *cdev;
>   	enum thermal_device_mode mode;
>   	struct regmap *tempmon;
>   	u32 c1, c2; /* See formula in imx_init_calib() */
> @@ -729,22 +727,12 @@ static int imx_thermal_probe(struct platform_device *pdev)
>   		return -EPROBE_DEFER;
>   	}
>   
> -	data->cdev = cpufreq_cooling_register(data->policy);
> -	if (IS_ERR(data->cdev)) {
> -		ret = PTR_ERR(data->cdev);
> -		dev_err(&pdev->dev,
> -			"failed to register cpufreq cooling device: %d\n", ret);
> -		cpufreq_cpu_put(data->policy);
> -		return ret;
> -	}
> -
>   	data->thermal_clk = devm_clk_get(&pdev->dev, NULL);
>   	if (IS_ERR(data->thermal_clk)) {
>   		ret = PTR_ERR(data->thermal_clk);
>   		if (ret != -EPROBE_DEFER)
>   			dev_err(&pdev->dev,
>   				"failed to get thermal clk: %d\n", ret);
> -		cpufreq_cooling_unregister(data->cdev);
>   		cpufreq_cpu_put(data->policy);
>   		return ret;
>   	}
> @@ -759,7 +747,6 @@ static int imx_thermal_probe(struct platform_device *pdev)
>   	ret = clk_prepare_enable(data->thermal_clk);
>   	if (ret) {
>   		dev_err(&pdev->dev, "failed to enable thermal clk: %d\n", ret);
> -		cpufreq_cooling_unregister(data->cdev);
>   		cpufreq_cpu_put(data->policy);
>   		return ret;
>   	}
> @@ -775,7 +762,6 @@ static int imx_thermal_probe(struct platform_device *pdev)
>   		dev_err(&pdev->dev,
>   			"failed to register thermal zone device %d\n", ret);
>   		clk_disable_unprepare(data->thermal_clk);
> -		cpufreq_cooling_unregister(data->cdev);
>   		cpufreq_cpu_put(data->policy);
>   		return ret;
>   	}
> @@ -811,7 +797,6 @@ static int imx_thermal_probe(struct platform_device *pdev)
>   		dev_err(&pdev->dev, "failed to request alarm irq: %d\n", ret);
>   		clk_disable_unprepare(data->thermal_clk);
>   		thermal_zone_device_unregister(data->tz);
> -		cpufreq_cooling_unregister(data->cdev);
>   		cpufreq_cpu_put(data->policy);
>   		return ret;
>   	}
> @@ -831,7 +816,6 @@ static int imx_thermal_remove(struct platform_device *pdev)
>   		clk_disable_unprepare(data->thermal_clk);
>   
>   	thermal_zone_device_unregister(data->tz);
> -	cpufreq_cooling_unregister(data->cdev);
>   	cpufreq_cpu_put(data->policy);
>   
>   	return 0;
> 

-- 
Pengutronix e.K.
Industrial Linux Solutions
http://www.pengutronix.de/
Peiner Str. 6-8, 31137 Hildesheim, Germany
Amtsgericht Hildesheim, HRA 2686

  parent reply	other threads:[~2018-05-14  8:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14  8:09 Anson Huang
2018-05-14  8:09 ` [PATCH 2/3] cpufreq: imx6q: add cpufreq cooling device based on device tree Anson Huang
2018-05-14  8:09 ` [PATCH 3/3] ARM: dts: imx: add cooling-cells for cpufreq cooling device Anson Huang
2018-05-14  8:34 ` [PATCH 1/3] thermal: imx: remove cpufreq cooling registration Daniel Lezcano
2018-05-14  8:37 ` Bastian Stender [this message]
2018-05-14  9:10   ` Anson Huang
2018-05-14  9:18     ` Bastian Stender

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=5a449fc0-4d3e-c7c7-0e9a-43efb4b909cf@pengutronix.de \
    --to=bst@pengutronix.de \
    --cc=Anson.Huang@nxp.com \
    --cc=Linux-imx@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=viresh.kumar@linaro.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 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®