Paul,

On Sun, Jan 29, 2012 at 3:38 PM, Paul Walmsley <[email protected]> wrote:
>
> Hi Jean
>
> Quick question on the tracing in _pwrdm_state_switch().
>
> That section of the code reads:
>
>        state = pwrdm_read_pwrst(pwrdm);
>
> ...
>
>        case PWRDM_STATE_PREV:
>                prev = pwrdm_read_prev_pwrst(pwrdm);
>                if (pwrdm->state != prev)
>                        pwrdm->state_counter[prev]++;
>                if (prev == PWRDM_POWER_RET)
>                        _update_logic_membank_counters(pwrdm);
>                /*
>                 * If the power domain did not hit the desired state,
>                 * generate a trace event with both the desired and hit states
>                 */
>                if (state != prev) {
>                        trace_state = (PWRDM_TRACE_STATES_FLAG |
>                                       ((state & OMAP_POWERSTATE_MASK) << 8) |
>                                       ((prev & OMAP_POWERSTATE_MASK) << 0));
>                        trace_power_domain_target(pwrdm->name, trace_state,
>                                                  smp_processor_id());
>                }
>
> This code is called after returning from WFI.  It appears to compare the
> powerdomain's current power state ('state') with the powerdomain's
> previous power state ('prev').  But it appears to me that it should
> instead compare the powerdomain's intended power state ('pwrdm->state')
> with 'prev' ?  The rationale is that the PRCM could have brought that
> powerdomain up to a higher power state than 'pwrdm->state' during the
> wakeup process.
>
> What do you think?
>
You are right. 'state' is the current power state and not the intended
power state.
Infact the value cashed in the power domain structure is an intended state and
that should be compared with previous state same way as the counter code
is doing.

Regards
Santosh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to