Re: blink driver power saving



* Andi Kleen <ak@xxxxxxx> [2007-07-02 14:39]:

Another option would be for it not use panic_blink. Do your kexec
kernels have atkbd support enabled? You could write an new "blink"
input handler that would latch to keyboards supporting leds and blink
by sending EV_LED events.

Yes that would be probably a better implementation. Also hook something
for USB keyboards. iirc Bernhard Walle (cc'ed) was looking at that.

The problem is that most distributions use USB as module (in initrd,
or later). If you're able to load modules, you're also able to run a
userspace programs that blinks. That's the way I implemented it in
SUSE now. In my tests it takes about < 5 seconds from the sysrq-c to
the time the first blink. That's ok IMO.

And if a person compiles his kernel manually, he doesn't need keyboard
LED blinking for kdump because he can look at the HDD LED to see what
happens (or serial console). ... :)

I don't know if it's worth to apply a patch that uses the keyboard
interface in the kernel, because there are several small changes
necessary (see patch, that's what my thought was).


Thanks,
Bernhard
---
drivers/char/keyboard.c | 7 +++++++
include/linux/keyboard.h | 7 +++++++
2 files changed, 14 insertions(+)

Index: linux-2.6.21.1/drivers/char/keyboard.c
===================================================================
--- linux-2.6.21.1.orig/drivers/char/keyboard.c
+++ linux-2.6.21.1/drivers/char/keyboard.c
@@ -956,6 +956,13 @@ void setledstate(struct kbd_struct *kbd,
set_leds();
}

+void setledstate_fgconsole(unsigned int led)
+{
+ struct kbd_struct *kbd = kbd_table + fg_console;
+ setledstate(kbd, led);
+}
+EXPORT_SYMBOL_GPL(setledstate_fgconsole);
+
static inline unsigned char getleds(void)
{
struct kbd_struct *kbd = kbd_table + fg_console;
Index: linux-2.6.21.1/include/linux/keyboard.h
===================================================================
--- linux-2.6.21.1.orig/include/linux/keyboard.h
+++ linux-2.6.21.1/include/linux/keyboard.h
@@ -441,4 +441,11 @@ extern unsigned short plain_map[NR_KEYS]
#define NR_BRL 9

#define MAX_DIACR 256
+
+
+
+#ifdef __KERNEL__
+void setledstate_fgconsole(unsigned int led);
+#endif
+
#endif


Relevant Pages

  • Re: [SLE] repeated boot problem
    ... >> crash and blink the leds. ... Did you update the kernel. ... there were some thing mentioned on the SDB. ...
    (SuSE)
  • Re: blink driver power saving
    ... blink is equivalent to "annoy me" and it ... I was expecting to ... It does not reflect the true device hierarchy - LEDs are not children ... LEDs will stop working if input device is grabbed via EVIOCSGRAB. ...
    (Linux-Kernel)
  • Re: [PATCH 2/2] leds:arch/sh/boards/landisk LEDs supports
    ... This allows LEDs to be controlled by a programmable timer. ... "blink" blinks LED at a constant cycle. ... "bitshift" turns LED or Buzzer on and off by the value of pattern. ... As far as I can tell, the existing timer trigger can do everything the ...
    (Linux-Kernel)
  • Blinking LED with C18
    ... but the LED doesn't blink or even come on. ... void delay (void) ... /* Make all bits on the Port B (LEDs) output bits. ...
    (sci.electronics.basics)
  • N00b question about DCM
    ... figure out how to use the DCM to double the freq ... I wrote a small verilog program to blink LEDs 0-3 ...
    (comp.arch.fpga)

Loading