Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1211321
| From | Jacek Anaszewski <jacek.anaszewski@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH/RFC v6 05/36] leds: Improve setting brightness in a non sleeping way |
| Date | 2015-08-21 22:40 +0200 |
| Message-ID | <q01gu-66B-19@gated-at.bofh.it> (permalink) |
| References | <pZzkd-7Tp-3@gated-at.bofh.it> <pZzkf-7Tp-51@gated-at.bofh.it> <pZAJk-1B8-1@gated-at.bofh.it> <pZQO8-7UZ-39@gated-at.bofh.it> <pZYLE-2oU-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 08/21/2015 07:45 PM, Andrew Lunn wrote: > On Fri, Aug 21, 2015 at 11:22:33AM +0200, Jacek Anaszewski wrote: >> Hi Andrew, >> >> Thanks for the review. >> >> On 08/20/2015 06:09 PM, Andrew Lunn wrote: >>> On Thu, Aug 20, 2015 at 04:43:35PM +0200, Jacek Anaszewski wrote: >>>> This patch replaces led_set_brightness_async with >>>> led_set_brightness_nosleep in all places where the most vital was setting >>>> brightness in a non sleeping way but not necessarily asynchronously, which >>>> is not needed for non-blocking drivers. >>> >>> O.K, so i've lost the plot. _sync, _asymc, _nosleep, etc. Too many >>> changes without a clearly documented vision of what you are trying to >>> achieve. >>> >>> How about splitting this up into at least two patch sets. >>> >>> 1) Add the brightness_set_blocking op and the minimum of changes >>> needed to the core to make it work, and the driver changes taking out >>> the work queue. >> >> The minimum of changes needed includes harnessing existing >> set_brightness_work for setting brightness instead of the work queues >> in the drivers. > > I'm not sure that is the correct architecture. > > The work queue is in the class, not the core. So you need to define > the core API to not need this work queue. If we wanted to follow this logic then we should also ask if led_timer_function shouldn't be placed in the core too. set_brightness_work was introduced only because of out-of-tree user which called led_set_brightness from hard irq context, which caused problems related to locking between hard and softirq, when timer trigger was enabled. > What exactly is the core > API? What does it say about blocking and non-blocking, synchronous and > non-synchronous? The core API is everything in linux/leds.h not prefixed with led_classdev_, i.e functions for controlling brightness, blinking, and triggers. Until the addition of LED flash class extension things like sync/async, blocking/non_blocking weren't considered neither by the API, nor by documentation. There was only a comment over brightness_set op declaration, that it mustn't sleep. This requirement stems from the fact that some triggers, e.g. timer, set brightness from soft irq context. While implementing LED flash extension we noticed that LED subsystem doesn't provide a means for setting brightness synchronously, and we added led_set_brightness_sync API for this, SET_BRIGHTNESS_SYNC, and SET_BRIGHTNESS_ASYNC flags. Recently we agreed that this is not a driver that should decide about sync/async way of brightness setting, but the caller. That's why I am removing the flags and modifying the sync API. Actually I tried to tell this story in the commit messages of the patches making up my recent patch set. > Adding the work queue to the core is the quick and simple way of > removing it from the drivers. Maybe that is the way forward. You can > then later come back and sort out the core API and the class API, and > clean up the documentation. This work queue from led-class.c is used for setting brightness, when blink timer is on. Blinking is the functionality from the LED core, so the work queue should also belong to the core. It should be moved there along with led_timer_function, for consistency reasons. In view of the above, using it for setting brightness by blocking drivers would be correct from the architectural point of view. -- Best Regards, Jacek Anaszewski -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH/RFC v6 00/36] Remove work queues from LED class drivers Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 31/36] leds: mc13783: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 14/36] leds: bd2802: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 07/36] Documentation: leds: Add description of brightness_set* ops Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 02/36] leds: Add led_set_brightness_sync to the public LED subsystem API Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
Re: [PATCH/RFC v6 02/36] leds: Add led_set_brightness_sync to the public LED subsystem API Andrew Lunn <andrew@lunn.ch> - 2015-08-20 18:00 +0200
[PATCH/RFC v6 27/36] leds: da9052: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 01/36] leds: Add brightness_set_blocking op Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
Re: [PATCH/RFC v6 01/36] leds: Add brightness_set_blocking op Andrew Lunn <andrew@lunn.ch> - 2015-08-20 17:30 +0200
Re: [PATCH/RFC v6 01/36] leds: Add brightness_set_blocking op Pavel Machek <pavel@ucw.cz> - 2015-08-24 13:50 +0200
[PATCH/RFC v6 17/36] leds: lm3642: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 06/36] leds: Drivers shouldn't enforce SYNC/ASYNC brightness setting Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 34/36] leds: gpio: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 09/36] leds: aat1290: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 03/36] leds: Improve asynchronous path of setting brightness Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 16/36] leds: lm3533: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 36/36] leds: lm355x: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 08/36] leds: ktd2692: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 33/36] leds: wm8350: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 18/36] leds: pca9532: Remove work queue for LEDs. Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 13/36] leds: adp5520: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 05/36] leds: Improve setting brightness in a non sleeping way Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
Re: [PATCH/RFC v6 05/36] leds: Improve setting brightness in a non sleeping way Andrew Lunn <andrew@lunn.ch> - 2015-08-20 18:20 +0200
Re: [PATCH/RFC v6 05/36] leds: Improve setting brightness in a non sleeping way Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-21 11:30 +0200
Re: [PATCH/RFC v6 05/36] leds: Improve setting brightness in a non sleeping way Andrew Lunn <andrew@lunn.ch> - 2015-08-21 20:00 +0200
Re: [PATCH/RFC v6 05/36] leds: Improve setting brightness in a non sleeping way Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2015-08-21 22:40 +0200
Re: [PATCH/RFC v6 05/36] leds: Improve setting brightness in a non sleeping way Andrew Lunn <andrew@lunn.ch> - 2015-08-21 22:50 +0200
Re: [PATCH/RFC v6 05/36] leds: Improve setting brightness in a non sleeping way Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-24 10:20 +0200
[PATCH/RFC v6 12/36] leds: 88pm860x: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 21/36] leds: lp8788: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 29/36] leds: lt3593: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 30/36] leds: max8997: Remove unneeded workqueue include Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 10/36] leds: max77693: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 15/36] leds: blinkm: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 22/36] leds: lp8860: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 11/36] leds: tlc591xx: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 32/36] leds: regulator: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
Re: [PATCH/RFC v6 32/36] leds: regulator: Remove work queue Antonio Ospite <ao2@ao2.it> - 2015-08-21 09:50 +0200
[PATCH/RFC v6 19/36] leds: lp3944: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
Re: [PATCH/RFC v6 19/36] leds: lp3944: Remove work queue Antonio Ospite <ao2@ao2.it> - 2015-08-21 09:50 +0200
[PATCH/RFC v6 20/36] leds: lp55xx: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 04/36] leds: Add an internal led_set_brightness_nosleep function Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 35/36] leds: pwm: remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 16:50 +0200
[PATCH/RFC v6 28/36] leds: dac124d085: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 17:00 +0200
[PATCH/RFC v6 25/36] leds: wm831x: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 17:00 +0200
[PATCH/RFC v6 26/36] leds: da903x: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 17:00 +0200
[PATCH/RFC v6 24/36] leds: pca963x: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 17:00 +0200
[PATCH/RFC v6 23/36] leds: pca955x: Remove work queue Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-08-20 17:00 +0200
csiph-web