All of lore.kernel.org
 help / color / mirror / Atom feed
* Freescale IMX6 active cooling
@ 2015-11-16  9:43 Catalin Crenguta
  2015-11-16 14:51 ` Fabio Estevam
  2015-11-17  6:12 ` Fwd: " Catalin Crenguta
  0 siblings, 2 replies; 14+ messages in thread
From: Catalin Crenguta @ 2015-11-16  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

I'm trying to use a GPIO Fan to cool down a Riotboard (I.MX6 Solo).
I've read [0], investigated the driver which provides the on-die
temperature ( fsl,imx6q-tempmon [1]) but it seems to provide the
temperature by creating a thermal zone (relevant dts: [2][3][4]).
I don't know how I should proceed:
1) Should I research how can I attach a cooling device to this already
existing thermal zone? (I believe it involves modifying the existing
driver by adding new device tree handles)
2) Should I create another thermal zone, use the existing driver to
get the temperature and bind to a cooling device?
3) Should I modify the existing driver to not create a thermal zone
and move the creation in the device tree using the of-thermal driver ?

Best regards,
Catalin Crenguta

[0] http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/thermal/thermal.txt
[1] http://lxr.free-electrons.com/source/drivers/thermal/imx_thermal.c
[2] http://lxr.free-electrons.com/source/arch/arm/boot/dts/imx6dl-riotboard.dts
[3] http://lxr.free-electrons.com/source/arch/arm/boot/dts/imx6dl.dtsi
[4] http://lxr.free-electrons.com/source/arch/arm/boot/dts/imx6qdl.dtsi

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

* Freescale IMX6 active cooling
  2015-11-16  9:43 Freescale IMX6 active cooling Catalin Crenguta
@ 2015-11-16 14:51 ` Fabio Estevam
  2015-11-17  9:38   ` Jon Nettleton
  2015-11-17  6:12 ` Fwd: " Catalin Crenguta
  1 sibling, 1 reply; 14+ messages in thread
From: Fabio Estevam @ 2015-11-16 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 16, 2015 at 7:43 AM, Catalin Crenguta
<catalin.crenguta@gmail.com> wrote:
> Hello,
>
> I'm trying to use a GPIO Fan to cool down a Riotboard (I.MX6 Solo).
> I've read [0], investigated the driver which provides the on-die
> temperature ( fsl,imx6q-tempmon [1]) but it seems to provide the
> temperature by creating a thermal zone (relevant dts: [2][3][4]).
> I don't know how I should proceed:
> 1) Should I research how can I attach a cooling device to this already
> existing thermal zone? (I believe it involves modifying the existing
> driver by adding new device tree handles)
> 2) Should I create another thermal zone, use the existing driver to
> get the temperature and bind to a cooling device?
> 3) Should I modify the existing driver to not create a thermal zone
> and move the creation in the device tree using the of-thermal driver ?

Maybe you could add the following folks on Cc?

THERMAL/CPU_COOLING
M:    Amit Daniel Kachhap <amit.kachhap@gmail.com>
M:    Viresh Kumar <viresh.kumar@linaro.org>
M:    Javi Merino <javi.merino@arm.com>
L:    linux-pm at vger.kernel.org
S:    Supported
F:    Documentation/thermal/cpu-cooling-api.txt
F:    drivers/thermal/cpu_cooling.c
F:    include/linux/cpu_cooling.h

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

* Fwd: Freescale IMX6 active cooling
  2015-11-16  9:43 Freescale IMX6 active cooling Catalin Crenguta
  2015-11-16 14:51 ` Fabio Estevam
