mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@novell.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add keyboard blink driver
Date: Thu, 12 Apr 2007 21:28:08 +0200	[thread overview]
Message-ID: <200704122128.08869.ak@novell.com> (raw)
In-Reply-To: <20070412121028.d7e5c4b6.akpm@linux-foundation.org>

On Thursday 12 April 2007 21:10:28 Andrew Morton wrote:
> On Thu, 12 Apr 2007 17:27:27 +0200
> Andi Kleen <ak@novell.com> wrote:
> 
> > Add a blink driver for debugging
> > 
> > Simple driver that blinks the keyboard LEDs when loaded. Useful
> > for checking that the kernel is still alive or for crashdumping.
> > The kdump kernel currently typically doesn't give any feedback
> > on the screen because it often cannot reinitialize the graphics
> > state. This patch allows it to at least show blinking lights
> > like panic.
> 
> OK..
> 
> > --- /dev/null
> > +++ linux/drivers/misc/blink.c
> > @@ -0,0 +1,26 @@
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/timer.h>
> > +#include <linux/jiffies.h>
> > +
> > +static void do_blink(unsigned long data);
> > +
> > +static DEFINE_TIMER(blink_timer, do_blink, 0 ,0);
> > +
> > +static void do_blink(unsigned long data)
> > +{
> > +	static long count;
> > +	panic_blink(count++);
> > +	blink_timer.expires = jiffies + msecs_to_jiffies(1);
> > +	add_timer(&blink_timer);
> > +}
> > +
> > +static int blink_init(void)
> > +{
> > +	printk(KERN_INFO "Enabling keyboard blinking\n");
> > +	do_blink(0);
> > +	return 0;
> > +}
> > +
> > +module_init(blink_init);
> 
> panic_blink is NULL in lots of setups.  `modprobe blink' will be deadly.

Oops sorry -- i must somehow have sent an old patch. I had fixed this of course
Ahh, quilt refresh was missing.

See the new patch.
 
> I wonder if this facility would be more effective if it were to use
> schedule_delayed_work().  That way, we're using more of the kernel and it
> will more reliably detect kernel deadness.
 
Hmm, maybe

-Andi

Add a blink driver for debugging

Simple driver that blinks the keyboard LEDs when loaded. Useful
for checking that the kernel is still alive or for crashdumping

Signed-off-by: Andi Kleen <ak@suse.de>

---
 drivers/misc/Kconfig  |    9 +++++++++
 drivers/misc/Makefile |    1 +
 drivers/misc/blink.c  |   26 ++++++++++++++++++++++++++
 3 files changed, 36 insertions(+)

Index: linux-2.6.21-rc6-test/drivers/misc/Kconfig
===================================================================
--- linux-2.6.21-rc6-test.orig/drivers/misc/Kconfig
+++ linux-2.6.21-rc6-test/drivers/misc/Kconfig
@@ -122,4 +122,13 @@ config SONY_LAPTOP
 
 	  Read <file:Documentation/sony-laptop.txt> for more information.
 
+config BLINK
+	tristate "Keyboard blink driver"
+	help
+	  Driver that when loaded will blink the keyboard LEDs continuously.
+	  This is useful for debugging and for kernels that cannot necessarily
+	  output something to the screen like kexec kernels to give the user
+	  a visual indication that the kernel is doing something.
+
+
 endmenu
Index: linux-2.6.21-rc6-test/drivers/misc/Makefile
===================================================================
--- linux-2.6.21-rc6-test.orig/drivers/misc/Makefile
+++ linux-2.6.21-rc6-test/drivers/misc/Makefile
@@ -12,3 +12,4 @@ obj-$(CONFIG_TIFM_CORE)       	+= tifm_c
 obj-$(CONFIG_TIFM_7XX1)       	+= tifm_7xx1.o
 obj-$(CONFIG_SGI_IOC4)		+= ioc4.o
 obj-$(CONFIG_SONY_LAPTOP)	+= sony-laptop.o
+obj-$(CONFIG_BLINK)		+= blink.o
Index: linux-2.6.21-rc6-test/drivers/misc/blink.c
===================================================================
--- /dev/null
+++ linux-2.6.21-rc6-test/drivers/misc/blink.c
@@ -0,0 +1,27 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/timer.h>
+#include <linux/jiffies.h>
+
+static void do_blink(unsigned long data);
+
+static DEFINE_TIMER(blink_timer, do_blink, 0 ,0);
+
+static void do_blink(unsigned long data)
+{
+	static long count;
+	if (panic_blink)
+		panic_blink(count++);
+	blink_timer.expires = jiffies + msecs_to_jiffies(1);
+	add_timer(&blink_timer);
+}
+
+static int blink_init(void)
+{
+	printk(KERN_INFO "Enabling keyboard blinking\n");
+	do_blink(0);
+	return 0;
+}
+
+module_init(blink_init);
+

  reply	other threads:[~2007-04-12 19:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 15:27 Andi Kleen
2007-04-12 19:10 ` Andrew Morton
2007-04-12 19:28   ` Andi Kleen [this message]
2007-04-12 19:37     ` Andrew Morton
2007-04-18 12:11 ` Pavel Machek

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=200704122128.08869.ak@novell.com \
    --to=ak@novell.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®