Merge branches 'ib-mfd-gpio-i2c-3.19', 'ib-mfd-iio-3.19' and 'ib-mfd-regulator-v3...
[cascardo/linux.git] / kernel / sched / idle.c
index 11e7bc4..c47fce7 100644 (file)
@@ -147,6 +147,9 @@ use_default:
            clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu))
                goto use_default;
 
+       /* Take note of the planned idle state. */
+       idle_set_state(this_rq(), &drv->states[next_state]);
+
        /*
         * Enter the idle state previously returned by the governor decision.
         * This function will block until an interrupt occurs and will take
@@ -154,6 +157,9 @@ use_default:
         */
        entered_state = cpuidle_enter(drv, dev, next_state);
 
+       /* The cpu is no longer idle or about to enter idle. */
+       idle_set_state(this_rq(), NULL);
+
        if (broadcast)
                clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);