All of lore.kernel.org
 help / color / mirror / Atom feed
From: "R, Durgadoss" <durgadoss.r@intel.com>
To: Eduardo Valentin <eduardo.valentin@ti.com>,
	"devicetree-discuss@lists.ozlabs.org" 
	<devicetree-discuss@lists.ozlabs.org>
Cc: "wni@nvidia.com" <wni@nvidia.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
	"Zhang, Rui" <rui.zhang@intel.com>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>
Subject: RE: [lm-sensors] [RESEND PATCH V1 3/9] thermal: thermal_core: allow binding with limits on bind_params
Date: Wed, 17 Jul 2013 16:25:11 +0000	[thread overview]
Message-ID: <4D68720C2E767A4AA6A8796D42C8EB59CED41F@BGSMSX101.gar.corp.intel.com> (raw)
In-Reply-To: <1374074248-31690-4-git-send-email-eduardo.valentin@ti.com>

> -----Original Message-----
> From: lm-sensors-bounces@lm-sensors.org [mailto:lm-sensors-bounces@lm-
> sensors.org] On Behalf Of Eduardo Valentin
> Sent: Wednesday, July 17, 2013 8:47 PM
> To: devicetree-discuss@lists.ozlabs.org
> Cc: wni@nvidia.com; linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org;
> lm-sensors@lm-sensors.org; Eduardo Valentin; Zhang, Rui;
> l.stach@pengutronix.de
> Subject: [lm-sensors] [RESEND PATCH V1 3/9] thermal: thermal_core: allow
> binding with limits on bind_params
> 
> When registering a thermal zone device using platform information
> via bind_params, the thermal framework will always perform the
> cdev binding using the lowest and highest limits (THERMAL_NO_LIMIT).
> 
> This patch changes the data structures so that it is possible
> to inform what are the desired limits for each trip point
> inside a bind_param. The way the binding is performed is also
> changed so that it uses the new data structure.
> 
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>

This patch looks good to me.
Acked-by: Durgadoss R <durgadoss.r@intel.com>

Thanks,
Durga

> ---
>  Documentation/thermal/sysfs-api.txt |  7 +++++++
>  drivers/thermal/thermal_core.c      | 19 +++++++++++++++----
>  include/linux/thermal.h             | 10 ++++++++++
>  3 files changed, 32 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/thermal/sysfs-api.txt
> b/Documentation/thermal/sysfs-api.txt
> index a71bd5b..2ad50e7 100644
> --- a/Documentation/thermal/sysfs-api.txt
> +++ b/Documentation/thermal/sysfs-api.txt
> @@ -134,6 +134,13 @@ temperature) and throttle appropriate devices.
>                 this thermal zone and cdev, for a particular trip point.
>                 If nth bit is set, then the cdev and thermal zone are bound
>                 for trip point n.
> +    .limits: This is an array of cooling state limits. Must have exactly
> +         2 * thermal_zone.number_of_trip_points. It is an array consisting
> +         of tuples <lower-state upper-state> of state limits. Each trip
> +         will be associated with one state limit tuple when binding.
> +         A NULL pointer means <THERMAL_NO_LIMITS THERMAL_NO_LIMITS>
> +         on all trips. These limits are used when binding a cdev to a
> +         trip point.
>      .match: This call back returns success(0) if the 'tz and cdev' need to
>  	    be bound, as per platform data.
>  1.4.2 struct thermal_zone_params
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 247528b..096c8be 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -202,14 +202,23 @@ static void print_bind_err_msg(struct
> thermal_zone_device *tz,
>  }
> 
>  static void __bind(struct thermal_zone_device *tz, int mask,
> -			struct thermal_cooling_device *cdev)
> +			struct thermal_cooling_device *cdev,
> +			unsigned long *limits)
>  {
>  	int i, ret;
> 
>  	for (i = 0; i < tz->trips; i++) {
>  		if (mask & (1 << i)) {
> +			unsigned long upper, lower;
> +
> +			upper = THERMAL_NO_LIMIT;
> +			lower = THERMAL_NO_LIMIT;
> +			if (limits) {
> +				lower = limits[i * 2];
> +				upper = limits[i * 2 + 1];
> +			}
>  			ret = thermal_zone_bind_cooling_device(tz, i, cdev,
> -					THERMAL_NO_LIMIT,
> THERMAL_NO_LIMIT);
> +							       upper, lower);
>  			if (ret)
>  				print_bind_err_msg(tz, cdev, ret);
>  		}
> @@ -254,7 +263,8 @@ static void bind_cdev(struct thermal_cooling_device
> *cdev)
>  			if (tzp->tbp[i].match(pos, cdev))
>  				continue;
>  			tzp->tbp[i].cdev = cdev;
> -			__bind(pos, tzp->tbp[i].trip_mask, cdev);
> +			__bind(pos, tzp->tbp[i].trip_mask, cdev,
> +			       tzp->tbp[i].binding_limits);
>  		}
>  	}
> 
> @@ -292,7 +302,8 @@ static void bind_tz(struct thermal_zone_device *tz)
>  			if (tzp->tbp[i].match(tz, pos))
>  				continue;
>  			tzp->tbp[i].cdev = pos;
> -			__bind(tz, tzp->tbp[i].trip_mask, pos);
> +			__bind(tz, tzp->tbp[i].trip_mask, pos,
> +			       tzp->tbp[i].binding_limits);
>  		}
>  	}
>  exit:
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index a386a1c..39575eb 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -207,6 +207,16 @@ struct thermal_bind_params {
>  	 * See Documentation/thermal/sysfs-api.txt for more information.
>  	 */
>  	int trip_mask;
> +
> +	/*
> +	 * This is an array of cooling state limits. Must have exactly
> +	 * 2 * thermal_zone.number_of_trip_points. It is an array consisting
> +	 * of tuples <lower-state upper-state> of state limits. Each trip
> +	 * will be associated with one state limit tuple when binding.
> +	 * A NULL pointer means <THERMAL_NO_LIMITS THERMAL_NO_LIMITS>
> +	 * on all trips.
> +	 */
> +	unsigned long *binding_limits;
>  	int (*match) (struct thermal_zone_device *tz,
>  			struct thermal_cooling_device *cdev);
>  };
> --
> 1.8.2.1.342.gfa7285d
> 
> 
> _______________________________________________
> lm-sensors mailing list
> lm-sensors@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

