Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754057AbbHSOD0 (ORCPT ); Wed, 19 Aug 2015 10:03:26 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:51156 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752614AbbHSODY (ORCPT ); Wed, 19 Aug 2015 10:03:24 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-26-55d48ca86e1a Message-id: <55D48CA7.1030504@samsung.com> Date: Wed, 19 Aug 2015 16:03:19 +0200 From: Jacek Anaszewski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-version: 1.0 To: Andrew Lunn Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, cooloney@gmail.com, rpurdie@rpsys.net, stsp@users.sourceforge.net, Sakari Ailus , Pavel Machek Subject: Re: [PATCH/RFC v5 01/57] leds: Add brightness_set_nonblocking op References: <1439285890-27329-1-git-send-email-j.anaszewski@samsung.com> <1439285890-27329-2-git-send-email-j.anaszewski@samsung.com> <20150813141547.GB32484@lunn.ch> <55CD9F7F.4020706@samsung.com> In-reply-to: <55CD9F7F.4020706@samsung.com> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNLMWRmVeSWpSXmKPExsVy+t/xq7ore66EGjxdymhx/u4hZoujOycy WVzeNYfNYuubdYwWd08dZbPYvespq8WnLd+YLDr7prE4cHjsnHWX3WPeyUCPnTs+M3nsmf+D 1WPF6u/sHk2n2lk9Pm+SC2CP4rJJSc3JLEst0rdL4MqYff4gW8F2iYrOL/NZGhjXCXcxcnBI CJhItB/M6mLkBDLFJC7cW8/WxcjFISSwlFHi6d4JUM4zRompN++xg1TxCmhJzL9zCMxmEVCV +LX8NRuIzSZgKPHzxWsmEFtUIELiz+l9rBD1ghI/Jt9jAbFFBBQkppz8wwoylFngLKPEnhef wBqEBTwlvs1Ywg6x7SSjROOtlWAbOAW0JeYv/Qq2gVnAWmLlpG2MELa8xOY1b5knMArMQrJk FpKyWUjKFjAyr2IUTS1NLihOSs811CtOzC0uzUvXS87P3cQIiYIvOxgXH7M6xCjAwajEwztj 2+VQIdbEsuLK3EOMEhzMSiK8txKuhArxpiRWVqUW5ccXleakFh9ilOZgURLnnbvrfYiQQHpi SWp2ampBahFMlomDU6qBcYl7zcVvHw9/qFufwnbUXqU5OqZ2YcwezWc5WQsZ1y1pWP9oo8Rv hT2Hj7w1Knyef7AhTtH+3Pu0V2srPzkGp0WIxJ6fxfclzH9X4B0Xl5IS7n6B+YZFvmzrfp2u OHLMXvO/gkPwzi3Ht15780n6R6amit5X7mUXj70QXVore+dOfMMGw/uX3imxFGckGmoxFxUn AgD5dxhyfgIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3298 Lines: 79 On 08/14/2015 09:57 AM, Jacek Anaszewski wrote: > H Andrew, > > On 08/13/2015 04:15 PM, Andrew Lunn wrote: >> On Tue, Aug 11, 2015 at 11:37:14AM +0200, Jacek Anaszewski wrote: >>> This patch adds a new brightness_set_nonblocking op to the LED >>> subsystem. >>> The op is intended for drivers that set brightness in a non-blocking >>> way, >>> i.e. they neither sleep nor use delays while setting brightness. >>> >>> Signed-off-by: Jacek Anaszewski >>> Cc: Bryan Wu >>> Cc: Andrew Lunn >>> Cc: Sakari Ailus >>> Cc: Pavel Machek >>> Cc: Stas Sergeev >>> --- >>> include/linux/leds.h | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/include/linux/leds.h b/include/linux/leds.h >>> index b122eea..c32f1b8 100644 >>> --- a/include/linux/leds.h >>> +++ b/include/linux/leds.h >>> @@ -53,6 +53,9 @@ struct led_classdev { >>> /* Must not sleep, use a workqueue if needed */ >>> void (*brightness_set)(struct led_classdev *led_cdev, >>> enum led_brightness brightness); >>> + /* Intended for drivers that set brightness in a non-blocking >>> way */ >>> + void (*brightness_set_nonblocking)(struct led_classdev *led_cdev, >>> + enum led_brightness brightness); >> >> Hi Jacek >> >>> From an API design point of view, i'm not sure this is the best way to >> go. You now have two calls which do the same thing, with the plan that >> you want to invert the meaning of brightness_set, the old well known >> API call, sometime later. This inverting the meaning is going to catch >> people out and introduce bugs. >> >> I would rather add a brightness_set_blocking op. Then as you go >> thought the drivers stripping out the work queue, move the driver to >> use this brightness_set_blocking. > > There are around 60 drivers in the other kernel subsystems that register > LED class devices. If we chose the way you proposed then we would have > to adjust all of them to the LED core changes, which could complicate > the situation during merge window if there were other modifications in > the affected drivers. > > With my approach all old-fashion drivers will be treated by the > LED core in the old-fashion way. This is why I introduced > LED_BRIGHTNESS_BLOCKING flag - only drivers aware of the LED core > changes will set it, which will allow for the LED core to find out > which drivers are aware of brightness_set semantics change and > implement the op accordingly. > > This way the change of brightness_set semantics will not be painful. > > After all drivers across all subsystems are adapted to the LED core > changes the flag will be made redundant and we will remove it. > Hi Andrew, Pavel and others, Do you have any comments to my explanation? It would be great if we could merge this during upcoming merge window, but I'd like to obtain some acks for the LED core part beforehand. -- 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/