diff mbox

[RESEND,1/2] drivers: macintosh: rack-meter: limit idle ticks to total ticks

Message ID 1460318028-28056-1-git-send-email-aaro.koskinen@iki.fi (mailing list archive)
State Accepted
Headers show

Commit Message

Aaro Koskinen April 10, 2016, 7:53 p.m. UTC
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>
---
 drivers/macintosh/rack-meter.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Ellerman April 13, 2016, 1:33 p.m. UTC | #1
On Sun, 2016-10-04 at 19:53:47 UTC, Aaro Koskinen wrote:
> 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>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c796d1d97c3035cf54d4d5a9e7

cheers
diff mbox

Patch

diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index caaec65..ba7e330 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -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,