]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drivers: macintosh: rack-meter: limit idle ticks to total ticks
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sun, 10 Apr 2016 19:53:47 +0000 (22:53 +0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 12 Apr 2016 11:05:20 +0000 (21:05 +1000)
Limit idle ticks to total ticks. This prevents the annoying rackmeter
leds fully ON / OFF blinking state that happens on fully idling
G5 Xserve systems.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/macintosh/rack-meter.c

index caaec654d7ea028e001c0bbdaee4bd01c3a2a292..ba7e330640fba82829bde860b8d5dc5b5acc18ec 100644 (file)
@@ -227,6 +227,7 @@ static void rackmeter_do_timer(struct work_struct *work)
 
        total_idle_ticks = get_cpu_idle_time(cpu);
        idle_ticks = (unsigned int) (total_idle_ticks - rcpu->prev_idle);
+       idle_ticks = min(idle_ticks, total_ticks);
        rcpu->prev_idle = total_idle_ticks;
 
        /* We do a very dumb calculation to update the LEDs for now,