ANDROID: cpuidle: Allow for an early exit from cpuidle_enter_state()

Vendor hook may modify index to negative to force an early
exit from idle entry. Add support for the same.

Bug: 192436062
Bug: 195914333
Change-Id: I82b822296d06b122e3f154b2c8af2128136023d5
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
This commit is contained in:
Maulik Shah 2021-06-30 19:22:58 +05:30
parent 0fd079285d
commit 132d8ef617
1 changed files with 3 additions and 0 deletions

View File

@ -212,6 +212,9 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
* broadcast must be assigned after the vendor hook. * broadcast must be assigned after the vendor hook.
*/ */
trace_android_vh_cpu_idle_enter(&index, dev); trace_android_vh_cpu_idle_enter(&index, dev);
if (index < 0)
return index;
target_state = &drv->states[index]; target_state = &drv->states[index];
broadcast = !!(target_state->flags & CPUIDLE_FLAG_TIMER_STOP); broadcast = !!(target_state->flags & CPUIDLE_FLAG_TIMER_STOP);