All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Charulatha V <charu@ti.com>
Cc: linux-omap@vger.kernel.org, tony@atomide.com, paul@pwsan.com
Subject: Re: [PATCH 2/5] OMAP: GPIO: use pwrdmn name to find wkup dmn GPIO
Date: Fri, 04 Mar 2011 13:51:03 -0800	[thread overview]
Message-ID: <8762ryftbs.fsf@ti.com> (raw)
In-Reply-To: <1298890670-5481-3-git-send-email-charu@ti.com> (Charulatha V.'s message of "Mon, 28 Feb 2011 16:27:47 +0530")

Charulatha V <charu@ti.com> writes:

> In omap3, save/restore context is implemented for GPIO
> banks 2-6 as GPIO bank1 is in wakeup domain. Instead
> of identifying bank's power domain by bank id, make use
> of powerdomain name itself.
>
> For this, omap_hwmod_get_pwrdm() is used. omap_device_get_pwrdm()
> could not be used as the pwrdm information needs to be filled
> in pdata. But omap_device_get_pwrdm() can be used only after
> omap_device_build() call.
>
> Signed-off-by: Charulatha V <charu@ti.com>
>
> Tested-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
> (2430-SDP testing)

I like the idea of this change, but not the implementation...

[...]

> @@ -1865,16 +1867,15 @@ static int workaround_enabled;
>  void omap2_gpio_prepare_for_idle(int off_mode)
>  {
>  	int i, c = 0;
> -	int min = 0;
>  
> -	if (cpu_is_omap34xx())
> -		min = 1;
> -
> -	for (i = min; i < gpio_bank_count; i++) {
> +	for (i = 0; i < gpio_bank_count; i++) {
>  		struct gpio_bank *bank = &gpio_bank[i];
>  		u32 l1 = 0, l2 = 0;
>  		int j;
>  
> +		if (!strcmp(bank->pwrdm_name, "wkup_pwrdm"))
> +			continue;
> +

This adds a string compare for every bank during every idle
transistion (and every resume.)  That's a lot of unneeded overhead.

I'd rather see a per-bank flag 'looses_context' or something that can be
checked more efficiently in this fast path.  This flag can be set based
on the powerdomain name in the device init code.

Kevin

  reply	other threads:[~2011-03-04 21:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28 10:57 [PATCH 0/5] OMAP: GPIO: use PM runtime framework Charulatha V
2011-02-28 10:57 ` [PATCH 1/5] OMAP: GPIO: make gpio_context part of gpio_bank structure Charulatha V
2011-02-28 10:57 ` [PATCH 2/5] OMAP: GPIO: use pwrdmn name to find wkup dmn GPIO Charulatha V
2011-03-04 21:51   ` Kevin Hilman [this message]
2011-03-05  5:21     ` Varadarajan, Charulatha
2011-03-07 18:56       ` Kevin Hilman
2011-03-08  2:25         ` Paul Walmsley
2011-03-08  5:45           ` Varadarajan, Charulatha
2011-02-28 10:57 ` [PATCH 3/5] OMAP4: GPIO: save/restore context Charulatha V
2011-02-28 10:57 ` [PATCH 4/5] OMAP: GPIO: call save/restore ctxt from GPIO driver Charulatha V
2011-03-04 22:20   ` Kevin Hilman
2011-03-05  5:15     ` Varadarajan, Charulatha
2011-02-28 10:57 ` [PATCH 5/5] OMAP: GPIO: use PM runtime framework Charulatha V
2011-03-04 22:59   ` Kevin Hilman
2011-03-05  5:10     ` Varadarajan, Charulatha
2011-03-07 18:55       ` Kevin Hilman
2011-03-08 15:05         ` Varadarajan, Charulatha
2011-03-08 18:23           ` Kevin Hilman
2011-03-09  1:24             ` Varadarajan, Charulatha
2011-03-09 10:23               ` Varadarajan, Charulatha

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=8762ryftbs.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=charu@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.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.