Re: [PATCH 2/5] OMAP: GPIO: use pwrdmn name to find wkup dmn GPIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

>
> 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


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux