tick/broadcast: Prevent deep idle if no broadcast device available
authorThomas Gleixner <tglx@linutronix.de>
Tue, 7 Jul 2015 14:34:32 +0000 (16:34 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 7 Jul 2015 16:46:47 +0000 (18:46 +0200)
Add a check for a installed broadcast device to the oneshot control
function and return busy if not.

[ Split out from a larger combo patch ]

Reported-and-tested-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Suzuki Poulose <Suzuki.Poulose@arm.com>
Cc: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
Cc: Catalin Marinas <Catalin.Marinas@arm.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1507070929360.3916@nanos
kernel/time/tick-broadcast.c

index ef77b16ad5df21673dbddff948c45f32384ebedd..fad3f789beecb02979e92378eec2d3d63d96db6d 100644 (file)
@@ -692,6 +692,13 @@ int __tick_broadcast_oneshot_control(enum tick_broadcast_state state)
        int cpu, ret = 0;
        ktime_t now;
 
+       /*
+        * If there is no broadcast device, tell the caller not to go
+        * into deep idle.
+        */
+       if (!tick_broadcast_device.evtdev)
+               return -EBUSY;
+
        /*
         * Periodic mode does not care about the enter/exit of power
         * states