WARNING: multiple messages have this Message-ID (diff)
From: "R, Durgadoss" <durgadoss.r@intel.com>
To: Eduardo Valentin <eduardo.valentin@ti.com>,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>
Cc: "wni@nvidia.com" <wni@nvidia.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
	"Zhang, Rui" <rui.zhang@intel.com>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>
Subject: Re: [lm-sensors] [RESEND PATCH V1 3/9] thermal: thermal_core: allow	binding with limits on bind_para
Date: Wed, 17 Jul 2013 16:25:11 +0000	[thread overview]
Message-ID: <4D68720C2E767A4AA6A8796D42C8EB59CED41F@BGSMSX101.gar.corp.intel.com> (raw)
In-Reply-To: <1374074248-31690-4-git-send-email-eduardo.valentin@ti.com>

> -----Original Message-----
> From: lm-sensors-bounces@lm-sensors.org [mailto:lm-sensors-bounces@lm-
> sensors.org] On Behalf Of Eduardo Valentin
> Sent: Wednesday, July 17, 2013 8:47 PM
> To: devicetree-discuss@lists.ozlabs.org
> Cc: wni@nvidia.com; linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org;
> lm-sensors@lm-sensors.org; Eduardo Valentin; Zhang, Rui;
> l.stach@pengutronix.de
> Subject: [lm-sensors] [RESEND PATCH V1 3/9] thermal: thermal_core: allow
> binding with limits on bind_params
> 
> When registering a thermal zone device using platform information
> via bind_params, the thermal framework will always perform the
> cdev binding using the lowest and highest limits (THERMAL_NO_LIMIT).
> 
> This patch changes the data structures so that it is possible
> to inform what are the desired limits for each trip point
> inside a bind_param. The way the binding is performed is also
> changed so that it uses the new data structure.
> 
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>

This patch looks good to me.
Acked-by: Durgadoss R <durgadoss.r@intel.com>

Thanks,
Durga

