Re: [PATCH v2] leds: fix led_brightness_set when soft-blinking

From: Fabio Baltieri
Date: Wed Jun 06 2012 - 15:10:18 EST


Hi Bryan,

On Wed, Jun 06, 2012 at 10:10:23PM +0800, Bryan Wu wrote:
> Yeah, that's right. Rafal's patch was in my fixes-for-3.5 branch, I
> will send out by this week for Linus. So I have to rebase all the
> for-next patches on top of it. Although I got conflicts, I will fix
> that. I prepared a new branch merged for-next and fixes-for-3.5
> together name devel, please help to test.
>
> http://git.kernel.org/?p=linux/kernel/git/cooloney/linux-leds.git;a=shortlog;h=refs/heads/devel

I realize now that my last patch broke ledtrig-timer updates as that
works by passing delay_{on,off} values by pointer, and moving
led_stop_software_blink() earlier destroy the other value.

That's a bit of a pitfall, as the old code was working because values
were copied when entering led_set_software_blink.

I see three options here:
- reverting back my leds: "fix led_brightness_set when soft-blinking"
(9b05cd0) to the first version I posted, wich should work as before.
- modify ledtrig-timer to use two internal variables to store delay_on
and delay_off instead of the led_cdev ones.
- moving the two led_cdev->blink_delay_xx = 0 only into
led_brightness_set, as that's the only place when they are needed.

What you think about it?

I think the third option is the best, as it removes the pitfall and
simplify the code a bit. I'll post that as a v3 "fix led_brightness_set
when soft-blinking", would you consider replacing the last patch you
applied in the new branch with the v3?

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