@ 2015-11-17  6:12 ` Catalin Crenguta
  2015-11-17  8:23   ` Viresh Kumar
  2015-11-17  9:56   ` Fwd: " Javi Merino
  1 sibling, 2 replies; 14+ messages in thread
From: Catalin Crenguta @ 2015-11-17  6:12 UTC (permalink / raw)
  To: Amit Daniel Kachhap, Viresh Kumar, Javi Merino, linux-pm

+CC Maintainers

---------- Forwarded message ----------
From: Catalin Crenguta <catalin.crenguta@gmail.com>
Date: Mon, Nov 16, 2015 at 11:43 AM
Subject: Freescale IMX6 active cooling
To: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Cc: fabio.estevam@freescale.com, Fabio Estevam <festevam@gmail.com>


Hello,

I'm trying to use a GPIO Fan to cool down a Riotboard (I.MX6 Solo).
I've read [0], investigated the driver which provides the on-die
temperature ( fsl,imx6q-tempmon [1]) but it seems to provide the
temperature by creating a thermal zone (relevant dts: [2][3][4]).
I don't know how I should proceed:
1) Should I research how can I attach a cooling device to this already
existing thermal zone? (I believe it involves modifying the existing
driver by adding new device tree handles)
2) Should I create another thermal zone, use the existing driver to
get the temperature and bind to a cooling device?
3) Should I modify the existing driver to not create a thermal zone
and move the creation in the device tree using the of-thermal driver ?

Best regards,
Catalin Crenguta

[0] http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/thermal/thermal.txt
[1] http://lxr.free-electrons.com/source/drivers/thermal/imx_thermal.c
[2] http://lxr.free-electrons.com/source/arch/arm/boot/dts/imx6dl-riotboard.dts
[3] http://lxr.free-electrons.com/source/arch/arm/boot/dts/imx6dl.dtsi
[4] http://lxr.free-electrons.com/source/arch/arm/boot/dts/imx6qdl.dtsi

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

* Re: Freescale IMX6 active cooling
  2015-11-17  6:12 ` Fwd: " Catalin Crenguta
@ 2015-11-17  8:23   ` Viresh Kumar
  2015-11-17  9:56   ` Fwd: " Javi Merino
  1 sibling, 0 replies; 14+ messages in thread
From: Viresh Kumar @ 2015-11-17  8:23 UTC (permalink / raw)
  To: Catalin Crenguta, Eduardo Valentin, Zhang Rui
  Cc: Amit Daniel Kachhap, Javi Merino, linux-pm

Cc'ing Eduardo, as he can provide the most appropriate solution,

On 17 November 2015 at 11:42, Catalin Crenguta
<catalin.crenguta@gmail.com> wrote:
> I'm trying to use a GPIO Fan to cool down a Riotboard (I.MX6 Solo).

So, that's a cooling device.

> I've read [0], investigated the driver which provides the on-die
> temperature ( fsl,imx6q-tempmon [1]) but it seems to provide the
> temperature by creating a thermal zone (relevant dts: [2][3][4]).

That's right, on the other hand that driver also registers cpu-cooling
device as well..

> I don't know how I should proceed:
> 1) Should I research how can I attach a cooling device to this already
> existing thermal zone? (I believe it involves modifying the existing
> driver by adding new device tree handles)

Perhaps you need to write another cooling device driver for the gpio+fan
support. That will bind to the framework and to the thermal-zone as well.

Perhaps, there can be multiple cooling devices for the same thermal zone,
I am not sure how we pick only one of them at once, Eduardo can tell
better :)

--
viresh

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

* Freescale IMX6 active cooling
  2015-11-16 14:51 ` Fabio Estevam
@ 2015-11-17  9:38   ` Jon Nettleton
  2015-11-17 12:49       ` Catalin Crenguta
  0 siblings, 1 reply; 14+ messages in thread
From: Jon Nettleton @ 2015-11-17  9:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 16, 2015 at 3:51 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Nov 16, 2015 at 7:43 AM, Catalin Crenguta
> <catalin.crenguta@gmail.com> wrote:
>> Hello,
>>
>> I'm trying to use a GPIO Fan to cool down a Riotboard (I.MX6 Solo).
>> I've read [0], investigated the driver which provides the on-die
>> temperature ( fsl,imx6q-tempmon [1]) but it seems to provide the
>> temperature by creating a thermal zone (relevant dts: [2][3][4]).
>> I don't know how I should proceed:
>> 1) Should I research how can I attach a cooling device to this already
>> existing thermal zone? (I believe it involves modifying the existing
>> driver by adding new device tree handles)
>> 2) Should I create another thermal zone, use the existing driver to
>> get the temperature and bind to a cooling device?
>> 3) Should I modify the existing driver to not create a thermal zone
>> and move the creation in the device tree using the of-thermal driver ?
>
> Maybe you could add the following folks on Cc?
>
> THERMAL/CPU_COOLING
> M:    Amit Daniel Kachhap <amit.kachhap@gmail.com>
> M:    Viresh Kumar <viresh.kumar@linaro.org>
> M:    Javi Merino <javi.merino@arm.com>
> L:    linux-pm at vger.kernel.org
> S:    Supported
> F:    Documentation/thermal/cpu-cooling-api.txt
> F:    drivers/thermal/cpu_cooling.c
> F:    include/linux/cpu_cooling.h
>
> _______________________________________________

I would recommend you take a look at the work that xobs did for the
Novena Heirloom.  If you look at this branch starting around Aug 3 you
can see where he has converted iMX6 to use generic thermal zones and
adds support for for an active cooling device/fan.
https://github.com/xobs/novena-linux/commits/v3.19-novena-etnadrm-r3?page=3

-Jon

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

* Re: Fwd: Freescale IMX6 active cooling
  2015-11-17  6:12 ` Fwd: " Catalin Crenguta
  2015-11-17  8:23   ` Viresh Kumar
@ 2015-11-17  9:56   ` Javi Merino
  1 sibling, 0 replies; 14+ messages in thread
