Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: paubert@iram.es (Gabriel Paubert)
To: cocci@systeme.lip6.fr
Subject: [Cocci] [PATCH v3 2/5] firmware: annotate thou shalt not request fw on init or probe
Date: Wed, 24 Aug 2016 10:17:38 +0200	[thread overview]
Message-ID: <20160824081738.GA8991@visitor2.iram.es> (raw)
In-Reply-To: <1471999507-913-3-git-send-email-mcgrof@kernel.org>

On Tue, Aug 23, 2016 at 05:45:04PM -0700, mcgrof at kernel.org wrote:

[snip]
> ---
>  Documentation/firmware_class/README                |  20 ++++
>  drivers/base/Kconfig                               |   2 +-
>  .../request_firmware-avoid-init-probe-init.cocci   | 130 +++++++++++++++++++++
>  3 files changed, 151 insertions(+), 1 deletion(-)
>  create mode 100644 scripts/coccinelle/api/request_firmware-avoid-init-probe-init.cocci
> 
> diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README
> index cafdca8b3b15..056d1cb9d365 100644
> --- a/Documentation/firmware_class/README
> +++ b/Documentation/firmware_class/README
> @@ -93,6 +93,26 @@
>     user contexts to request firmware asynchronously, but can't be called
>     in atomic contexts.
>  
> +Requirements:
> +=============
> +
> +You should avoid at all costs requesting firmware on both init and probe paths
> +of your device driver. Reason for this is the complexity needed to ensure a
> +firmware will be available for a driver early in boot through different
> +build configurations. Consider built-in drivers needing firmware early, or
> +consider a driver assuming it will only get firmware after pivot_root().
> +
> +Drivers that really need firmware early should use stuff the firmware in

Minor grammatical nit: s/use//

> +initramfs or consider using CONFIG_EXTRA_FIRMWARE. Using initramfs is much
> +more portable to more distributions as not all distributions wish to enable
> +CONFIG_EXTRA_FIRMWARE. Should a driver require the firmware being built-in
> +it should depend on CONFIG_EXTRA_FIRMWARE. There is no current annotation for
> +requiring a firmware on initramfs.
> +
> +If you're a maintainer you can help police this with:
> +
> +$ export COCCI=scripts/coccinelle/api/request_firmware-avoid-init-probe-init.cocci
> +$ make coccicheck MODE=report
>  
>   about in-kernel persistence:
>   ---------------------------

      reply	other threads:[~2016-08-24  8:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1466117661-22075-1-git-send-email-mcgrof@kernel.org>
2016-06-16 22:54 ` [Cocci] [PATCH v2 2/5] firmware: annotate thou shalt not request fw on init or probe Luis R. Rodriguez
2016-08-24  6:55   ` Daniel Vetter
2016-08-24 20:39     ` Luis R. Rodriguez
2016-08-25 11:05       ` Daniel Vetter
2016-08-25 19:41         ` Luis R. Rodriguez
2016-08-25 20:10           ` Daniel Vetter
2016-08-25 20:25             ` Luis R. Rodriguez
2016-08-25 20:30           ` Dmitry Torokhov
     [not found] ` <1471999507-913-1-git-send-email-mcgrof@kernel.org>
2016-08-24  0:45   ` [Cocci] [PATCH v3 " mcgrof at kernel.org
2016-08-24  8:17     ` Gabriel Paubert [this message]

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=20160824081738.GA8991@visitor2.iram.es \
    --to=paubert@iram.es \
    --cc=cocci@systeme.lip6.fr \
    /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