diff options
author | Helge Deller <deller@gmx.de> | 2009-01-06 08:23:13 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@mcmartin.ca> | 2009-03-30 22:51:34 -0400 |
commit | 8a1def457bab9f9654bd4dbb1e3eea6fedd26afa (patch) | |
tree | f0bff8d9f22ade7f80e30e66577e4f157846fcbd /drivers/parisc | |
parent | d75f054a2cf0614ff63d534ff21ca8eaab41e713 (diff) |
parisc: blink all or loadavg LEDs on oops
- depending on machine type, blink all leds or just the loadavg
leds twice a second on oops.
- cancel_rearming_delayed_workqueue() is obsolete,
use cancel_delayed_work_sync() instead
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'drivers/parisc')
-rw-r--r-- | drivers/parisc/led.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 454b6532e409..75ff6d78f002 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * (c) Copyright 2000 Red Hat Software | 4 | * (c) Copyright 2000 Red Hat Software |
5 | * (c) Copyright 2000 Helge Deller <hdeller@redhat.com> | 5 | * (c) Copyright 2000 Helge Deller <hdeller@redhat.com> |
6 | * (c) Copyright 2001-2005 Helge Deller <deller@gmx.de> | 6 | * (c) Copyright 2001-2009 Helge Deller <deller@gmx.de> |
7 | * (c) Copyright 2001 Randolph Chung <tausq@debian.org> | 7 | * (c) Copyright 2001 Randolph Chung <tausq@debian.org> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
@@ -463,9 +463,20 @@ static void led_work_func (struct work_struct *unused) | |||
463 | if (likely(led_lanrxtx)) currentleds |= led_get_net_activity(); | 463 | if (likely(led_lanrxtx)) currentleds |= led_get_net_activity(); |
464 | if (likely(led_diskio)) currentleds |= led_get_diskio_activity(); | 464 | if (likely(led_diskio)) currentleds |= led_get_diskio_activity(); |
465 | 465 | ||
466 | /* blink all LEDs twice a second if we got an Oops (HPMC) */ | 466 | /* blink LEDs if we got an Oops (HPMC) */ |
467 | if (unlikely(oops_in_progress)) | 467 | if (unlikely(oops_in_progress)) { |
468 | currentleds = (count_HZ<=(HZ/2)) ? 0 : 0xff; | 468 | if (boot_cpu_data.cpu_type >= pcxl2) { |
469 | /* newer machines don't have loadavg. LEDs, so we | ||
470 | * let all LEDs blink twice per second instead */ | ||
471 | currentleds = (count_HZ <= (HZ/2)) ? 0 : 0xff; | ||
472 | } else { | ||
473 | /* old machines: blink loadavg. LEDs twice per second */ | ||
474 | if (count_HZ <= (HZ/2)) | ||
475 | currentleds &= ~(LED4|LED5|LED6|LED7); | ||
476 | else | ||
477 | currentleds |= (LED4|LED5|LED6|LED7); | ||
478 | } | ||
479 | } | ||
469 | 480 | ||
470 | if (currentleds != lastleds) | 481 | if (currentleds != lastleds) |
471 | { | 482 | { |
@@ -511,7 +522,7 @@ static int led_halt(struct notifier_block *nb, unsigned long event, void *buf) | |||
511 | 522 | ||
512 | /* Cancel the work item and delete the queue */ | 523 | /* Cancel the work item and delete the queue */ |
513 | if (led_wq) { | 524 | if (led_wq) { |
514 | cancel_rearming_delayed_workqueue(led_wq, &led_task); | 525 | cancel_delayed_work_sync(&led_task); |
515 | destroy_workqueue(led_wq); | 526 | destroy_workqueue(led_wq); |
516 | led_wq = NULL; | 527 | led_wq = NULL; |
517 | } | 528 | } |
@@ -630,7 +641,7 @@ int lcd_print( const char *str ) | |||
630 | 641 | ||
631 | /* temporarily disable the led work task */ | 642 | /* temporarily disable the led work task */ |
632 | if (led_wq) | 643 | if (led_wq) |
633 | cancel_rearming_delayed_workqueue(led_wq, &led_task); | 644 | cancel_delayed_work_sync(&led_task); |
634 | 645 | ||
635 | /* copy display string to buffer for procfs */ | 646 | /* copy display string to buffer for procfs */ |
636 | strlcpy(lcd_text, str, sizeof(lcd_text)); | 647 | strlcpy(lcd_text, str, sizeof(lcd_text)); |