All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	<gregkh@linuxfoundation.org>, <ming.lei@canonical.com>
Cc: <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>
Subject: Re: [PATCH 3/5] firmware: revamp firmware documentation
Date: Tue, 13 Dec 2016 14:26:06 +0100	[thread overview]
Message-ID: <ab2f9c97-77a4-e451-c2e5-87076b66a8b6@bmw-carit.de> (raw)
In-Reply-To: <20161213030828.17820-4-mcgrof@kernel.org>

> +++ b/Documentation/driver-api/firmware/built-in-fw.rst
> @@ -0,0 +1,36 @@
> +=================
> +Built-in firmware
> +=================
> +
> +Firmware can be built-in to the kernel, that is built-in to vmlinux,
> +to enable firmware lookups to avoid having to look for firmware from
> +the filesystem.

I find the second part of the sentence a bit confusing in the wording.

> You can enable built-in firmware using the kernel
> +configuration options:
> +
> +  * CONFIG_EXTRA_FIRMWARE
> +  * CONFIG_EXTRA_FIRMWARE_DIR
> +
> +The should not be confused with CONFIG_FIRMWARE_IN_KERNEL, this is for drivers

s/The/This/ ?

> +which enable firmware to be built as part of the kernel build process. This

enables?

> +option, CONFIG_FIRMWARE_IN_KERNEL, will build all firmware for all drivers
> +enabled which ship its firmware inside the Linux kernel source tree.
> +
> +There are a few reasons why you might want to consider building your firmware
> +into the kernel with CONFIG_EXTRA_FIRMWARE though:
> +
> +* Speed
> +* Firmware is needed for accessing the boot device, and the user doesn't
> +  want to stuff the firmware into the boot initramfs.
> +
> +Even if you have these needs there are a few reasons why you may not be
> +able to make use of built-in firmware:
> +
> +* Legalese - firmware is non-GPL compatible
> +* Some firmware may be optional
> +* Firmware upgrades are possible, therefore a new firmware would implicate
> +  a complete firmware rebuild.

kernel rebuild?

> +* Some firmware files may be really large in size. The remote-proc subsystem
> +  is an example subsystem which deals with these sorts of firmware
> +* The firmware may need to be scraped out from some device specific location
> +  dynamically, an example is calibration data for for some WiFi chipsets.

Maybe it is worth to mention, that the calibration data is unique to a 
given chip, so it is individual. That is you would need to built for 
each device you sell its own kernel.

[...]

> +++ b/Documentation/driver-api/firmware/fallback-mechanisms.rst
> @@ -0,0 +1,195 @@
> +===================
> +Fallback mechanisms
> +===================
> +
> +A fallback mechanism is supported to allow to overcome failures to do a direct
> +filesystem lookup on the root filesystem or when the firmware simply cannot be
> +installed for practical reasons on the root filesystem. The kernel
> +configuration options related to supporting the firmware fallback mechanism are:
> +
> +  * CONFIG_FW_LOADER_USER_HELPER: enables building the firmware fallback
> +    mechanism. Most distributions enable this option today. If enabled but
> +    CONFIG_FW_LOADER_USER_HELPER_FALLBACK is disabled, only the custom fallback
> +    mechanism is available and for the request_firmware_nowait() call.
> +  * CONFIG_FW_LOADER_USER_HELPER_FALLBACK: force enables each request to
> +    enable the kobject uevent fallback mechanism on all firmare API calls

s/firmare/firmware/

> +    except request_firmware_direct(). Most distributions disable this option
> +    today. The call request_firmware_nowait() allows for one alternative
> +    fallback mechanism: if this kconfig option is enabled and your second
> +    argument to request_firmware_nowait(), uevent, is set to false you are
> +    informing the kernel that you have a custom fallback mechanism and it will
> +    manually load the firmware. Read below for more details.
> +
> +Note that this means when having this configuration:
> +
> +CONFIG_FW_LOADER_USER_HELPER=y
> +CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
> +
> +the kobject uevent fallback mechanism will never take effect even
> +for request_firmware_nowait() when uevent is set to true.
> +
> +Justifying the firmware fallback mechanism
> +==========================================
> +
> +Direct filesystem lookups may fail for a variety of reasons. Known reasons for
> +this are worth itemizing and documenting as it justifies the need for the
> +fallback mechanism:
> +
> +* Race against access with the root filesystem upon bootup.
> +
> +* Races upon resume from suspend. This is resolved by the firmware cache, but
> +  the firmware cache is only supported if you use uevents, and its not
> +  supported for request_firmware_into_buf().
> +
> +* Firmware is not accessible through typical means:
> +        * It cannot be installed into the root filesystem
> +        * The firmware provides very unique device specific data tailored for
> +          the unit gathered with local information. An example is calibration
> +          data for WiFi chipsets for mobile devices. This calibration data is
> +          not common to all units, but tailored per unit.  Such information may
> +          be installed on a separate flash partition other than where the root
> +          filesystem is provided.

Ah, her is the bit about the calibration information.

cheers,
daniel

  parent reply	other threads:[~2016-12-13 13:26 UTC|newest]

Thread overview: 60+ 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 [this message]
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:08           ` Luis R. Rodriguez
2017-01-19 16:14           ` Greg KH
2017-01-19 21:38             ` Luis R. Rodriguez
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-13  9:44     ` Jacek Anaszewski
2016-12-14  1:48     ` Milo Kim
2016-12-14  1:48       ` Milo Kim
2016-12-16  9:29       ` Luis R. Rodriguez
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:22       ` Luis R. Rodriguez
2016-12-16  9:29       ` Pavel Machek
2016-12-16  9:59         ` Luis R. Rodriguez
2016-12-16  9:59           ` Luis R. Rodriguez
2016-12-16 10:14           ` Pavel Machek
2016-12-16 10:56             ` Luis R. Rodriguez
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 15:19                   ` Luis R. Rodriguez
2016-12-16 16:10                 ` Luis R. Rodriguez
2016-12-16 16:10                   ` Luis R. Rodriguez
2016-12-16 16:14                   ` Luis R. Rodriguez
2016-12-16 16:14                     ` Luis R. Rodriguez
2016-12-18  3:50                     ` Milo Kim
2016-12-18  3:50                       ` Milo Kim
2016-12-19 20:08                       ` Pavel Machek
2016-12-19 20:08                         ` Pavel Machek
2016-12-19 20:46                         ` Jacek Anaszewski
2016-12-19 20:46                           ` Jacek Anaszewski
2016-12-21 18:49                           ` Pavel Machek
2016-12-21 18:49                             ` Pavel Machek
2016-12-21 20:33                             ` Jacek Anaszewski
2016-12-21 20:33                               ` Jacek Anaszewski
2016-12-15  9:32   ` Jacek Anaszewski
2016-12-16  9:26     ` Luis R. Rodriguez
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=ab2f9c97-77a4-e451-c2e5-87076b66a8b6@bmw-carit.de \
    --to=daniel.wagner@bmw-carit.de \
    --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=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.