lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 07 Oct 2011 09:39:25 +0200
From:	Johannes Berg <johannes@...solutions.net>
To:	Antonio Ospite <ospite@...denti.unina.it>
Cc:	Richard Purdie <rpurdie@...ys.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] leds: turn the blink_timer off before starting to
 blink

On Thu, 2011-10-06 at 22:03 +0000, Antonio Ospite wrote:
> Depending on the implementation of the hardware blinking function in
> blink_set(), the led can support hardware blinking for some values of
> delay_on and delay_off and fall-back to software blinking for some other
> values.
> 
> Turning off the blink_timer unconditionally before starting to blink
> make sure that a sequence like:
> 
>   OFF
>   hardware blinking
>   software blinking
>   hardware blinking
> 
> does not leave the software blinking timer active.
> 
> Signed-off-by: Antonio Ospite <ospite@...denti.unina.it>
> ---
>  drivers/leds/led-class.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
> index 939f24a..a7f0b29 100644
> --- a/drivers/leds/led-class.c
> +++ b/drivers/leds/led-class.c
> @@ -266,6 +266,8 @@ void led_blink_set(struct led_classdev *led_cdev,
>                    unsigned long *delay_on,
>                    unsigned long *delay_off)
>  {
> +       del_timer_sync(&led_cdev->blink_timer);
> +
>         if (led_cdev->blink_set &&
>             !led_cdev->blink_set(led_cdev, delay_on, delay_off)) {
>                 led_cdev->blink_delay_on = *delay_on;

Makes sense, good catch!

Reviewed-by: Johannes Berg <johannes@...solutions.net>

johannes

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