• Paul Burton's avatar
    cpuidle: delay enabling interrupts until all coupled CPUs leave idle · 0b89e9aa
    Paul Burton authored
    As described by a comment at the end of cpuidle_enter_state_coupled it
    can be inefficient for coupled idle states to return with IRQs enabled
    since they may proceed to service an interrupt instead of clearing the
    coupled idle state. Until they have finished & cleared the idle state
    all CPUs coupled with them will spin rather than being able to enter a
    safe idle state.
    
    Commits e1689795 "cpuidle: Add common time keeping and irq
    enabling" and 554c06ba "cpuidle: remove en_core_tk_irqen flag" led
    to the cpuidle_enter_state enabling interrupts for all idle states,
    including coupled ones, making this inefficiency unavoidable by drivers
    & the local_irq_enable near the end of cpuidle_enter_state_coupled
    redundant. This patch avoids enabling interrupts in cpuidle_enter_state
    after a coupled state has been entered, allowing them to remain disabled
    until all coupled CPUs have exited the idle state and
    cpuidle_enter_state_coupled re-enables them.
    
    Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
    Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    0b89e9aa
cpuidle.c 11.8 KB