linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: gregkh@linuxfoundation.org, ming.lei@canonical.com,
	daniel.wagner@bmw-carit.de, teg@jklm.no, mchehab@osg.samsung.com,
	zajec5@gmail.com, linux-kernel@vger.kernel.org,
	markivx@codeaurora.org, stephen.boyd@linaro.org,
	broonie@kernel.org, zohar@linux.vnet.ibm.com, tiwai@suse.de,
	johannes@sipsolutions.net, chunkeey@googlemail.com,
	hauke@hauke-m.de, jwboyer@fedoraproject.org,
	dmitry.torokhov@gmail.com, dwmw2@infradead.org, jslaby@suse.com,
	torvalds@linux-foundation.org, luto@amacapital.net,
	fengguang.wu@intel.com, rpurdie@rpsys.net,
	j.anaszewski@samsung.com, Abhay_Salunke@dell.com,
	Julia.Lawall@lip6.fr, Gilles.Muller@lip6.fr,
	nicolas.palix@imag.fr, dhowells@redhat.com,
	bjorn.andersson@linaro.org, arend.vanspriel@broadcom.com,
	kvalo@codeaurora.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation
Date: Fri, 16 Dec 2016 11:14:05 +0100	[thread overview]
Message-ID: <20161216101405.GA29069@amd> (raw)
In-Reply-To: <20161216095906.GS13946@wotan.suse.de>