From: Javi Merino @ 2015-11-17  9:56 UTC (permalink / raw)
  To: Catalin Crenguta
  Cc: Eduardo Valentin, Rui Zhang, Amit Daniel Kachhap, Viresh Kumar,
	linux-pm, Fabio Estevam, Bai Ping

On Tue, Nov 17, 2015 at 08:12:56AM +0200, Catalin Crenguta wrote:
> +CC Maintainers
> 
> ---------- Forwarded message ----------
> From: Catalin Crenguta <catalin.crenguta@gmail.com>
> Date: Mon, Nov 16, 2015 at 11:43 AM
> Subject: Freescale IMX6 active cooling
> To: "linux-arm-kernel@lists.infradead.org"
> <linux-arm-kernel@lists.infradead.org>
> Cc: fabio.estevam@freescale.com, Fabio Estevam <festevam@gmail.com>
> 
> 
> Hello,
> 
> I'm trying to use a GPIO Fan to cool down a Riotboard (I.MX6 Solo).
> I've read [0], investigated the driver which provides the on-die
> temperature ( fsl,imx6q-tempmon [1]) but it seems to provide the
> temperature by creating a thermal zone (relevant dts: [2][3][4]).
> I don't know how I should proceed:
> 1) Should I research how can I attach a cooling device to this already
> existing thermal zone? (I believe it involves modifying the existing
> driver by adding new device tree handles)

Maybe you can use the gpio-fan driver in the kernel.  See
Documentation/devicetree/bindings/gpio/gpio-fan.txt and
drivers/hwmon/gpio-fan.c .  

> 2) Should I create another thermal zone, use the existing driver to
> get the temperature and bind to a cooling device?

No, you don't need another thermal zone.

> 3) Should I modify the existing driver to not create a thermal zone
> and move the creation in the device tree using the of-thermal driver ?

Converting the driver to device tree is the best option if all
existing users can be converted as well.

Cheers,
Javi

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

* Re: Freescale IMX6 active cooling
  2015-11-17  9:38   ` Jon Nettleton
@ 2015-11-17 12:49       ` Catalin Crenguta
  0 siblings, 0 replies; 14+ messages in thread
From: Catalin Crenguta @ 2015-11-17 12:49 UTC (permalink / raw)
  To: Jon Nettleton, Sean Cross
  Cc: Fabio Estevam, Fabio Estevam, linux-arm-kernel, linux-pm

On Tue, Nov 17, 2015 at 11:38 AM, Jon Nettleton <jon.nettleton@gmail.com> wrote:
> I would recommend you take a look at the work that xobs did for the
> Novena Heirloom.  If you look at this branch starting around Aug 3 you
> can see where he has converted iMX6 to use generic thermal zones and
> adds support for for an active cooling device/fan.
> https://github.com/xobs/novena-linux/commits/v3.19-novena-etnadrm-r3?page=3
>
> -Jon
Thank you!
I have patched my 4.3 kernel (they don't apply cleanly but they are
straight forward to modify), added a gpio-fan and the corresponding
thermal-zone in my DTB and it works!
Sean Cross, are you interested in bringing this to mainline?

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

* Freescale IMX6 active cooling
@ 2015-11-17 12:49       ` Catalin Crenguta
  0 siblings, 0 replies; 14+ messages in thread
From: Catalin Crenguta @ 2015-11-17 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 17, 2015 at 11:38 AM, Jon Nettleton <jon.nettleton@gmail.com> wrote:
> I would recommend you take a look at the work that xobs did for the
> Novena Heirloom.  If you look at this branch starting around Aug 3 you
> can see where he has converted iMX6 to use generic thermal zones and
> adds support for for an active cooling device/fan.
> https://github.com/xobs/novena-linux/commits/v3.19-novena-etnadrm-r3?page=3
>
> -Jon
Thank you!
I have patched my 4.3 kernel (they don't apply cleanly but they are
straight forward to modify), added a gpio-fan and the corresponding
thermal-zone in my DTB and it works!
Sean Cross, are you interested in bringing this to mainline?

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

* Re: Freescale IMX6 active cooling
  2015-11-17 12:49       ` Catalin Crenguta
