devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Viresh Kumar
	<viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Zhang Rui <rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Eduardo Valentin
	<edubezval-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Vincent Guittot
	<vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Punit.Agrawal-5wv7dgnIgG8@public.gmane.org,
	ionela.voinescu-5wv7dgnIgG8@public.gmane.org
Subject: Re: [Query] thermal: Who is using "cooling-{min|max}-level}" properties ?
Date: Wed, 7 Feb 2018 11:04:45 +0100	[thread overview]
Message-ID: <c7bd6ed5-b93e-3a07-b4a2-4c3b1eef5fac@linaro.org> (raw)
In-Reply-To: <20180207065959.GN28462@vireshk-i7>

On 07/02/2018 07:59, Viresh Kumar wrote:
> Looks like I am missing the obvious and sorry for the noise in advance.
> 
> But I couldn't find any code that parses the "cooling-{min|max}-level" DT
> bindings in the kernel. Yeah, almost every ARM platform have these properties
> set for their CPU nodes in DT, but I don't see how these are getting used.
> 
> I even tried to remove them for my hikey platform and everything worked as if
> nothing has changed (which I was expecting anyway). The deal is that the
> ->get_max_state() callback of the cooling drivers are getting called to get the
> range at runtime and none of them refers to these bindings.
> 
> Removing code is always fun and I would be happy to post a series to clean
> things up if everyone agrees. Please let me know if my understanding is correct
> and if it would be fine to remove these bindings completely.

Yeah, this is a bit fuzzy. There are still cooling-{min|max}-*state*
definitions in the DTs

Documentation/devicetree/bindings/hwmon/pwm-fan.txt:
cooling-min-state = <0>;
arch/arm/boot/dts/exynos4412-odroidu3.dts:
cooling-min-state = <0>;
arch/arm/boot/dts/exynos5410-odroidxu.dts:
cooling-min-state = <0>;
arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi:
cooling-min-state = <0>;
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi:
cooling-min-state = <0>;


IIUC, the cooling-device in the mapping defines the min and max states
which are the values used in the thermal zone binding.

And the cooling-[min|max]-level are the hardware limits:

cooling-min-level <= cooling-device min|max state <= cooling-max-level

For example on the hikey6220:

The DT specifies for CPU0:

	operating-points-v2 = <&cpu_opp_table>;
	cooling-min-level = <4>;
	cooling-max-level = <0>;
	#cooling-cells = <2>; /* min followed by max */

and for the cooling device for map0

	cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;

So if my understanding is correct, the optional property
cooling-[min|max]-level is used to make sure the cooling device min
state and max state are in the hardware boundaries. And the thermal
framework misses to do the consistency check at init.

I'm not sure how useful are cooling-{min|max}-*state* bindings.

-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-02-07 10:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07  6:59 [Query] thermal: Who is using "cooling-{min|max}-level}" properties ? Viresh Kumar
2018-02-07 10:04 ` Daniel Lezcano [this message]
     [not found]   ` <c7bd6ed5-b93e-3a07-b4a2-4c3b1eef5fac-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2018-02-07 10:24     ` Viresh Kumar
2018-02-07 10:45       ` Daniel Lezcano
2018-02-09  6:42         ` Viresh Kumar
2018-02-09  9:15           ` Daniel Lezcano
     [not found]             ` <539699c7-9509-dea2-2b31-c5f6749c99c4-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2018-02-09  9:24               ` Viresh Kumar
2018-02-09 12:14                 ` Daniel Lezcano
     [not found]                   ` <5722441d-c8be-4d29-fab7-28b4e5716961-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2018-02-12  6:10                     ` Viresh Kumar
2018-02-12  8:39                       ` Daniel Lezcano
2018-02-12  8:52                         ` Viresh Kumar
2018-02-12  9:52                           ` Daniel Lezcano
2018-02-12 10:17                             ` Viresh Kumar

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=c7bd6ed5-b93e-3a07-b4a2-4c3b1eef5fac@linaro.org \
    --to=daniel.lezcano-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=Punit.Agrawal-5wv7dgnIgG8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=edubezval-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ionela.voinescu-5wv7dgnIgG8@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).