Re: [PATCH 1/2] led: core: Use atomic bit-field for the blink-flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

On 10/25/2016 09:01 AM, Jacek Anaszewski wrote:
On 10/24/2016 10:43 PM, Jacek Anaszewski wrote:
Hi Hans,

Thanks for the patch.

On 10/23/2016 09:47 PM, Hans de Goede wrote:
All the LED_BLINK* flags are accessed read-modify-write from e.g.
led_set_brightness and led_blink_set_oneshot while both
set_brightness_work and the blink_timer may be running.

[...]

diff --git a/include/linux/leds.h b/include/linux/leds.h
index eebcd8c..cff9df7 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -43,16 +43,13 @@ struct led_classdev {
 #define LED_UNREGISTERING    (1 << 1)
     /* Upper 16 bits reflect control information */
 #define LED_CORE_SUSPENDRESUME    (1 << 16)
-#define LED_BLINK_SW        (1 << 17)
-#define LED_BLINK_ONESHOT    (1 << 18)
-#define LED_BLINK_ONESHOT_STOP    (1 << 19)
-#define LED_BLINK_INVERT    (1 << 20)
-#define LED_BLINK_BRIGHTNESS_CHANGE (1 << 21)
-#define LED_BLINK_DISABLE    (1 << 22)
-#define LED_SYSFS_DISABLE    (1 << 23)
-#define LED_DEV_CAP_FLASH    (1 << 24)
-#define LED_HW_PLUGGABLE    (1 << 25)
-#define LED_PANIC_INDICATOR    (1 << 26)
+#define LED_SYSFS_DISABLE    (1 << 17)
+#define LED_DEV_CAP_FLASH    (1 << 18)
+#define LED_HW_PLUGGABLE    (1 << 19)
+#define LED_PANIC_INDICATOR    (1 << 20)
+
+    /* set_brightness_work / blink_timer flags, atomic, private. */
+    unsigned long        work_flags;

LED_BLINK_SW is now modified in ledtrig-heartbeat.c [0], so it'd have
to remain visible outside of LED subsystem.

Are you OK with leaving the flags in leds.h, changed to identifiers?
If so, then I can submit version 2.

I'll do the suitable fixup to patch [0] and will reorder the patches
when this one is applied.

Of course not this one, but its updated version, that leaves the
flags in leds.h. I didn't express myself accurately above.


--
Best regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux