mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	"Ming Lei" <ming.lei@canonical.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Daniel Wagner" <wagi@monom.org>, "Tom Gundersen" <teg@jklm.no>,
	"Mauro Carvalho Chehab" <mchehab@osg.samsung.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Vikram Mulukutla" <markivx@codeaurora.org>,
	"Stephen Boyd" <stephen.boyd@linaro.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Mimi Zohar" <zohar@linux.vnet.ibm.com>,
	"Takashi Iwai" <tiwai@suse.de>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Christian Lamparter" <chunkeey@googlemail.com>,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Josh Boyer" <jwboyer@fedoraproject.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"David Woodhouse" <dwmw2@infradead.org>,
	"Jiri Slaby" <jslaby@suse.com>,
	"Andy Lutomirski" <luto@amacapital.net>,
	"Wu Fengguang" <fengguang.wu@intel.com>,
	"Richard Purdie" <rpurdie@rpsys.net>,
	"Jacek Anaszewski" <j.anaszewski@samsung.com>,
	Abhay_Salunke@dell.com, "Julia Lawall" <Julia.Lawall@lip6.fr>,
	Gilles.Muller@lip6.fr, nicolas.palix@imag.fr,
	"David Howells" <dhowells@redhat.com>,
	"Bjorn Andersson" <bjorn.andersson@linaro.org>,
	arend.vanspriel@broadcom.com, "Kalle Valo" <kvalo@codeaurora.org>
Subject: Re: [PATCH v4 3/3] p54: convert to sysdata API
Date: Fri, 27 Jan 2017 19:23:34 +0100	[thread overview]
Message-ID: <20170127182333.GB24047@wotan.suse.de> (raw)
In-Reply-To: <CA+55aFwZNZcBjjh2Mxo+_5q6y7hKoenqsUQLfaspTuOEAB=0qQ@mail.gmail.com>

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@kernel.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

  reply	other threads:[~2017-01-27 18:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 11:46 [PATCH v3 0/4] firmware: add drvdata API Luis R. Rodriguez
2016-12-16 11:46 ` [PATCH v3 1/4] firmware: add new extensible firmware API - drvdata Luis R. Rodriguez
2016-12-16 11:46 ` [PATCH v3 2/4] test: add new drvdata loader tester Luis R. Rodriguez
2016-12-16 11:46 ` [PATCH v3 3/4] x86/microcode: convert to use sysdata API Luis R. Rodriguez
2016-12-16 11:46 ` [PATCH v3 4/4] p54: convert to " Luis R. Rodriguez
2016-12-16 17:14   ` Luis R. Rodriguez
2017-01-12 15:02 ` [PATCH v4 0/3] firmware: add drvdata API Luis R. Rodriguez
2017-01-12 15:02   ` [PATCH v4 1/3] firmware: add new extensible firmware API - drvdata Luis R. Rodriguez
2017-01-19 11:36     ` Greg KH
2017-01-19 16:54       ` Luis R. Rodriguez
2017-01-19 18:58     ` Bjorn Andersson
2017-02-03 21:56       ` Luis R. Rodriguez
2017-01-12 15:02   ` [PATCH v4 2/3] test: add new drvdata loader tester Luis R. Rodriguez
2017-01-12 15:02   ` [PATCH v4 3/3] p54: convert to sysdata API Luis R. Rodriguez
2017-01-16 11:32     ` Christian Lamparter
2017-01-19 11:38     ` Greg KH
2017-01-19 16:27       ` Luis R. Rodriguez
2017-01-26 21:50         ` Luis R. Rodriguez
2017-01-26 21:54           ` Linus Torvalds
2017-01-27 18:23             ` Luis R. Rodriguez [this message]
2017-01-27 20:53               ` Linus Torvalds
2017-01-27 21:34                 ` Luis R. Rodriguez
2017-01-27  7:47           ` Greg KH
2017-01-27 11:25             ` Rafał Miłecki
2017-01-27 14:07               ` Greg KH
2017-01-27 14:14                 ` Rafał Miłecki
2017-01-27 14:30                   ` Greg KH
2017-01-27 14:39                     ` Rafał Miłecki
2017-01-27 21:27                       ` Luis R. Rodriguez
2017-02-07  1:08   ` [PATCH v5 0/2] firmware: add driver data API Luis R. Rodriguez
2017-02-07  1:08     ` [PATCH v5 1/2] firmware: add extensible " Luis R. Rodriguez
2017-02-07  1:08     ` [PATCH v5 2/2] test: add new driver_data load tester Luis R. Rodriguez
2017-02-10 14:31     ` [PATCH v5 0/2] firmware: add driver data API Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170127182333.GB24047@wotan.suse.de \
    --to=mcgrof@kernel.org \
    --cc=Abhay_Salunke@dell.com \
    --cc=Gilles.Muller@lip6.fr \
    --cc=Julia.Lawall@lip6.fr \
    --cc=arend.vanspriel@broadcom.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=bp@alien8.de \
    --cc=broonie@kernel.org \
    --cc=chunkeey@googlemail.com \
    --cc=dhowells@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=fengguang.wu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hauke@hauke-m.de \
    --cc=j.anaszewski@samsung.com \
    --cc=johannes@sipsolutions.net \
    --cc=jslaby@suse.com \
    --cc=jwboyer@fedoraproject.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=markivx@codeaurora.org \
    --cc=mchehab@osg.samsung.com \
    --cc=ming.lei@canonical.com \
    --cc=nicolas.palix@imag.fr \
    --cc=rpurdie@rpsys.net \
    --cc=stephen.boyd@linaro.org \
    --cc=teg@jklm.no \
    --cc=tiwai@suse.de \
    --cc=torvalds@linux-foundation.org \
    --cc=wagi@monom.org \
    --cc=zajec5@gmail.com \
    --cc=zohar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®