"Varadarajan, Charulatha" <charu@xxxxxx> writes: > On Sat, Mar 5, 2011 at 02:21, Kevin Hilman <khilman@xxxxxx> wrote: >> Charulatha V <charu@xxxxxx> 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@xxxxxx> >>> >>> Tested-by: Tarun Kanti DebBarma <tarun.kanti@xxxxxx> >>> (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. > > This looks better. Will do the needful. > One question, can "looses_context" be made as part of dev_attr? I guess that's up to BenoÃt. But, I don't think that's necessary. It should be easy to set at runtime just doing a strcmp on the powerdomain during the device init, omap_device_build phase. Kevin -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html