public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Walle <bwalle@suse.de>
To: Andi Kleen <ak@suse.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Indan Zupancic <indan@nul.nu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Stephen Hemminger <shemminger@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: blink driver power saving
Date: Mon, 2 Jul 2007 14:56:18 +0200	[thread overview]
Message-ID: <20070702125618.GA18987@suse.de> (raw)
In-Reply-To: <200707021439.27357.ak@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

* Andi Kleen <ak@suse.de> [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

[-- Attachment #2: add_setledstate_global --]
[-- Type: text/plain, Size: 1082 bytes --]

---
 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

  reply	other threads:[~2007-07-02 12:56 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-02 11:43 blink driver power saving Indan Zupancic
2007-07-02 11:51 ` Andi Kleen
2007-07-02 12:29   ` Indan Zupancic
2007-07-02 12:31   ` Dmitry Torokhov
2007-07-02 12:39     ` Andi Kleen
2007-07-02 12:56       ` Bernhard Walle [this message]
2007-07-02 13:42       ` Dmitry Torokhov
2007-07-02 13:43         ` Dmitry Torokhov
2007-07-02 20:19           ` Bernhard Walle
2007-07-04 21:47           ` Pavel Machek
2007-07-05  5:25             ` Dmitry Torokhov
2007-07-02 23:08       ` Pavel Machek
2007-07-03  5:42         ` Dmitry Torokhov
2007-07-04 21:40           ` Pavel Machek
2007-07-04 21:57           ` Pavel Machek
2007-07-04 22:11           ` Pavel Machek
2007-07-05  5:38             ` Dmitry Torokhov
2007-07-12  9:10               ` Pavel Machek
2007-07-13  0:42                 ` Jiri Kosina
2007-07-04 22:32           ` Pavel Machek
2007-07-04 22:46             ` Linus Torvalds
2007-07-04 22:59               ` Pavel Machek
     [not found]                 ` <alpine.LFD.0.98.0707041610530.9434@woody.linux-foundation.org>
2007-07-04 23:20                   ` Pavel Machek
2007-07-03  7:12         ` Bernhard Walle
2007-07-04 19:37           ` Pavel Machek
2007-07-05 20:30             ` Bill Davidsen
     [not found] <8CaWr-2o4-19@gated-at.bofh.it>
     [not found] ` <8Cfjl-PJ-33@gated-at.bofh.it>
     [not found]   ` <8CfW1-1TX-23@gated-at.bofh.it>
     [not found]     ` <8ChEo-4yy-1@gated-at.bofh.it>
2007-07-02 13:11       ` Bodo Eggert
  -- strict thread matches above, loose matches on Subject: below --
2007-07-01 16:50 Stephen Hemminger
2007-07-01 18:07 ` Linus Torvalds
2007-07-01 21:29   ` Andi Kleen
2007-07-01 22:14     ` Linus Torvalds
2007-07-01 23:59       ` Andi Kleen
2007-07-02 15:51         ` Linus Torvalds
2007-07-02 16:59           ` Alan Cox
2007-07-02 17:50         ` Stephen Hemminger
2007-07-02 19:03           ` Dmitry Torokhov
2007-07-02 19:08           ` Andi Kleen
2007-07-02 23:18             ` Pavel Machek
2007-07-01 21:26 ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070702125618.GA18987@suse.de \
    --to=bwalle@suse.de \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=indan@nul.nu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox