Charulatha V <ch...@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 <ch...@ti.com>
>
> Tested-by: Tarun Kanti DebBarma <tarun.ka...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to