All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Jean Pihet <jean.pihet@newoldbits.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	paul@pwsan.com, Jean Pihet <j-pihet@ti.com>
Subject: Re: [PATCH v2 3/7] OMAP: PM CONSTRAINTS: implement wake-up latency constraints
Date: Thu, 17 Mar 2011 13:18:41 -0700	[thread overview]
Message-ID: <87r5a5zeji.fsf@ti.com> (raw)
In-Reply-To: <1299779247-20511-4-git-send-email-j-pihet@ti.com> (Jean Pihet's message of "Thu, 10 Mar 2011 18:47:23 +0100")

Jean Pihet <jean.pihet@newoldbits.com> writes:

> Implement the wake-up latency constraints using an internal
> unified function _set_dev_constraint at OMAP PM level,
> which calls the corresponding function at omap device level.
>
> The actual constraints management code is at the omap device level.
>
> Note: the bus throughput function is implemented but currently is
> a no-op.
>
> Tested on OMAP3 Beagleboard in RET/OFF using wake-up latency constraints
> on MPU, CORE and PER.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  arch/arm/plat-omap/omap-pm-constraints.c |  174 ++++++++++++++++--------------
>  1 files changed, 91 insertions(+), 83 deletions(-)
>
> diff --git a/arch/arm/plat-omap/omap-pm-constraints.c b/arch/arm/plat-omap/omap-pm-constraints.c
> index c8b4e4c..c6735da 100644
> --- a/arch/arm/plat-omap/omap-pm-constraints.c
> +++ b/arch/arm/plat-omap/omap-pm-constraints.c
> @@ -24,6 +24,7 @@
>  /* Interface documentation is in mach/omap-pm.h */
>  #include <plat/omap-pm.h>
>  #include <plat/omap_device.h>
> +#include <plat/common.h>
>  
>  static bool off_mode_enabled;
>  static u32 dummy_context_loss_counter;
> @@ -32,119 +33,126 @@ static u32 dummy_context_loss_counter;
>   * Device-driver-originated constraints (via board-*.c files)
>   */
>  
> -int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t)
> +/*
> + * Generic function to omap_device layer for the constraints API.
> + */
> +static int _set_dev_constraint(enum omap_pm_constraint_class class,
> +			       struct device *req_dev, struct device *dev,
> +			       long t)
>  {
> -	if (!dev || t < -1) {
> +	int ret = 0;
> +
> +	if (!req_dev || !dev || t < -1) {
>  		WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
>  		return -EINVAL;
> -	};
> -
> -	if (t == -1)
> -		pr_debug("OMAP PM: remove max MPU wakeup latency constraint: "
> -			 "dev %s\n", dev_name(dev));
> -	else
> -		pr_debug("OMAP PM: add max MPU wakeup latency constraint: "
> -			 "dev %s, t = %ld usec\n", dev_name(dev), t);
> +	}
>  
> -	/*
> -	 * For current Linux, this needs to map the MPU to a
> -	 * powerdomain, then go through the list of current max lat
> -	 * constraints on the MPU and find the smallest.  If
> -	 * the latency constraint has changed, the code should
> -	 * recompute the state to enter for the next powerdomain
> -	 * state.
> -	 *
> -	 * TI CDP code can call constraint_set here.
> -	 */
> +	/* Try to catch non omap_device for dev */

comment should be 'only valid for omap_devices'

> +	if (dev->parent == &omap_device_parent) {
> +		if (t == -1)
> +			pr_debug("OMAP PM: remove constraint of class %d "
> +				 "from req_dev %s on dev %s\n",
> +				 class, dev_name(req_dev), dev_name(dev));
> +		else
> +			pr_debug("OMAP PM: add constraint of class %d "
> +				 "from req_dev %s on dev %s, t = %ld\n",
> +				 class, dev_name(req_dev), dev_name(dev), t);
> +
> +		/* Call the omap_device API */

comment not needed

> +		ret = omap_device_set_dev_constraint(class, req_dev, dev, t);

Calling a function which doesn't yet exist. 

Patches should be ordered such that the kernel still compiles after each patch.

> +	} else {
> +		pr_err("OMAP-PM set_wakeup_lat: Error: platform device "
> +		       "not valid\n");

comment should be 'Error: not an omap_device'.

> +		return -EINVAL;
> +	}
>  
> -	return 0;
> +	return ret;
>  }

Kevin

WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/7] OMAP: PM CONSTRAINTS: implement wake-up latency constraints
Date: Thu, 17 Mar 2011 13:18:41 -0700	[thread overview]
Message-ID: <87r5a5zeji.fsf@ti.com> (raw)
In-Reply-To: <1299779247-20511-4-git-send-email-j-pihet@ti.com> (Jean Pihet's message of "Thu, 10 Mar 2011 18:47:23 +0100")

Jean Pihet <jean.pihet@newoldbits.com> writes:

> Implement the wake-up latency constraints using an internal
> unified function _set_dev_constraint at OMAP PM level,
> which calls the corresponding function at omap device level.
>
> The actual constraints management code is at the omap device level.
>
> Note: the bus throughput function is implemented but currently is
> a no-op.
>
> Tested on OMAP3 Beagleboard in RET/OFF using wake-up latency constraints
> on MPU, CORE and PER.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  arch/arm/plat-omap/omap-pm-constraints.c |  174 ++++++++++++++++--------------
>  1 files changed, 91 insertions(+), 83 deletions(-)
>
> diff --git a/arch/arm/plat-omap/omap-pm-constraints.c b/arch/arm/plat-omap/omap-pm-constraints.c
> index c8b4e4c..c6735da 100644
> --- a/arch/arm/plat-omap/omap-pm-constraints.c
> +++ b/arch/arm/plat-omap/omap-pm-constraints.c
> @@ -24,6 +24,7 @@
>  /* Interface documentation is in mach/omap-pm.h */
>  #include <plat/omap-pm.h>
>  #include <plat/omap_device.h>
> +#include <plat/common.h>
>  
>  static bool off_mode_enabled;
>  static u32 dummy_context_loss_counter;
> @@ -32,119 +33,126 @@ static u32 dummy_context_loss_counter;
>   * Device-driver-originated constraints (via board-*.c files)
>   */
>  
> -int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t)
> +/*
> + * Generic function to omap_device layer for the constraints API.
> + */
> +static int _set_dev_constraint(enum omap_pm_constraint_class class,
> +			       struct device *req_dev, struct device *dev,
> +			       long t)
>  {
> -	if (!dev || t < -1) {
> +	int ret = 0;
> +
> +	if (!req_dev || !dev || t < -1) {
>  		WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
>  		return -EINVAL;
> -	};
> -
> -	if (t == -1)
> -		pr_debug("OMAP PM: remove max MPU wakeup latency constraint: "
> -			 "dev %s\n", dev_name(dev));
> -	else
> -		pr_debug("OMAP PM: add max MPU wakeup latency constraint: "
> -			 "dev %s, t = %ld usec\n", dev_name(dev), t);
> +	}
>  
> -	/*
> -	 * For current Linux, this needs to map the MPU to a
> -	 * powerdomain, then go through the list of current max lat
> -	 * constraints on the MPU and find the smallest.  If
> -	 * the latency constraint has changed, the code should
> -	 * recompute the state to enter for the next powerdomain
> -	 * state.
> -	 *
> -	 * TI CDP code can call constraint_set here.
> -	 */
> +	/* Try to catch non omap_device for dev */

comment should be 'only valid for omap_devices'

> +	if (dev->parent == &omap_device_parent) {
> +		if (t == -1)
> +			pr_debug("OMAP PM: remove constraint of class %d "
> +				 "from req_dev %s on dev %s\n",
> +				 class, dev_name(req_dev), dev_name(dev));
> +		else
> +			pr_debug("OMAP PM: add constraint of class %d "
> +				 "from req_dev %s on dev %s, t = %ld\n",
> +				 class, dev_name(req_dev), dev_name(dev), t);
> +
> +		/* Call the omap_device API */

comment not needed

> +		ret = omap_device_set_dev_constraint(class, req_dev, dev, t);

Calling a function which doesn't yet exist. 

Patches should be ordered such that the kernel still compiles after each patch.

> +	} else {
> +		pr_err("OMAP-PM set_wakeup_lat: Error: platform device "
> +		       "not valid\n");

comment should be 'Error: not an omap_device'.

> +		return -EINVAL;
> +	}
>  
> -	return 0;
> +	return ret;
>  }

Kevin

  reply	other threads:[~2011-03-17 20:18 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 17:47 [PATCH v2 0/7] OMAP: add PM CONSTRAINTS framework Jean Pihet
2011-03-10 17:47 ` Jean Pihet
2011-03-10 17:47 ` [PATCH v2 1/7] OMAP PM: create a PM layer plugin for per-device constraints Jean Pihet
2011-03-10 17:47   ` Jean Pihet
2011-03-10 17:47 ` [PATCH v2 2/7] OMAP: PM CONSTRAINTS: add an enum for the classes of constraint Jean Pihet
2011-03-10 17:47   ` Jean Pihet
2011-03-10 17:47 ` [PATCH v2 3/7] OMAP: PM CONSTRAINTS: implement wake-up latency constraints Jean Pihet
2011-03-10 17:47   ` Jean Pihet
2011-03-17 20:18   ` Kevin Hilman [this message]
2011-03-17 20:18     ` Kevin Hilman
2011-03-10 17:47 ` [PATCH v2 4/7] OMAP: PM CONSTRAINTS: implement the constraints management code Jean Pihet
2011-03-10 17:47   ` Jean Pihet
2011-03-17 20:36   ` Kevin Hilman
2011-03-17 20:36     ` Kevin Hilman
2011-03-18 11:33     ` Jean Pihet
2011-03-18 11:33       ` Jean Pihet
2011-03-18 15:06       ` Kevin Hilman
2011-03-18 15:06         ` Kevin Hilman
2011-03-10 17:47 ` [PATCH v2 5/7] OMAP: PM CONSTRAINTS: add a power domains state update function in hwmod Jean Pihet
2011-03-10 17:47   ` Jean Pihet
2011-03-17 20:42   ` Kevin Hilman
2011-03-17 20:42     ` Kevin Hilman
2011-03-10 17:47 ` [PATCH v2 6/7] OMAP: PM CONSTRAINTS: control power domains next state Jean Pihet
2011-03-10 17:47   ` Jean Pihet
2011-03-17 20:58   ` Kevin Hilman
2011-03-17 20:58     ` Kevin Hilman
2011-03-10 17:47 ` [PATCH v2 7/7] OMAP: PM CONSTRAINTS: add power domains wake-up latency figures Jean Pihet
2011-03-10 17:47   ` Jean Pihet
2011-03-17 20:59   ` Kevin Hilman
2011-03-17 20:59     ` Kevin Hilman

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=87r5a5zeji.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=j-pihet@ti.com \
    --cc=jean.pihet@newoldbits.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.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.