@ 2015-11-18  4:53         ` Sean Cross
  -1 siblings, 0 replies; 14+ messages in thread
From: Sean Cross @ 2015-11-18  4:53 UTC (permalink / raw)
  To: Catalin Crenguta, Jon Nettleton
  Cc: Fabio Estevam, Fabio Estevam, linux-arm-kernel, linux-pm

On 17/11/2015 8:49 PM, Catalin Crenguta wrote:
> On Tue, Nov 17, 2015 at 11:38 AM, Jon Nettleton <jon.nettleton@gmail.com> wrote:
>> I would recommend you take a look at the work that xobs did for the
>> Novena Heirloom.  If you look at this branch starting around Aug 3 you
>> can see where he has converted iMX6 to use generic thermal zones and
>> adds support for for an active cooling device/fan.
>> https://github.com/xobs/novena-linux/commits/v3.19-novena-etnadrm-r3?page=3
>>
>> -Jon
> Thank you!
> I have patched my 4.3 kernel (they don't apply cleanly but they are
> straight forward to modify), added a gpio-fan and the corresponding
> thermal-zone in my DTB and it works!
> Sean Cross, are you interested in bringing this to mainline?
Yes, this does seem like the sort of thing that should make it into 
mainline.

Would you like me to submit it as a patch against 4.3?  I'm unclear how 
much should be added.

For example, the current code talks directly to the cpufreq cooling 
system, but that becomes unnecessary if using generic thermal zones, 
since the zones will bind cpufreq to the thermal sensor.  Then again, 
with such a patch, boards that do not explicitly update their device 
tree to support generic thermal zones will need to have their entries 
updated.

Perhaps the correct order of patches is:

1) Add generic thermal zone support
2) Remove zone and cdev from imx_thermal
3) Add cpufreq-cooling to imx6
4) Add cpufreq-cooling to all other SoCs that support imx_thermal
5) Add default generic thermal zone support to imx6qdl.dtsi

Comments on how it should be handled?


Sean

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

* Freescale IMX6 active cooling
@ 2015-11-18  4:53         ` Sean Cross
  0 siblings, 0 replies; 14+ messages in thread
From: Sean Cross @ 2015-11-18  4:53 UTC (permalink / raw)
  To: linux-arm-kernel

On 17/11/2015 8:49 PM, Catalin Crenguta wrote:
> On Tue, Nov 17, 2015 at 11:38 AM, Jon Nettleton <jon.nettleton@gmail.com> wrote:
>> I would recommend you take a look at the work that xobs did for the
>> Novena Heirloom.  If you look at this branch starting around Aug 3 you
>> can see where he has converted iMX6 to use generic thermal zones and
>> adds support for for an active cooling device/fan.
>> https://github.com/xobs/novena-linux/commits/v3.19-novena-etnadrm-r3?page=3
>>
>> -Jon
> Thank you!
> I have patched my 4.3 kernel (they don't apply cleanly but they are
> straight forward to modify), added a gpio-fan and the corresponding
> thermal-zone in my DTB and it works!
> Sean Cross, are you interested in bringing this to mainline?
Yes, this does seem like the sort of thing that should make it into 
mainline.

Would you like me to submit it as a patch against 4.3?  I'm unclear how 
much should be added.

For example, the current code talks directly to the cpufreq cooling 
system, but that becomes unnecessary if using generic thermal zones, 
since the zones will bind cpufreq to the thermal sensor.  Then again, 
with such a patch, boards that do not explicitly update their device 
tree to support generic thermal zones will need to have their entries 
updated.

Perhaps the correct order of patches is:

1) Add generic thermal zone support
2) Remove zone and cdev from imx_thermal
3) Add cpufreq-cooling to imx6
4) Add cpufreq-cooling to all other SoCs that support imx_thermal
5) Add default generic thermal zone support to imx6qdl.dtsi

Comments on how it should be handled?


Sean

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

* Re: Freescale IMX6 active cooling
  2015-11-18  4:53         ` Sean Cross
@ 2015-11-18 10:00           ` Catalin Crenguta
  -1 siblings, 0 replies; 14+ messages in thread
From: Catalin Crenguta @ 2015-11-18 10:00 UTC (permalink / raw)
  To: Sean Cross
  Cc: Jon Nettleton, Fabio Estevam, Fabio Estevam, linux-arm-kernel, linux-pm

On Wed, Nov 18, 2015 at 6:53 AM, Sean Cross <xobs@kosagi.com> wrote:
> Perhaps the correct order of patches is:
>
> 1) Add generic thermal zone support
> 2) Remove zone and cdev from imx_thermal
> 3) Add cpufreq-cooling to imx6
> 4) Add cpufreq-cooling to all other SoCs that support imx_thermal
> 5) Add default generic thermal zone support to imx6qdl.dtsi
In my opinion, I guess a patch series containing this would be good.

