All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: imx: remove cooling device
@ 2017-11-14 13:48 Bastian Stender
  2017-11-15  4:56 ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Bastian Stender @ 2017-11-14 13:48 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin
  Cc: linux-pm, Viresh Kumar, kernel, Bastian Stender

The cooling device should not be part of the i.MX thermal code but
rather in the i.MX cpufreq driver. So remove it here.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
---
This is part of a rework of "thermal: imx: use cpufreq cooling of
registration method" (id:20171103164203.5805-1-bst@pengutronix.de).

"cpufreq: imx6q: add CPU as cooling device" will reintroduce the
cooling device.
---
 drivers/thermal/imx_thermal.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 4798b4b1fd77..3bdbde675698 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -91,7 +91,6 @@ static struct thermal_soc_data thermal_imx6sx_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_get_sensor_data() */
@@ -533,22 +532,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;
 	}
@@ -563,7 +552,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;
 	}
@@ -579,7 +567,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;
 	}
@@ -608,7 +595,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;
 	}
@@ -630,7 +616,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;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal: imx: remove cooling device
  2017-11-14 13:48 [PATCH] thermal: imx: remove cooling device Bastian Stender
@ 2017-11-15  4:56 ` Viresh Kumar
  2017-11-15  5:00   ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2017-11-15  4:56 UTC (permalink / raw)
  To: Bastian Stender, shawnguo; +Cc: Zhang Rui, Eduardo Valentin, linux-pm, kernel

+ Shawn

On 14-11-17, 14:48, Bastian Stender wrote:
> The cooling device should not be part of the i.MX thermal code but
> rather in the i.MX cpufreq driver. So remove it here.
> 
> Signed-off-by: Bastian Stender <bst@pengutronix.de>

Shouldn't the two patches you sent be part of a series? What if one gets applied
before the other? For example if the cpufreq patch gets applied before this one,
then the kernel would break somewhere as two drivers would be adding the
cpu-cooling device :)

I am fine with the content of this patch though.

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal: imx: remove cooling device
  2017-11-15  4:56 ` Viresh Kumar
@ 2017-11-15  5:00   ` Viresh Kumar
  2017-11-15  9:05     ` Bastian Stender
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2017-11-15  5:00 UTC (permalink / raw)
  To: Bastian Stender, shawnguo; +Cc: Zhang Rui, Eduardo Valentin, linux-pm, kernel

On 15-11-17, 10:26, Viresh Kumar wrote:
> + Shawn
> 
> On 14-11-17, 14:48, Bastian Stender wrote:
> > The cooling device should not be part of the i.MX thermal code but
> > rather in the i.MX cpufreq driver. So remove it here.
> > 
> > Signed-off-by: Bastian Stender <bst@pengutronix.de>
> 
> Shouldn't the two patches you sent be part of a series? What if one gets applied
> before the other? For example if the cpufreq patch gets applied before this one,
> then the kernel would break somewhere as two drivers would be adding the
> cpu-cooling device :)

Actually, we may really want to have a single patch for this. So I would suggest
that we merge both the patches.

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal: imx: remove cooling device
  2017-11-15  5:00   ` Viresh Kumar
@ 2017-11-15  9:05     ` Bastian Stender
  0 siblings, 0 replies; 4+ messages in thread
From: Bastian Stender @ 2017-11-15  9:05 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: shawnguo, Eduardo Valentin, Zhang Rui, kernel, linux-pm

On 11/15/2017 06:00 AM, Viresh Kumar wrote:
> On 15-11-17, 10:26, Viresh Kumar wrote:
>> + Shawn
>>
>> On 14-11-17, 14:48, Bastian Stender wrote:
>>> The cooling device should not be part of the i.MX thermal code but
>>> rather in the i.MX cpufreq driver. So remove it here.
>>>
>>> Signed-off-by: Bastian Stender <bst@pengutronix.de>
>>
>> Shouldn't the two patches you sent be part of a series? What if one gets applied
>> before the other? For example if the cpufreq patch gets applied before this one,
>> then the kernel would break somewhere as two drivers would be adding the
>> cpu-cooling device :)
> 
> Actually, we may really want to have a single patch for this. So I would suggest
> that we merge both the patches.

Okay, I will send a merged v2.

Regards,
Bastian

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-15  9:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 13:48 [PATCH] thermal: imx: remove cooling device Bastian Stender
2017-11-15  4:56 ` Viresh Kumar
2017-11-15  5:00   ` Viresh Kumar
2017-11-15  9:05     ` Bastian Stender

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.