public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Jean Pihet <jean.pihet@newoldbits.com>
Cc: Linux PM mailing list <linux-pm@lists.linux-foundation.org>,
	linux-omap@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
	Paul Walmsley <paul@pwsan.com>,
	magnus.damm@gmail.com, Todd Poynor <toddpoynor@google.com>,
	Jean Pihet <j-pihet@ti.com>
Subject: Re: [PATCH 3/8] OMAP2+: powerdomain: control power domains next state
Date: Fri, 16 Sep 2011 11:27:49 -0700	[thread overview]
Message-ID: <871uvgnxzu.fsf@ti.com> (raw)
In-Reply-To: <1314969204-21704-4-git-send-email-j-pihet@ti.com> (Jean Pihet's message of "Fri, 2 Sep 2011 15:13:19 +0200")

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

> When a PM QoS device latency constraint is requested or removed the
> PM QoS layer notifies the underlying layer with the updated aggregated
> constraint value. The constraint is stored in the powerdomain constraints
> list and then applied to the corresponding power domain.
> The power domains get the next power state programmed directly in the
> registers via pwrdm_wakeuplat_update_pwrst.
>
> Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using
> wake-up latency constraints on MPU, CORE and PER.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>

[...]

> @@ -191,6 +198,77 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
>  	return 0;
>  }
>  
> +/**
> + * pwrdm_wakeuplat_update_pwrst - Update power domain power state if needed
> + * @pwrdm: struct powerdomain * to which requesting device belongs to.
> + * @min_latency: the allowed wake-up latency for the given power domain. A
> + *  value of PM_QOS_DEV_LAT_DEFAULT_VALUE means 'no constraint' on the pwrdm.
> + *
> + * Finds the power domain next power state that fulfills the constraint.
> + * Programs a new target state if it is different from current power state.
> + * The power domains get the next power state programmed directly in the
> + * registers.
> + *
> + * Returns 0 upon success.
> + */
> +static int pwrdm_wakeuplat_update_pwrst(struct powerdomain *pwrdm,
> +					long min_latency)
> +{
> +	int ret = 0, new_state = 0;
> +
> +	if (!pwrdm) {
> +		WARN(1, "powerdomain: %s: invalid parameter(s)", __func__);
> +		return -EINVAL;
> +	}
> +
> +	/*
> +	 * Apply constraints to power domains by programming
> +	 * the pwrdm next power state.
> +	 */
> +
> +	/* Find power state with wakeup latency < minimum constraint */
> +	for (new_state = 0x0; new_state < PWRDM_MAX_PWRSTS; new_state++) {
> +		if (min_latency == PM_QOS_DEV_LAT_DEFAULT_VALUE ||
> +		    pwrdm->wakeup_lat[new_state] <= min_latency)

Since min_latency is signed, this is a signed compare.  In later patches
you've defined the UNSUP_STATE to be -1, which will always be <=
min_latency whn using a signed compare.

So, won't this always end up picking the first state marked as
UNSUP_STATE?

> +			break;
> +	}

Kevin

  reply	other threads:[~2011-09-16 18:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 13:13 [PATCH 0/8] PM QoS: implement the OMAP low level constraints management code Jean Pihet
2011-09-02 13:13 ` [PATCH 1/8] OMAP: convert I2C driver to PM QoS for latency constraints Jean Pihet
2011-09-15 22:46   ` Kevin Hilman
2011-09-16 15:39     ` Jean Pihet
2011-09-16 16:06       ` Kevin Hilman
2011-09-02 13:13 ` [PATCH 2/8] OMAP: PM: create a PM layer plugin for per-device constraints Jean Pihet
2011-09-02 13:13 ` [PATCH 3/8] OMAP2+: powerdomain: control power domains next state Jean Pihet
2011-09-16 18:27   ` Kevin Hilman [this message]
2011-09-02 13:13 ` [PATCH 4/8] OMAP3: powerdomain data: add wake-up latency figures Jean Pihet
2011-09-02 13:13 ` [PATCH 5/8] OMAP2+: omap_hwmod: manage the wake-up latency constraints Jean Pihet
2011-09-02 13:13 ` [PATCH 6/8] OMAP: PM CONSTRAINTS: implement the devices " Jean Pihet
2011-09-15 23:47   ` Kevin Hilman
2011-09-16 15:43     ` Jean Pihet
2011-09-16 15:56       ` Kevin Hilman
2011-09-02 13:13 ` [PATCH 7/8] OMAP2+: cpuidle only influences the MPU state Jean Pihet
2011-09-02 13:13 ` [PATCH 8/8] OMAP3: update cpuidle latency and threshold figures Jean Pihet
2011-09-15  8:57 ` [PATCH 0/8] PM QoS: implement the OMAP low level constraints management code Jean Pihet
  -- strict thread matches above, loose matches on Subject: below --
2011-09-21 16:14 [PATCH v2 " Jean Pihet
2011-09-21 16:14 ` [PATCH 3/8] OMAP2+: powerdomain: control power domains next state Jean Pihet
2011-09-21 16:24 ` [PATCH v2 0/8] PM QoS: implement the OMAP low level constraints management code jean.pihet
2011-09-21 16:24   ` [PATCH 3/8] OMAP2+: powerdomain: control power domains next state jean.pihet
2011-10-12 15:24 [PATCH v3 0/8] PM QoS: implement the OMAP low level constraints management code jean.pihet
2011-10-12 15:24 ` [PATCH 3/8] OMAP2+: powerdomain: control power domains next state jean.pihet

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=871uvgnxzu.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=j-pihet@ti.com \
    --cc=jean.pihet@newoldbits.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=magnus.damm@gmail.com \
    --cc=paul@pwsan.com \
    --cc=rjw@sisk.pl \
    --cc=toddpoynor@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox