Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp928942ybc; Tue, 19 Nov 2019 11:33:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzojHDrTeWjZq95Z3tiJmCMGCfwM2Ql4CaK5kfQ/i601Vw7Ei4/laAP7T6mB64y42CERXe0 X-Received: by 2002:a17:906:d0c8:: with SMTP id bq8mr37457543ejb.263.1574192037801; Tue, 19 Nov 2019 11:33:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574192037; cv=none; d=google.com; s=arc-20160816; b=ukuKnklNHnl/9sAzgCTFi3ic4PGTNBCU9YSmnXEhAlDjC3ltPR1fsvkd2yATrrDFW0 CitPfP3b8HRujchEyAXVtSKjiSk/kDYfp81yZB11+cAGgOXXcv8I8ALGNFnzNM8KY0tt uN3sRBVIViXBgLBrgi8eWYJ1LBkoBL41ue+/l3soZY9UjUtdwVVfeg2fvQCnkO8QT4qm xDA62ms0hhwDm+ih4yw4b7xlvvNxYGZZZAOHN18rGYEDn29CfTpXa1VYsiOPagjkjYdp KQxKeqDNQHUlaG5JkCTrpFtv06CoXJ+I90yY1Ay0d1Bzi0xpTNE+y2adyeqCRadHT7t9 VMJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=atgCQq6D206yrKTfApmYtmm3QS5gK6YModY6x30k2BE=; b=H8lNjzxl4qmQOwaodvCLHmKOYMX2AD4vhZ50HbrfgSbSlxGdHLmYRVQZTxdjGhHvCo QgH2cKyvljVFHJPYPD4sysk3Ld2FhjhFd1hNrv0zDD8LysUpypP233Rzlm00tbMt4EfQ DgAXrfpOJl38Xl3Ze/89uLA43gXzuvVLAbjVCeW7OUD1tCiLne9uYjQdlDW6nfylhLJK TbktX81HClH7mYDqbzZn9uXPKVp22Q9PFUARszisUWMYfozAtc/m5SvTEFnOMQvCSkAg /lgVN0XfI+L2FebxZ+hhW2o7jmXHkbWSUH5Dk5h2BxHJW8gW4JHhP1X1QvjuHESm+E08 3u7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gTJsgzCL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s23si14471056eju.55.2019.11.19.11.33.33; Tue, 19 Nov 2019 11:33:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gTJsgzCL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727702AbfKSTbd (ORCPT + 99 others); Tue, 19 Nov 2019 14:31:33 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36109 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727316AbfKSTax (ORCPT ); Tue, 19 Nov 2019 14:30:53 -0500 Received: by mail-wm1-f67.google.com with SMTP id c22so5182853wmd.1; Tue, 19 Nov 2019 11:30:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=atgCQq6D206yrKTfApmYtmm3QS5gK6YModY6x30k2BE=; b=gTJsgzCLOkSX2EH25Zd90WuQpbaViFmzsK+VFs3NpiACe+7qRIOb/Gm1ZLyvLeP4FK tLXXc/iN9Ph9cQBUdCHBWsW9Ccoot4Nm8eWF7DRlh9VeU1uOfmBVhC62HM9phwZj5tV/ zSRARy+Z2XFUl0a7Tf4rRJPIXRmXzHDEH+evzHhE3JaLV6PLbdH1OZDCRHk6T8MvVZVo TLvx4+d/ldZrxZ8faC2KZpXoIorMSASRHZmtQ4e8iIe7b0CkgK1m03FNNEqxmlMdcXXC 8pJr7s5fFX0+mXpgYpvgYw59G9ZOtvstjP1Q80UNIJNxe4sikHstFYaXglBmriu737jq AoOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=atgCQq6D206yrKTfApmYtmm3QS5gK6YModY6x30k2BE=; b=pzNbBHGfMAZQPlEZUDTGW7uyuxbKskOYh0mB4sSuWDqvtTTosY/4FzlX7BBBq/29LH Ymd0+UinZII2FA+O2hfpyeRSg5lryCX1DUUiW5hAu6drJU5wkRVmzItxmqrWn5eNK41i tLEzCFpSiht4LzfTP3z+flklD+VzmiBong9Jb0ZNcL6TMKidtPIS2I8S+fifmt7p+InU OCzF60pboRqvevmseD4zx5x/vVEaPfSEjySmg+LPj2fi7bmfKTemfL/p9009nsUyjP/6 zCgWen/Q2brA2nN1diBQXZ3sQbpWFH7fWErCNWfHkD3ek+YCelNBR43GrOP5iT74UfI/ u33g== X-Gm-Message-State: APjAAAXM2VTkJd7oDqiI7HLE6zd+5ikxPrNovBZynUIBqCAXfjtZromk R5FlGq8HkZIyS9UswXwaaEgSZfJQGn8= X-Received: by 2002:a7b:c4c8:: with SMTP id g8mr7386540wmk.36.1574191848892; Tue, 19 Nov 2019 11:30:48 -0800 (PST) Received: from [192.168.1.19] (chs184.neoplus.adsl.tpnet.pl. [83.31.16.184]) by smtp.gmail.com with ESMTPSA id c4sm28732282wrp.86.2019.11.19.11.30.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Nov 2019 11:30:48 -0800 (PST) Subject: Re: [PATCH v5 15/16] leds: Add common LED binding parsing support to LED class/core To: "Vaittinen, Matti" , "mazziesaccount@gmail.com" Cc: "corbet@lwn.net" , "linux-doc@vger.kernel.org" , "phil.edworthy@renesas.com" , "linux-rtc@vger.kernel.org" , "dmurphy@ti.com" , "linux-leds@vger.kernel.org" , "jeffrey.t.kirsher@intel.com" , "linux-gpio@vger.kernel.org" , "mchehab+samsung@kernel.org" , "alexandre.belloni@bootlin.com" , "linux-kernel@vger.kernel.org" , "mturquette@baylibre.com" , "lgirdwood@gmail.com" , "devicetree@vger.kernel.org" , "wsa+renesas@sang-engineering.com" , "linus.walleij@linaro.org" , "a.zummo@towertech.it" , "m.szyprowski@samsung.com" , "mark.rutland@arm.com" , "robh+dt@kernel.org" , "linux-clk@vger.kernel.org" , "hkallweit1@gmail.com" , "bgolaszewski@baylibre.com" , "hofrat@osadl.org" , "lee.jones@linaro.org" , "pavel@ucw.cz" , "broonie@kernel.org" , "sboyd@kernel.org" References: <258b5c9934e2b31a5f433a7dbb908dfe5da3d30c.1574059625.git.matti.vaittinen@fi.rohmeurope.com> <745e427d-819e-12d7-5c94-7a8d1a414956@gmail.com> <4c03b7cec4d4417ba3c60b9d8a333ddd4cfa79ac.camel@fi.rohmeurope.com> From: Jacek Anaszewski Autocrypt: addr=jacek.anaszewski@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFWjfaEBEADd66EQbd6yd8YjG0kbEDT2QIkx8C7BqMXR8AdmA1OMApbfSvEZFT1D/ECR eWFBS8XtApKQx1xAs1j5z70k3zebk2eeNs5ahxi6vM4Qh89vBM46biSKeeX5fLcv7asmGb/a FnHPAfQaKFyG/Bj9V+//ef67hpjJWR3s74C6LZCFLcbZM0z/wTH+baA5Jw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vWpQHLeLfCZqGxAAlWBWVvjU6xj70GwengiqYZwmW1i8gfS4TNibQT/KRq0zkBnE wgKwXRbVoW38pYVuGa5x/JDQMJDrLAJ0wrCOS3XxbSHCWOl/k2ZD9OaxUeXq6N+OmGTzfrYv PUvWS1Hy04q9AD1dIaMNruZQmvnRfkOk2UDncDIg0166/NTHiYI09H5mpWGpHn/2aT6dmpVw uoM9/rHlF5s5qAAo95tZ0QW2BtIceG9/rbYlL57waSMPF49awvwLQX5RhWoF8mPS5LsBrXXK hmizIsn40tLbi2RtWjzDWgZYitqmmqijeCnDvISN4qJ/nCLO4DjiSGs59w5HR+l0nwePDhOC A4RYZqS1e2Clx1VSkDXFpL3egabcIsqK7CZ6a21r8lXVpo4RnMlQsmXZTnRx4SajFvX7PrRg /02C811fLfh2r5O5if8sKQ6BKKlHpuuioqfj/w9z3B0aQ71e4n1zNJBO1kcdznikPLAbr7jG gkBUXT1yJiwpTfRQr5y2Uo12IJsKxohnNFVYtK8X/R6S0deKPjrZWvAkllgIPcHjMi2Va8yw KTj/JgcpUO5KN906Pf7ywZISe7Kbcc/qnE0YjPPSqFOvoeZvHe6EZCMW9+xZsaipvlqpByQV UHnVg09K9YFvjUBsBPdC8ef6YwgfR9o6AnPmxl0oMUIXkCCC5c99fzJY/k8= Message-ID: Date: Tue, 19 Nov 2019 20:30:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <4c03b7cec4d4417ba3c60b9d8a333ddd4cfa79ac.camel@fi.rohmeurope.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matti, On 11/19/19 8:21 AM, Vaittinen, Matti wrote: > Hello Jacek, > > On Mon, 2019-11-18 at 22:55 +0100, Jacek Anaszewski wrote: >> Hi Matti, >> >> Thank you for the patch. If your driver does not depend >> on it then please send is separately. > > The BD71828 depends on device-tree node look-up. It does not utilize > the common property parsing. I could of course do the child dt-node > walking in BD71828 driver - but it kind of breaks my motivation to do > the LED core improvement if I anyways need to do the parsing in BD71828 > driver ;) If you do not plan on spending too much time on contributing this set then I propose adhering to the currently used parsing schema :-) And you have to know that from this development cycle I handed over LED tree maintenance to Pavel Machek, so you will require to have his acceptance in the first place. >> Besides, we would require >> to convert many of current LED drivers to verify how the >> proposed parsing mechanism will work with them. > > I see the risk you are pointing out. And I actually think we could > default to old mechanism if of_match or match_property is not given > (for now). I could then see the existing drivers who use init_data - > and ensure those are initializing the new match_property and of_match > in init_data with 0. That would be quite trivial task. > > That would allow us to convert and test existing drivers one-by-one > while allowing new drivers to offload the LED node look-up and common > property parsing to LED core. No risk, but less drivers to convert in > the future - and simpler drivers to maintain when all of them do not > need to duplicate node look-up or basic property parsing ;) I personally would prefer to do the massive driver update to using the new mechanism. I know that this is time consuming but we are not in a hurry. > To make this more concrete: > > We can only do the new DT node look-up if either > if (init_data->match_property.name && init_data->match_property.size) > or > if (init_data->of_match) > That would keep the node-lookup same for all existing drivers. > > Eg, > led_find_fwnode could for now just do: > > struct fwnode_handle *led_find_fwnode(struct device *parent, > struct led_init_data *init_data) > { > /* > * This should never be called W/O init data. > */ > if (!init_data) > return NULL; > > /* > * For old drivers which do not populate new match information > * just directly use the given init_data->fwnode no matter if > * it is NULL or not. - as old functionality did. > */ > if ( (!init_data->match_property.name || > !init_data->match_property.size) && !init_data->of_match) > return init_data->fwnode; > > /* match information was given - do node look-up */ > ... > } > > Furthermore, the common property parsing could also be (for now) done > only if match data is given: > > /* > * For now only allow core to parse DT properties if > * parsing is explicitly requested by driver or if core has > * found new match data from init_data and then set the flag > */ > if (INVENT_A_COOL_NEW_FLAG_NAME_HERE) > led_add_props(led_cdev, &props); > > or just simply: > if ((init_data->match_property.name && > init_data->match_property.size) || init_data->of_match) > led_add_props(led_cdev, &props); > > (but this won't allow driver to ask for common parsing even if it was > verified for this drv to work - hence I like the flag better) > > And if you don't feel confident I can even drop the "common property > parsing" from the series and leave only the "node look-up if match-data > was given" to it. > > Anyways, I would like to introduce this support while I am working with > the BD71828 driver which really has the LEDs - but I can modify the > patch series so that it only impacts to drivers which implement the new > match data in init_data and leave old drivers to be converted one-by- > one when they can be tested. > >> I've been testing >> my LED name composition series using QEMU and stubbing things in >> drivers where necessary and I propose to use the same approach >> in this case. > > I don't plan to do any mass-conversion as it is somewhat risky. I can You do not need hardware to test DT parsing as I mentioned before, so I don't see too much risk involved. > do conversion to some of the drivers (simple ones which I can > understand without too much of pain) - and ask if anyone having access > to actual HW with LEDs could be kind enough to test the patch for the > device. Tested drivers can then be taken in-tree as examples. And who > knows, maybe there is some developers looking for a hobby project with > access to LED controller to help with the rest ;) I don't have the > ambition to change all of the LED drivers but I think I can give my 10 > cents by contributing the mechanism and doing few examples :) If you want to introduce good, robust mechanism, then it should be tested against widest possible spectrum of use cases. > Anyways, please let me know if you think you could accept patch which > won't change existing driver functionality - but allows new drivers to > not duplicate the code. Else I'll just duplicate the lookup code in one > more driver and hope I don't have another PMIC with LED controller on > my table too soon... > > (I am having "some" pressure to do few other tasks I recently got. So I > am afraid I won't have too much time to invest on LEDs this year :( > Thus setting up the qemu and starting with stubbing is really not an > option for me at this phase). As mentioned before - I no longer apply patches so you will need to consult Pavel, but I bet he will have similar opinion. -- Best regards, Jacek Anaszewski