Thanks again!

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

* Freescale IMX6 active cooling
@ 2015-11-18 10:00           ` Catalin Crenguta
  0 siblings, 0 replies; 14+ messages in thread
From: Catalin Crenguta @ 2015-11-18 10:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 18, 2015 at 6:53 AM, Sean Cross <xobs@kosagi.com> wrote:
> Perhaps the correct order of patches is:
>
> 1) Add generic thermal zone support
> 2) Remove zone and cdev from imx_thermal
> 3) Add cpufreq-cooling to imx6
> 4) Add cpufreq-cooling to all other SoCs that support imx_thermal
> 5) Add default generic thermal zone support to imx6qdl.dtsi
In my opinion, I guess a patch series containing this would be good.

Thanks again!

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

* Re: Freescale IMX6 active cooling
  2015-11-18 10:00           ` Catalin Crenguta
@ 2015-11-18 21:56             ` Eduardo Valentin
  -1 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2015-11-18 21:56 UTC (permalink / raw)
  To: Catalin Crenguta
  Cc: Sean Cross, Jon Nettleton, Fabio Estevam, Fabio Estevam,
	linux-arm-kernel, linux-pm

Hello,

On Wed, Nov 18, 2015 at 12:00:05PM +0200, Catalin Crenguta wrote:
> On Wed, Nov 18, 2015 at 6:53 AM, Sean Cross <xobs@kosagi.com> wrote:
> > Perhaps the correct order of patches is:
> >
> > 1) Add generic thermal zone support
> > 2) Remove zone and cdev from imx_thermal
> > 3) Add cpufreq-cooling to imx6
> > 4) Add cpufreq-cooling to all other SoCs that support imx_thermal
> > 5) Add default generic thermal zone support to imx6qdl.dtsi
> In my opinion, I guess a patch series containing this would be good.

The recommendation is for you to use of-thermal, yes. In that way you
may benefit of describing your thermal hw specific data over DT. And you
can benefit of the existing cooling devices that have DT cooling
descriptors too, such as gpio-fan, and cpufreq-cooling, yes.

To use cpufreq-cooling, you may want to make sure your device works with
cpufreq-dt driver.

I would appreciate if you could clean up the IMX code to use the DT way
of describing thermal.

BR,

> 
> Thanks again!
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Freescale IMX6 active cooling
@ 2015-11-18 21:56             ` Eduardo Valentin
  0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2015-11-18 21:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Wed, Nov 18, 2015 at 12:00:05PM +0200, Catalin Crenguta wrote:
> On Wed, Nov 18, 2015 at 6:53 AM, Sean Cross <xobs@kosagi.com> wrote:
> > Perhaps the correct order of patches is:
> >
> > 1) Add generic thermal zone support
> > 2) Remove zone and cdev from imx_thermal
> > 3) Add cpufreq-cooling to imx6
> > 4) Add cpufreq-cooling to all other SoCs that support imx_thermal
> > 5) Add default generic thermal zone support to imx6qdl.dtsi
> In my opinion, I guess a patch series containing this would be good.

The recommendation is for you to use of-thermal, yes. In that way you
may benefit of describing your thermal hw specific data over DT. And you
can benefit of the existing cooling devices that have DT cooling
descriptors too, such as gpio-fan, and cpufreq-cooling, yes.

To use cpufreq-cooling, you may want to make sure your device works with
cpufreq-dt driver.

I would appreciate if you could clean up the IMX code to use the DT way
of describing thermal.

BR,

> 
> Thanks again!
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-11-18 21:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16  9:43 Freescale IMX6 active cooling Catalin Crenguta
2015-11-16 14:51 ` Fabio Estevam
2015-11-17  9:38   ` Jon Nettleton
2015-11-17 12:49     ` Catalin Crenguta
2015-11-17 12:49       ` Catalin Crenguta
2015-11-18  4:53       ` Sean Cross
2015-11-18  4:53         ` Sean Cross
2015-11-18 10:00         ` Catalin Crenguta
2015-11-18 10:00           ` Catalin Crenguta
2015-11-18 21:56           ` Eduardo Valentin
2015-11-18 21:56             ` Eduardo Valentin
2015-11-17  6:12 ` Fwd: " Catalin Crenguta
2015-11-17  8:23   ` Viresh Kumar
2015-11-17  9:56   ` Fwd: " Javi Merino

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.