cpuidle: coupled: disable interrupts after entering safe state
authorColin Cross <ccross@android.com>
Fri, 23 Aug 2013 19:45:10 +0000 (12:45 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 29 Aug 2013 20:11:38 +0000 (22:11 +0200)
Calling cpuidle_enter_state is expected to return with interrupts
enabled, but interrupts must be disabled before starting the
ready loop synchronization stage.  Call local_irq_disable after
each call to cpuidle_enter_state for the safe state.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/coupled.c

index 2a297f86dbad25be5f17e0f41029e92dd23afeaf..db92bcbe69461e404ea036025663ecfa49d5b6ce 100644 (file)
@@ -460,6 +460,7 @@ int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
                }
                entered_state = cpuidle_enter_state(dev, drv,
                        dev->safe_state_index);
+               local_irq_disable();
        }
 
        /* Read barrier ensures online_count is read after prevent is cleared */
@@ -485,6 +486,7 @@ retry:
 
                entered_state = cpuidle_enter_state(dev, drv,
                        dev->safe_state_index);
+               local_irq_disable();
        }
 
        if (cpuidle_coupled_clear_pokes(dev->cpu)) {