public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: j.anaszewski@samsung.com (Jacek Anaszewski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] leds: trigger: Introduce a kernel panic LED trigger
Date: Wed, 30 Mar 2016 11:29:14 +0200	[thread overview]
Message-ID: <56FB9C6A.2090402@samsung.com> (raw)
In-Reply-To: <1459283749-22451-2-git-send-email-ezequiel@vanguardiasur.com.ar>

Hi Ezequiel,

Thanks for the patch. I've tested it on exynos4412-trats2 board
with leds-aat1290 driver, by executing:

echo "c" > /proc/sysrq-trigger

I was able to notice the blinking then.

Applied to the for-next branch of linux-leds.git.

Thanks,
Jacek Anaszewski

On 03/29/2016 10:35 PM, Ezequiel Garcia wrote:
> This commit introduces a new LED trigger which allows to configure
> a LED to blink on a kernel panic (through panic_blink).
>
> Notice that currently the Openmoko FreeRunner (GTA02) mach code
> sets panic_blink to blink a hard-coded LED. The new trigger is
> meant to introduce a generic mechanism to achieve this.
>
> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
> ---
>   drivers/leds/trigger/Kconfig         |  7 +++++++
>   drivers/leds/trigger/Makefile        |  1 +
>   drivers/leds/trigger/ledtrig-panic.c | 30 ++++++++++++++++++++++++++++++
>   3 files changed, 38 insertions(+)
>   create mode 100644 drivers/leds/trigger/ledtrig-panic.c
>
> diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
> index 5bda6a9b56bb..554f5bfbeced 100644
> --- a/drivers/leds/trigger/Kconfig
> +++ b/drivers/leds/trigger/Kconfig
> @@ -108,4 +108,11 @@ config LEDS_TRIGGER_CAMERA
>   	  This enables direct flash/torch on/off by the driver, kernel space.
>   	  If unsure, say Y.
>
> +config LEDS_TRIGGER_PANIC
> +	bool "LED Panic Trigger"
> +	depends on LEDS_TRIGGERS
> +	help
> +	  This allows LEDs to be configured to blink on a kernel panic.
> +	  If unsure, say Y.
> +
>   endif # LEDS_TRIGGERS
> diff --git a/drivers/leds/trigger/Makefile b/drivers/leds/trigger/Makefile
> index 1abf48dacf7e..547bf5c80e52 100644
> --- a/drivers/leds/trigger/Makefile
> +++ b/drivers/leds/trigger/Makefile
> @@ -8,3 +8,4 @@ obj-$(CONFIG_LEDS_TRIGGER_CPU)		+= ledtrig-cpu.o
>   obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON)	+= ledtrig-default-on.o
>   obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT)	+= ledtrig-transient.o
>   obj-$(CONFIG_LEDS_TRIGGER_CAMERA)	+= ledtrig-camera.o
> +obj-$(CONFIG_LEDS_TRIGGER_PANIC)	+= ledtrig-panic.o
> diff --git a/drivers/leds/trigger/ledtrig-panic.c b/drivers/leds/trigger/ledtrig-panic.c
> new file mode 100644
> index 000000000000..627b350c5ec3
> --- /dev/null
> +++ b/drivers/leds/trigger/ledtrig-panic.c
> @@ -0,0 +1,30 @@
> +/*
> + * Kernel Panic LED Trigger
> + *
> + * Copyright 2016 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/leds.h>
> +
> +static struct led_trigger *trigger;
> +
> +static long led_panic_blink(int state)
> +{
> +	led_trigger_event(trigger, state ? LED_FULL : LED_OFF);
> +	return 0;
> +}
> +
> +static int __init ledtrig_panic_init(void)
> +{
> +	led_trigger_register_simple("panic", &trigger);
> +	panic_blink = led_panic_blink;
> +	return 0;
> +}
> +device_initcall(ledtrig_panic_init);

  reply	other threads:[~2016-03-30  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 20:35 [PATCH 0/3] Add a new LED trigger for kernel panics (and use it) Ezequiel Garcia
2016-03-29 20:35 ` [PATCH 1/3] leds: trigger: Introduce a kernel panic LED trigger Ezequiel Garcia
2016-03-30  9:29   ` Jacek Anaszewski [this message]
2016-03-30 19:11     ` Ezequiel Garcia
2016-03-31  7:04       ` Jacek Anaszewski
2016-03-31  7:28         ` Jacek Anaszewski
2016-03-31 12:56       ` Holger Schurig
2016-03-29 20:35 ` [PATCH 2/3] ARM: configs: Enable panic LED trigger on s3c2410 Ezequiel Garcia
2016-03-29 20:35 ` [PATCH 3/3] ARM: s3c24xx: Use the panic LED trigger for GTA02 Ezequiel Garcia
2016-03-29 20:44 ` [PATCH 0/3] Add a new LED trigger for kernel panics (and use it) Arnd Bergmann

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=56FB9C6A.2090402@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.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