[-- Attachment #1: Type: text/plain, Size: 2838 bytes --]

On Fri 2016-12-16 10:59:06, Luis R. Rodriguez wrote:
> On Fri, Dec 16, 2016 at 10:29:20AM +0100, Pavel Machek wrote:
> > On Fri 2016-12-16 10:22:41, Luis R. Rodriguez wrote:
> > > On Tue, Dec 13, 2016 at 08:04:29PM +0100, Pavel Machek wrote:
> > > > Hi!
> > > > 
> > > > > We need to ensure that when driver developers use the custom firmware
> > > > > fallback mechanism it was not a copy and paste bug. These use cases on
> > > > > upstream drivers are rare, we only have 2 upstream users and its for
> > > > > really old drivers. Since valid uses are rare but possible enable a
> > > > > white-list for its use, and use this same white-list annotation to refer
> > > > > to the documentation covering the custom use case.
> > > > 
> > > > > --- a/drivers/leds/leds-lp55xx-common.c
> > > > > +++ b/drivers/leds/leds-lp55xx-common.c
> > > > > @@ -219,6 +219,7 @@ static void lp55xx_firmware_loaded(const struct firmware *fw, void *context)
> > > > >  	release_firmware(chip->fw);
> > > > >  }
> > > > >  
> > > > > +DECLARE_FW_CUSTOM_FALLBACK("Documentation/leds/leds-lp55xx.txt");
> > > > >  static int lp55xx_request_firmware(struct lp55xx_chip *chip)
> > > > >  {
> > > > >  	const char *name = chip->cl->name;
> > > > 
> > > > The driver does:
> > > > 
> > > > static void lp55xx_firmware_loaded(const struct firmware *fw, void
> > > > *context)
> > > > {
> > > > 	struct lp55xx_chip *chip = context;
> > > > 	        struct device *dev = &chip->cl->dev;
> > > > 		        enum lp55xx_engine_index idx =
> > > > 			chip->engine_idx;
> > > > 
> > > >         if (!fw) {
> > > > 	                dev_err(dev, "firmware request failed\n");
> > > > 			                goto out;
> > > > 					     }
> > > >         ...
> > > > out:
> > > >         /* firmware should be released for other channel use */
> > > > 	        release_firmware(chip->fw);
> > > > }
> > > > 
> > > > 
> > > > Does that match the "custom fallback" definition?
> > > 
> > > Refer to the documentation I supplied, and also to the grammar rule, in
> > > particular the patch "firmware: add SmPL report for custom fallback mechanism",
> > > it captures the SmPL form for the custom fallback mechanism as:
> > 
> > I don't much care what the rule says. If you believe the code is
> > buggy, submit a patch.
> 
> Huh? No, its an old API and valid uses are scarce. The point is to avoid folks
> adding yet other users by mistake by using grammar to help white-list actual
> valid users.

Well, I was asking if the above snipped looks like valid use. Because
AFAICT, the "custom fallback" is just dev_err(), see above. Coccinelle
rules don't help me...
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2016-12-16 10:14 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  3:08 [PATCH 0/5] firmware: doc revamp Luis R. Rodriguez
2016-12-13  3:08 ` [PATCH 1/5] selftests: firmware: only modprobe if driver is missing Luis R. Rodriguez
2016-12-13  3:08 ` [PATCH 2/5] selftests: firmware: send expected errors to /dev/null Luis R. Rodriguez
2016-12-13  3:08 ` [PATCH 3/5] firmware: revamp firmware documentation Luis R. Rodriguez
2016-12-13  7:26   ` Rafał Miłecki
2016-12-16  9:09     ` Luis R. Rodriguez
2016-12-13 13:26   ` Daniel Wagner
2016-12-13 13:30     ` Rafał Miłecki
2016-12-16  9:18       ` Luis R. Rodriguez
2016-12-16  9:34         ` Johannes Berg
2016-12-16  9:16     ` Luis R. Rodriguez
2017-01-12 14:42   ` [PATCH v4 0/2] firmware: fw doc revamp follow up Luis R. Rodriguez
2017-01-12 14:42     ` [PATCH v4 1/2] firmware: add SmPL report for custom fallback mechanism Luis R. Rodriguez
2017-01-12 14:42     ` [PATCH v4 2/2] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Luis R. Rodriguez
2017-01-19 11:31       ` Greg KH
2017-01-19 16:08         ` Luis R. Rodriguez
2017-01-19 16:14           ` Greg KH
2017-01-19 21:38             ` Luis R. Rodriguez
2016-12-13  3:08 ` [PATCH 4/5] firmware: add SmPL report for custom fallback mechanism Luis R. Rodriguez
2016-12-13  6:13   ` Julia Lawall
2016-12-13  9:44   ` Jacek Anaszewski
2016-12-14  1:48     ` Milo Kim
2016-12-16  9:29       ` Luis R. Rodriguez
2017-01-11 18:51         ` Luis R. Rodriguez
2016-12-13  3:08 ` [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Luis R. Rodriguez
2016-12-13 19:04   ` Pavel Machek
2016-12-16  9:22     ` Luis R. Rodriguez
2016-12-16  9:29       ` Pavel Machek
2016-12-16  9:59         ` Luis R. Rodriguez
2016-12-16 10:14           ` Pavel Machek [this message]
2016-12-16 10:56             ` Luis R. Rodriguez
2016-12-16 11:27               ` Pavel Machek
2016-12-16 15:19                 ` Luis R. Rodriguez
2016-12-16 16:10                 ` Luis R. Rodriguez
2016-12-16 16:14                   ` Luis R. Rodriguez
2016-12-18  3:50                     ` Milo Kim
2016-12-19 20:08                       ` Pavel Machek
2016-12-19 20:46                         ` Jacek Anaszewski
2016-12-21 18:49                           ` Pavel Machek
2016-12-21 20:33                             ` Jacek Anaszewski
2016-12-15  9:32   ` Jacek Anaszewski
2016-12-16  9:26     ` Luis R. Rodriguez
2016-12-13 12:58 ` [PATCH 0/5] firmware: doc revamp Daniel Wagner

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=20161216101405.GA29069@amd \
    --to=pavel@ucw.cz \
    --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=broonie@kernel.org \
    --cc=chunkeey@googlemail.com \
    --cc=daniel.wagner@bmw-carit.de \
    --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=linux-leds@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=markivx@codeaurora.org \
    --cc=mcgrof@kernel.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=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;
as well as URLs for NNTP newsgroup(s).