> ---
>  Documentation/thermal/sysfs-api.txt |  7 +++++++
>  drivers/thermal/thermal_core.c      | 19 +++++++++++++++----
>  include/linux/thermal.h             | 10 ++++++++++
>  3 files changed, 32 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/thermal/sysfs-api.txt
> b/Documentation/thermal/sysfs-api.txt
> index a71bd5b..2ad50e7 100644
> --- a/Documentation/thermal/sysfs-api.txt
> +++ b/Documentation/thermal/sysfs-api.txt
> @@ -134,6 +134,13 @@ temperature) and throttle appropriate devices.
>                 this thermal zone and cdev, for a particular trip point.
>                 If nth bit is set, then the cdev and thermal zone are bound
>                 for trip point n.
> +    .limits: This is an array of cooling state limits. Must have exactly
> +         2 * thermal_zone.number_of_trip_points. It is an array consisting
> +         of tuples <lower-state upper-state> of state limits. Each trip
> +         will be associated with one state limit tuple when binding.
> +         A NULL pointer means <THERMAL_NO_LIMITS THERMAL_NO_LIMITS>
> +         on all trips. These limits are used when binding a cdev to a
> +         trip point.
>      .match: This call back returns success(0) if the 'tz and cdev' need to
>  	    be bound, as per platform data.
>  1.4.2 struct thermal_zone_params
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 247528b..096c8be 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -202,14 +202,23 @@ static void print_bind_err_msg(struct
> thermal_zone_device *tz,
>  }
> 
>  static void __bind(struct thermal_zone_device *tz, int mask,
> -			struct thermal_cooling_device *cdev)
> +			struct thermal_cooling_device *cdev,
> +			unsigned long *limits)
>  {
>  	int i, ret;
> 
>  	for (i = 0; i < tz->trips; i++) {
>  		if (mask & (1 << i)) {
> +			unsigned long upper, lower;
> +
> +			upper = THERMAL_NO_LIMIT;
> +			lower = THERMAL_NO_LIMIT;
> +			if (limits) {
> +				lower = limits[i * 2];
> +				upper = limits[i * 2 + 1];
> +			}
>  			ret = thermal_zone_bind_cooling_device(tz, i, cdev,
> -					THERMAL_NO_LIMIT,
> THERMAL_NO_LIMIT);
> +							       upper, lower);
>  			if (ret)
>  				print_bind_err_msg(tz, cdev, ret);
>  		}
> @@ -254,7 +263,8 @@ static void bind_cdev(struct thermal_cooling_device
> *cdev)
>  			if (tzp->tbp[i].match(pos, cdev))
>  				continue;
>  			tzp->tbp[i].cdev = cdev;
> -			__bind(pos, tzp->tbp[i].trip_mask, cdev);
> +			__bind(pos, tzp->tbp[i].trip_mask, cdev,
> +			       tzp->tbp[i].binding_limits);
>  		}
>  	}
> 
> @@ -292,7 +302,8 @@ static void bind_tz(struct thermal_zone_device *tz)
>  			if (tzp->tbp[i].match(tz, pos))
>  				continue;
>  			tzp->tbp[i].cdev = pos;
> -			__bind(tz, tzp->tbp[i].trip_mask, pos);
> +			__bind(tz, tzp->tbp[i].trip_mask, pos,
> +			       tzp->tbp[i].binding_limits);
>  		}
>  	}
>  exit:
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index a386a1c..39575eb 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -207,6 +207,16 @@ struct thermal_bind_params {
>  	 * See Documentation/thermal/sysfs-api.txt for more information.
>  	 */
>  	int trip_mask;
> +
> +	/*
> +	 * This is an array of cooling state limits. Must have exactly
> +	 * 2 * thermal_zone.number_of_trip_points. It is an array consisting
> +	 * of tuples <lower-state upper-state> of state limits. Each trip
> +	 * will be associated with one state limit tuple when binding.
> +	 * A NULL pointer means <THERMAL_NO_LIMITS THERMAL_NO_LIMITS>
> +	 * on all trips.
> +	 */
> +	unsigned long *binding_limits;
>  	int (*match) (struct thermal_zone_device *tz,
>  			struct thermal_cooling_device *cdev);
>  };
> --
> 1.8.2.1.342.gfa7285d
> 
> 
> _______________________________________________
> lm-sensors mailing list
> lm-sensors@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  reply	other threads:[~2013-07-17 16:25 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 15:17 [RESEND PATCH V1 0/9] thermal: introduce DT thermal zone build Eduardo Valentin
2013-07-17 15:17 ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17 ` Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 1/9] cpufreq: cpufreq-cpu0: add dt node parsing for 'needs-cooling' Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-25 23:28   ` Rafael J. Wysocki
2013-07-25 23:28     ` [lm-sensors] [RESEND PATCH V1 1/9] cpufreq: cpufreq-cpu0: add dt node parsing for 'needs-cooling Rafael J. Wysocki
2013-07-26 13:27     ` [RESEND PATCH V1 1/9] cpufreq: cpufreq-cpu0: add dt node parsing for 'needs-cooling' Eduardo Valentin
2013-07-26 13:27       ` [lm-sensors] [RESEND PATCH V1 1/9] cpufreq: cpufreq-cpu0: add dt node parsing for 'needs-cooling Eduardo Valentin
2013-07-26 13:27       ` [RESEND PATCH V1 1/9] cpufreq: cpufreq-cpu0: add dt node parsing for 'needs-cooling' Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 2/9] thermal: hwmon: move hwmon support to single file Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-17 16:29   ` [lm-sensors] " R, Durgadoss
2013-07-17 16:29     ` R, Durgadoss
2013-07-17 16:29     ` R, Durgadoss
2013-07-17 15:17 ` [RESEND PATCH V1 3/9] thermal: thermal_core: allow binding with limits on bind_params Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-17 16:25   ` R, Durgadoss [this message]
2013-07-17 16:25     ` [lm-sensors] [RESEND PATCH V1 3/9] thermal: thermal_core: allow binding with limits on bind_para R, Durgadoss
2013-07-17 16:25     ` [lm-sensors] [RESEND PATCH V1 3/9] thermal: thermal_core: allow binding with limits on bind_params R, Durgadoss
2013-07-17 15:17 ` [RESEND PATCH V1 4/9] arm: dts: flag omap4430 with needs-cooling for cpu node Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 5/9] thermal: introduce device tree parser Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 6/9] thermal: ti-soc-thermal: use thermal DT infrastructure Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 7/9] arm: dts: add omap4430 thermal data Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 8/9] hwmon: lm75: expose to thermal fw via DT nodes Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-18  5:33   ` Wei Ni
2013-07-18  5:33     ` [lm-sensors] " Wei Ni
2013-07-18  5:33     ` Wei Ni
2013-07-18 13:12     ` Eduardo Valentin
2013-07-18 13:12       ` [lm-sensors] " Eduardo Valentin
2013-07-18 13:12       ` Eduardo Valentin
2013-07-19  7:43       ` Wei Ni
2013-07-19  7:43         ` [lm-sensors] " Wei Ni
2013-07-19  7:43         ` Wei Ni
2013-07-18  7:22   ` Guenter Roeck
2013-07-18  7:22     ` [lm-sensors] " Guenter Roeck
2013-07-17 15:17 ` [RESEND PATCH V1 9/9] hwmon: tmp102: " Eduardo Valentin
2013-07-17 15:17   ` [lm-sensors] " Eduardo Valentin
2013-07-17 15:17   ` Eduardo Valentin
2013-07-18  7:23   ` Guenter Roeck
2013-07-18  7:23     ` [lm-sensors] " Guenter Roeck
2013-07-17 22:09 ` [lm-sensors] [RESEND PATCH V1 0/9] thermal: introduce DT thermal zone build Guenter Roeck
2013-07-17 22:09   ` Guenter Roeck
2013-07-18 13:53   ` Eduardo Valentin
2013-07-18 13:53     ` Eduardo Valentin
2013-07-18 13:53     ` Eduardo Valentin
2013-07-18 17:18     ` Stephen Warren
2013-07-18 17:18       ` Stephen Warren
2013-07-18 21:21       ` Guenter Roeck
2013-07-18 21:21         ` Guenter Roeck
2013-07-19 13:03         ` Eduardo Valentin
2013-07-19 13:03           ` Eduardo Valentin
2013-07-19 13:03           ` Eduardo Valentin
2013-07-19 18:48         ` Stephen Warren
2013-07-19 18:48           ` Stephen Warren
2013-07-21 11:08           ` Guenter Roeck
2013-07-21 11:08             ` Guenter Roeck
2013-07-21 11:08             ` Guenter Roeck
2013-07-22 19:43             ` Stephen Warren
2013-07-22 19:43               ` Stephen Warren
2013-07-22 21:46               ` Guenter Roeck
2013-07-22 21:46                 ` Guenter Roeck
2013-07-18 21:11     ` Guenter Roeck
2013-07-18 21:11       ` Guenter Roeck
2013-07-18 21:11       ` Guenter Roeck
2013-07-19 13:38       ` Eduardo Valentin
2013-07-19 13:38         ` Eduardo Valentin
2013-07-19 13:38         ` Eduardo Valentin
2013-07-19 18:45         ` Stephen Warren
2013-07-19 18:45           ` Stephen Warren
2013-07-19 18:45           ` Stephen Warren
2013-07-19 18:56           ` Eduardo Valentin
2013-07-19 18:56             ` Eduardo Valentin
2013-07-19 18:56             ` Eduardo Valentin
2013-07-21 10:14             ` Guenter Roeck
2013-07-21 10:14               ` Guenter Roeck
2013-07-21 10:14               ` Guenter Roeck

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=4D68720C2E767A4AA6A8796D42C8EB59CED41F@BGSMSX101.gar.corp.intel.com \
    --to=durgadoss.r@intel.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=eduardo.valentin@ti.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=rui.zhang@intel.com \
    --cc=wni@nvidia.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 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.