[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170127182333.GB24047@wotan.suse.de>
Date: Fri, 27 Jan 2017 19:23:34 +0100
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: "Luis R. Rodriguez" <mcgrof@...nel.org>,
Greg KH <gregkh@...uxfoundation.org>,
Ming Lei <ming.lei@...onical.com>,
Borislav Petkov <bp@...en8.de>, Daniel Wagner <wagi@...om.org>,
Tom Gundersen <teg@...m.no>,
Mauro Carvalho Chehab <mchehab@....samsung.com>,
Rafał Miłecki <zajec5@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Vikram Mulukutla <markivx@...eaurora.org>,
Stephen Boyd <stephen.boyd@...aro.org>,
Mark Brown <broonie@...nel.org>,
Mimi Zohar <zohar@...ux.vnet.ibm.com>,
Takashi Iwai <tiwai@...e.de>,
Johannes Berg <johannes@...solutions.net>,
Christian Lamparter <chunkeey@...glemail.com>,
Hauke Mehrtens <hauke@...ke-m.de>,
Josh Boyer <jwboyer@...oraproject.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
David Woodhouse <dwmw2@...radead.org>,
Jiri Slaby <jslaby@...e.com>,
Andy Lutomirski <luto@...capital.net>,
Wu Fengguang <fengguang.wu@...el.com>,
Richard Purdie <rpurdie@...ys.net>,
Jacek Anaszewski <j.anaszewski@...sung.com>,
Abhay_Salunke@...l.com, Julia Lawall <Julia.Lawall@...6.fr>,
Gilles.Muller@...6.fr, nicolas.palix@...g.fr,
David Howells <dhowells@...hat.com>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
arend.vanspriel@...adcom.com, Kalle Valo <kvalo@...eaurora.org>
Subject: Re: [PATCH v4 3/3] p54: convert to sysdata API
On Thu, Jan 26, 2017 at 01:54:20PM -0800, Linus Torvalds wrote:
> On Thu, Jan 26, 2017 at 1:50 PM, Luis R. Rodriguez <mcgrof@...nel.org> wrote:
> >
> > OK I've added a respective helper call which would map 1-1 with the
> > old sync mechanism to enable a 1-1 change, this will be called
> > driver_data_request_simple(), but let me know if there is a preference
> > for something else.
>
> So just looking at this patch, what's the *advantage* to the driver writer?
So for the driver writer it provides a clean way to logically split up what is
to be done for certain situations if the firmware is not present or is present.
Without this the code is a bit unruly, and this is actually a mild case. There
are much crazier chained conditionals (iwlwifi is one that has a long chain of
firmwares) but a goal here was to just provide only the most basic bump in
logic so that further enhancements/functionality is added later.
> Apart from the actual new feature, this patch seems to actively make
> the driver uglier.
>
> I mentioned this before, but replacing "request_firmware()" with
> "driver_data_request_simple()" is SIMPLY NOT AN IMPROVEMENT.
I strongly agree with this.
> The new name is longer and _less_ descriptive.
>
> So I'm really not seeing why you want to make these conversions that
> just make code worse.
The real goal here was first to actually provide a flexible API to enable
more advanced features to be added without having to affect existing
callers, as has been done before. So hence the const struct driver_data_req_params
approach and only two basic calls -- a sync and async call. This was after long ago we
had revised how we would go about adding firmware signing support to the kernel.
My first approach in addressing firmware signing was to mimic how we handle
have module signing: everyone gets it (even those on the old API), using one
default key. The flexible API was then a secondary step, to enable users to
customize signature requirements. As we discussed things it was clear that we
wanted the ability to support firmware signing with the ability to provide
alternative key requirements from the very start. Having an extensible firmware API
in place first would enable the flexibility to let us decide what requirements
we want to put in place for firmware signing without concern for making a slew
of collateral evolutions as requirements change.
The flexible API then would be, as is in this series, completely optional.
Only if you want to reap benefit of some of the new features would you use it.
So unless the flexible API is reproachable in and of itself perhaps the thing
to do is leave all drivers as-is (without no conversion) and only convert
once we have a full gain value-add. For instance later adding support to easily
chain a series of firmware requests (not just 2), or once we have firmware
signing support and a driver want to reap benefit from it.
Thoughts ?
Luis
Powered by blists - more mailing lists