Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1543335

Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation

From Pavel Machek <pavel@ucw.cz>
Newsgroups linux.kernel
Subject Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation
Date 2016-12-16 11:20 +0100
Message-ID <sOXMm-2df-17@gated-at.bofh.it> (permalink)
References (1 earlier) <sNLDz-4f3-21@gated-at.bofh.it> <sO0CB-4Zy-19@gated-at.bofh.it> <sOWZY-1DO-25@gated-at.bofh.it> <sOWZY-1DO-41@gated-at.bofh.it> <sOXsZ-1Rx-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] firmware: doc revamp "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-13 04:10 +0100
  [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-13 04:10 +0100
    Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Pavel Machek <pavel@ucw.cz> - 2016-12-13 20:10 +0100
      Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-16 10:30 +0100
        Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Pavel Machek <pavel@ucw.cz> - 2016-12-16 10:30 +0100
          Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-16 11:00 +0100
            Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Pavel Machek <pavel@ucw.cz> - 2016-12-16 11:20 +0100
              Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-16 12:00 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Pavel Machek <pavel@ucw.cz> - 2016-12-16 12:30 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-16 16:30 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-16 17:20 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Milo Kim <woogyom.kim@gmail.com> - 2016-12-18 05:00 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Pavel Machek <pavel@ucw.cz> - 2016-12-19 21:10 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-12-19 21:50 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Pavel Machek <pavel@ucw.cz> - 2016-12-21 19:50 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-12-21 21:40 +0100
                Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-16 17:20 +0100
    Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-12-15 10:40 +0100
      Re: [PATCH 5/5] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-16 10:30 +0100
  Re: [PATCH 0/5] firmware: doc revamp Daniel Wagner <daniel.wagner@bmw-carit.de> - 2016-12-13 14:10 +0100

csiph-web