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] [day] [month] [year] [list]
Message-ID: <5839241e-e69e-40ea-9a6a-da2ff291117e@gmail.com>
Date:   Sun, 6 Nov 2016 14:49:06 +0100
From:   Jacek Anaszewski <jacek.anaszewski@...il.com>
To:     Jacek Anaszewski <j.anaszewski@...sung.com>,
        linux-leds@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org,
        Fabio Baltieri <fabio.baltieri@...il.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Pavel Machek <pavel@....cz>, Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH 2/2] leds: core: Remove delayed_set_value property from
 struct led_classdev

Withdrawing this patch as it breaks restoring brightness
on resume.

Thanks,
Jacek Anaszewski

On 10/05/2016 12:03 PM, Jacek Anaszewski wrote:
> delayed_set_value property was introduced in the commit
> d23a22a74fde ("leds: delay led_set_brightness if stopping soft-blink").
> Its aim was to allow calling led_set_brightness() from hard irq context
> when soft blinking is enabled. Later LED core refactoring preserved
> the property, although in an ineffective way. That bug was harmless
> because in the new approach brightness setting is deferred until the
> next timer tick when software blinking is enabled.
>
> Since LED brightness is assigned immediately in
> led_set_brightness_nosleep() or through struct led_classdev's
> blink_brightness while soft blinking is enabled, then
> delayed_set_value is no longer required.
>
> Signed-off-by: Jacek Anaszewski <j.anaszewski@...sung.com>
> Cc: Fabio Baltieri <fabio.baltieri@...il.com>
> Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>
> Cc: Pavel Machek <pavel@....cz>
> Cc: Andrew Lunn <andrew@...n.ch>
> ---
>  drivers/leds/led-core.c | 8 ++++----
>  include/linux/leds.h    | 1 -
>  2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
> index 3bce448..2d0c75a 100644
> --- a/drivers/leds/led-core.c
> +++ b/drivers/leds/led-core.c
> @@ -107,15 +107,15 @@ static void set_brightness_delayed(struct work_struct *ws)
>  	int ret = 0;
>
>  	if (led_cdev->flags & LED_BLINK_DISABLE) {
> -		led_cdev->delayed_set_value = LED_OFF;
> +		led_cdev->brightness = LED_OFF;
>  		led_stop_software_blink(led_cdev);
>  		led_cdev->flags &= ~LED_BLINK_DISABLE;
>  	}
>
> -	ret = __led_set_brightness(led_cdev, led_cdev->delayed_set_value);
> +	ret = __led_set_brightness(led_cdev, led_cdev->brightness);
>  	if (ret == -ENOTSUPP)
>  		ret = __led_set_brightness_blocking(led_cdev,
> -					led_cdev->delayed_set_value);
> +					led_cdev->brightness);
>  	if (ret < 0 &&
>  	    /* LED HW might have been unplugged, therefore don't warn */
>  	    !(ret == -ENODEV && (led_cdev->flags & LED_UNREGISTERING) &&
> @@ -260,7 +260,7 @@ void led_set_brightness_nopm(struct led_classdev *led_cdev,
>  		return;
>
>  	/* If brightness setting can sleep, delegate it to a work queue task */
> -	led_cdev->delayed_set_value = value;
> +	led_cdev->brightness = value;
>  	schedule_work(&led_cdev->set_brightness_work);
>  }
>  EXPORT_SYMBOL_GPL(led_set_brightness_nopm);
> diff --git a/include/linux/leds.h b/include/linux/leds.h
> index ddfcb2d..52993de 100644
> --- a/include/linux/leds.h
> +++ b/include/linux/leds.h
> @@ -92,7 +92,6 @@ struct led_classdev {
>  	void			(*flash_resume)(struct led_classdev *led_cdev);
>
>  	struct work_struct	set_brightness_work;
> -	int			delayed_set_value;
>
>  #ifdef CONFIG_LEDS_TRIGGERS
>  	/* Protects the trigger data below */
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