Re: heartbeat for leds on i2c bus

From: Atsushi Nemoto
Date: Mon Dec 03 2007 - 08:43:43 EST


On Mon, 3 Dec 2007 11:35:57 +0100, Rodolfo Giometti <giometti@xxxxxxxxxxxx> wrote:
> If I try to use the heartbeat trigger I hang the system... I suppose
> it is due the fact the led_set_brightness() function is called inside
> a kernel timer.
>
> How I can solve this problem? I thought to modify the trigger adding a
> kernel thread who manage the led which in turn is controlled by the
> kernel timer. It could be the right solution?

Yes, the heartbeat trigger driver assumes brightness_set() routine can
be called from timer. Other led-triggers also have this assumption.

So I'd suggest using workqueue for your led driver, as like as the
leds-gpio driver. Or you can just use the leds-gpio driver and
implement the gpio interface (gpio_set_value_cansleep) instead of the
led interface.

---
Atsushi Nemoto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/