[PATCH] firmware: Fix security issue with request_firmware_into_buf()

2018-08-31 Thread Luis R. Rodriguez
From: Rishabh Bhatnagar When calling request_firmware_into_buf() with the FW_OPT_NOCACHE flag it is expected that firmware is loaded into buffer from memory. But inside alloc_lookup_fw_priv every new firmware that is loaded is added to the firmware cache (fwc) list head. So if any driver

Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware

2018-05-14 Thread Luis R. Rodriguez
On Mon, May 14, 2018 at 10:02:31PM -0400, Mimi Zohar wrote: > On Mon, 2018-05-14 at 19:28 +0000, Luis R. Rodriguez wrote: > > > - CONFIG_IMA_APPRAISE is not fine enough grained. > > > > > > The CONFIG_IMA_APPRAISE_FIRMWARE will be a Kconfig option.  Similar >

Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware

2018-05-14 Thread Luis R. Rodriguez
On Mon, May 14, 2018 at 08:58:12AM -0400, Mimi Zohar wrote: > On Fri, 2018-05-11 at 21:52 +0000, Luis R. Rodriguez wrote: > > diff --git a/drivers/base/firmware_loader/main.c > > b/drivers/base/firmware_loader/main.c > > index eb34089e4299..d7cdf04a8681 100644 &

Re: [PATCH 6/9] firmware: print firmware name on fallback path

2018-05-12 Thread Luis R. Rodriguez
On Sat, May 12, 2018 at 11:03:52AM +0300, Kalle Valo wrote: > (sorry for the delay, this got buried in my inbox) > > "Luis R. Rodriguez" <mcg...@kernel.org> writes: > > > On Mon, Apr 23, 2018 at 04:12:02PM -0400, Andres Rodriguez wrote: > >> Previous

Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware

2018-05-11 Thread Luis R. Rodriguez
On Fri, May 11, 2018 at 01:00:26AM -0400, Mimi Zohar wrote: > On Thu, 2018-05-10 at 23:26 +0000, Luis R. Rodriguez wrote: > > On Wed, May 09, 2018 at 10:00:58PM -0400, Mimi Zohar wrote: > > > On Wed, 2018-05-09 at 23:48 +, Luis R. Rodriguez wrote: > > > > On W

Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware

2018-05-10 Thread Luis R. Rodriguez
On Wed, May 09, 2018 at 10:00:58PM -0400, Mimi Zohar wrote: > On Wed, 2018-05-09 at 23:48 +0000, Luis R. Rodriguez wrote: > > On Wed, May 09, 2018 at 06:06:57PM -0400, Mimi Zohar wrote: > > > > > > Yes, writing regdb as a micro/mini LSM sounds reasonable.  The LSM &g

[PATCH v7 01/14] firmware: wrap FW_OPT_* into an enum

2018-05-10 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> This should let us associate enum kdoc to these values. While at it, kdocify the fw_opt. Signed-off-by: Andres Rodriguez <andre...@gmail.com> Reviewed-by: Kees Cook <keesc...@chromium.org> Acked-by: Luis R. Rodriguez <mcg...@kernel

[PATCH v7 02/14] firmware: use () to terminate kernel-doc function names

2018-05-10 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> The kernel-doc spec dictates a function name ends in (). Signed-off-by: Andres Rodriguez <andre...@gmail.com> Reviewed-by: Kees Cook <keesc...@chromium.org> Acked-by: Randy Dunlap <rdun...@infradead.org> Acked-by: Luis R. Rodr

[PATCH v7 00/14] firmware_loader changes for v4.18

2018-05-10 Thread Luis R. Rodriguez
fallback mechanism for testmode Luis R. Rodriguez (8): firmware_loader: document firmware_sysfs_fallback() firmware_loader: enhance Kconfig documentation over FW_LOADER firmware_loader: replace ---help--- with help firmware_loader: move kconfig FW_LOADER entries to its own file firmware_loader

[PATCH v7 03/14] firmware: rename fw_sysfs_fallback to firmware_fallback_sysfs()

2018-05-10 Thread Luis R. Rodriguez
..@chromium.org> Acked-by: Luis R. Rodriguez <mcg...@kernel.org> [mcgrof: small coding style changes] Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/fallback.c | 8 drivers/base/firmware_loader/fallback.h | 16 drivers/b

[PATCH v7 05/14] firmware_loader: enhance Kconfig documentation over FW_LOADER

2018-05-10 Thread Luis R. Rodriguez
esc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/Kconfig | 165 ++- 1 file changed, 131 insertions(+), 34 deletions(-) diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 29b0eb452b3a..db2bbe4

[PATCH v7 07/14] firmware_loader: move kconfig FW_LOADER entries to its own file

2018-05-10 Thread Luis R. Rodriguez
Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/Kconfig | 155 +-- drivers/base/firmware_loader/Kconfig | 154 ++ 2 files changed, 155 insertions(+), 154 deletions(-) create mode 100644 drivers/base/fir

[PATCH v7 04/14] firmware_loader: document firmware_sysfs_fallback()

2018-05-10 Thread Luis R. Rodriguez
This also sets the expecations for future fallback interfaces, even if they are not exported. Reviewed-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/fallback.c | 20 1 file changed, 2

[PATCH v7 08/14] firmware_loader: make firmware_fallback_sysfs() print more useful

2018-05-10 Thread Luis R. Rodriguez
: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/fallback.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/base/firmware_loader/fallback.c b/drivers/base/firmware_loader/fallback.c index 9169e7b9800c..b676a99c469c 100644 --- a/

[PATCH v7 10/14] ath10k: use firmware_request_nowarn() to load firmware

2018-05-10 Thread Luis R. Rodriguez
gt; Acked-by: Kalle Valo <kv...@codeaurora.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/net/wireless/ath/ath10k/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k

[PATCH v7 09/14] firmware: add firmware_request_nowarn() - load firmware without warnings

2018-05-10 Thread Luis R. Rodriguez
riguez <andre...@gmail.com> Reviewed-by: Kees Cook <keesc...@chromium.org> Acked-by: Luis R. Rodriguez <mcg...@kernel.org> [mcgrof: used the old API calls as the full rename is not done yet, and add the caller for when FW_LOADER is disabled, enhance documentation ] Signed-off-by

[PATCH v7 14/14] Documentation: clarify firmware_class provenance and why we can't rename the module

2018-05-10 Thread Luis R. Rodriguez
Clarify the provenance of the firmware loader firmware_class module name and why we cannot rename the module in the future. Reviewed-by: Mauro Carvalho Chehab <mchehab+sams...@kernel.org> Reviewed-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mc

[PATCH v7 11/14] ath10k: re-enable the firmware fallback mechanism for testmode

2018-05-10 Thread Luis R. Rodriguez
eeping the fallback mechanism enabled. So use that instead. Signed-off-by: Andres Rodriguez <andre...@gmail.com> Reviewed-by: Kees Cook <keesc...@chromium.org> Acked-by: Kalle Valo <kv...@codeaurora.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/net/wire

[PATCH v7 13/14] Documentation: remove stale firmware API reference

2018-05-10 Thread Luis R. Rodriguez
It refers to a pending patch, but this was merged eons ago. Reviewed-by: Mauro Carvalho Chehab <mchehab+sams...@kernel.org> Reviewed-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- Documentation/dell_rbu.txt | 5 + 1 file ch

[PATCH v7 06/14] firmware_loader: replace ---help--- with help

2018-05-10 Thread Luis R. Rodriguez
As per checkpatch using help is preferred over ---help---. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index db2bbe483927..0c38df32c7fe

[PATCH v7 12/14] Documentation: fix few typos and clarifications for the firmware loader

2018-05-10 Thread Luis R. Rodriguez
Fix a few typos, and clarify a few sentences. Reviewed-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- Documentation/driver-api/firmware/fallback-mechanisms.rst | 5 +++-- Documentation/driver-api/firmware/firmware_cache.rst | 4 +

Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware

2018-05-09 Thread Luis R. Rodriguez
On Wed, May 09, 2018 at 06:06:57PM -0400, Mimi Zohar wrote: > On Wed, 2018-05-09 at 21:22 +0000, Luis R. Rodriguez wrote: > > > > OK, its still not clear to what it will do. If it does not touch the > > firmware > > loader code, and it just sets and configur

Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware

2018-05-09 Thread Luis R. Rodriguez
On Wed, May 09, 2018 at 03:57:18PM -0400, Mimi Zohar wrote: > On Wed, 2018-05-09 at 19:15 +0000, Luis R. Rodriguez wrote: > > > > > > If both are enabled, do we require both signatures or is one enough. > > > > > > > > Good question. Considering

Re: [PATCH v6 05/13] firmware_loader: enhance Kconfig documentation over FW_LOADER

2018-05-09 Thread Luis R. Rodriguez
On Tue, May 08, 2018 at 03:42:33PM -0700, Kees Cook wrote: > On Tue, May 8, 2018 at 11:12 AM, Luis R. Rodriguez <mcg...@kernel.org> wrote: > > + This used to be the default firmware loading facility, and udev > > used > > + to listen for uvents to l

Re: [PATCH v6 12/13] Documentation: remove stale firmware API reference

2018-05-09 Thread Luis R. Rodriguez
On Wed, May 09, 2018 at 12:12:09PM -0300, Mauro Carvalho Chehab wrote: > Em Tue, 8 May 2018 11:12:46 -0700 > "Luis R. Rodriguez" <mcg...@kernel.org> escreveu: > > > It refers to a pending patch, but this was merged eons ago. > > Didn't know that

Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware

2018-05-09 Thread Luis R. Rodriguez
On Wed, May 09, 2018 at 07:30:28AM -0400, Mimi Zohar wrote: > On Tue, 2018-05-08 at 17:34 +0000, Luis R. Rodriguez wrote: > > On Thu, May 03, 2018 at 08:24:26PM -0400, Mimi Zohar wrote: > > > On Fri, 2018-05-04 at 00:07 +, Luis R. Rodriguez wrote: > > > > On T

[PATCH v6 01/13] firmware: wrap FW_OPT_* into an enum

2018-05-08 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> This should let us associate enum kdoc to these values. While at it, kdocify the fw_opt. Signed-off-by: Andres Rodriguez <andre...@gmail.com> Acked-by: Luis R. Rodriguez <mcg...@kernel.org> [mcgrof: coding style fixes, merge kdoc with

[PATCH v6 04/13] firmware_loader: document firmware_sysfs_fallback()

2018-05-08 Thread Luis R. Rodriguez
This also sets the expecations for future fallback interfaces, even if they are not exported. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/fallback.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/base/firmware_

[PATCH v6 02/13] firmware: use () to terminate kernel-doc function names

2018-05-08 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> The kernel-doc spec dictates a function name ends in (). Signed-off-by: Andres Rodriguez <andre...@gmail.com> Acked-by: Randy Dunlap <rdun...@infradead.org> Acked-by: Luis R. Rodriguez <mcg...@kernel.org> [mcgrof: adjust s

[PATCH v6 05/13] firmware_loader: enhance Kconfig documentation over FW_LOADER

2018-05-08 Thread Luis R. Rodriguez
into the firmware_loader/ directory later. This also now recommends using firmwared [0] for folks left needing a uevent handler in userspace for the sysfs firmware fallback mechanis given udev's uevent firmware mechanism was ripped out a while ago. [0] https://github.com/teg/firmwared Signed-off-by: Luis R

[PATCH v6 03/13] firmware: rename fw_sysfs_fallback to firmware_fallback_sysfs()

2018-05-08 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> This is done since this call is now exposed through kernel-doc, and since this also paves the way for different future types of fallback mechanims. Signed-off-by: Andres Rodriguez <andre...@gmail.com> Acked-by: Luis R. Rodriguez <mc

[PATCH v6 06/13] firmware_loader: move kconfig FW_LOADER entries to its own file

2018-05-08 Thread Luis R. Rodriguez
This will make it easier to track and easier to understand what components and features are part of the FW_LOADER. There are some components related to firmware which have *nothing* to do with the FW_LOADER, souch as PREVENT_FIRMWARE_BUILD. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.

[PATCH v6 09/13] ath10k: use firmware_request_nowarn() to load firmware

2018-05-08 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> This reduces the unnecessary spew when trying to load optional firmware: "Direct firmware load for ... failed with error -2" Signed-off-by: Andres Rodriguez <andre...@gmail.com> Acked-by: Kalle Valo <kv...@codeaurora.o

[PATCH v6 07/13] firmware_loader: make firmware_fallback_sysfs() print more useful

2018-05-08 Thread Luis R. Rodriguez
with the fallback mechanism, we will soon, so just respect its use consistently. And even if you *don't* want to print always on failure, you may want to print when debugging so enable dynamic debug print when FW_OPT_NO_WARN is used. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- d

[PATCH v6 10/13] ath10k: re-enable the firmware fallback mechanism for testmode

2018-05-08 Thread Luis R. Rodriguez
eeping the fallback mechanism enabled. So use that instead. Signed-off-by: Andres Rodriguez <andre...@gmail.com> Acked-by: Kalle Valo <kv...@codeaurora.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/net/wireless/ath/ath10k/testmode.c | 2 +- 1 file changed, 1

[PATCH v6 08/13] firmware: add firmware_request_nowarn() - load firmware without warnings

2018-05-08 Thread Luis R. Rodriguez
riguez <andre...@gmail.com> Acked-by: Luis R. Rodriguez <mcg...@kernel.org> [mcgrof: used the old API calls as the full rename is not done yet, and add the caller for when FW_LOADER is disabled, enhance documentation ] Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> ---

[PATCH v6 11/13] Documentation: fix few typos and clarifications for the firmware loader

2018-05-08 Thread Luis R. Rodriguez
Fix a few typos, and clarify a few sentences. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- Documentation/driver-api/firmware/fallback-mechanisms.rst | 5 +++-- Documentation/driver-api/firmware/firmware_cache.rst | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)

[PATCH v6 12/13] Documentation: remove stale firmware API reference

2018-05-08 Thread Luis R. Rodriguez
It refers to a pending patch, but this was merged eons ago. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- Documentation/dell_rbu.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/Documentation/dell_rbu.txt b/Documentation/dell_rbu.txt index 0fdb6aa2704c..077fdc29a0d0

[PATCH v6 13/13] Documentation: clarify firmware_class provenance and why we can't rename the module

2018-05-08 Thread Luis R. Rodriguez
Clarify the provenance of the firmware loader firmware_class module name and why we cannot rename the module in the future. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- .../driver-api/firmware/fallback-mechanisms.rst | 9 ++--- 1 file changed, 6 insertions

[PATCH v6 00/13] firmware_loader changes for v4.18

2018-05-08 Thread Luis R. Rodriguez
() to load firmware ath10k: re-enable the firmware fallback mechanism for testmode Luis R. Rodriguez (7): firmware_loader: document firmware_sysfs_fallback() firmware_loader: enhance Kconfig documentation over FW_LOADER firmware_loader: move kconfig FW_LOADER entries to its own file

Re: [PATCH 00/18] Fix some build warnings/errors with Sphinx

2018-05-08 Thread Luis R. Rodriguez
On Tue, May 08, 2018 at 10:13:42AM -0600, Jonathan Corbet wrote: > On Mon, 7 May 2018 06:35:36 -0300 > Mauro Carvalho Chehab wrote: > > > I decided to give a try with Sphinx last stable version > > (1.17.4), and noticed several issues. The worse one was > > with the

Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware

2018-05-08 Thread Luis R. Rodriguez
On Thu, May 03, 2018 at 08:24:26PM -0400, Mimi Zohar wrote: > On Fri, 2018-05-04 at 00:07 +0000, Luis R. Rodriguez wrote: > > On Tue, May 01, 2018 at 09:48:20AM -0400, Mimi Zohar wrote: > > > Allow LSMs and IMA to differentiate between signed regulatory.db and &g

Re: [PATCH v5 0/6] firmware_loader: cleanups for v4.18

2018-05-08 Thread Luis R. Rodriguez
On Fri, May 04, 2018 at 10:43:49AM -0700, Luis R. Rodriguez wrote: > Greg, > > I've reviewed the pending patches for the firmware_laoder and as for > v4.18, the following 3 patches from Andres have been iterated enough > that they're ready after I made some final minor chang

Re: [PATCH 6/9] firmware: print firmware name on fallback path

2018-05-07 Thread Luis R. Rodriguez
On Fri, May 04, 2018 at 10:57:26PM -0400, Andres Rodriguez wrote: > On 2018-05-03 07:42 PM, Luis R. Rodriguez wrote: > > On Mon, Apr 23, 2018 at 04:12:02PM -0400, Andres Rodriguez wrote: > > > Previously, one could assume the firmware name from the preceding > > > mes

Re: [PATCH v5 0/6] firmware_loader: cleanups for v4.18

2018-05-04 Thread Luis R. Rodriguez
On Fri, May 04, 2018 at 09:17:08PM +0200, Krzysztof Halasa wrote: > "Luis R. Rodriguez" <mcg...@kernel.org> writes: > > > * CONFIG_WANXL --> CONFIG_WANXL_BUILD_FIRMWARE > > * CONFIG_SCSI_AIC79XX --> CONFIG_AIC79XX_BUILD_FIRMWARE > > > > T

[PATCH v5 1/6] firmware: wrap FW_OPT_* into an enum

2018-05-04 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> This should let us associate enum kdoc to these values. While at it, kdocify the fw_opt. Signed-off-by: Andres Rodriguez <andre...@gmail.com> Acked-by: Luis R. Rodriguez <mcg...@kernel.org> [mcgrof: coding style fixes, merge kdoc with

[PATCH v5 3/6] firmware: rename fw_sysfs_fallback to firmware_fallback_sysfs()

2018-05-04 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> This is done since this call is now exposed through kernel-doc, and since this also paves the way for different future types of fallback mechanims. Signed-off-by: Andres Rodriguez <andre...@gmail.com> Acked-by: Luis R. Rodriguez <mc

[PATCH v5 0/6] firmware_loader: cleanups for v4.18

2018-05-04 Thread Luis R. Rodriguez
minate kernel-doc function names firmware: rename fw_sysfs_fallback to firmware_fallback_sysfs() Luis R. Rodriguez (3): firmware_loader: document firmware_sysfs_fallback() firmware_loader: enhance Kconfig documentation over FW_LOADER firmware_loader: move kconfig FW_LOADER entries to its ow

[PATCH v5 2/6] firmware: use () to terminate kernel-doc function names

2018-05-04 Thread Luis R. Rodriguez
From: Andres Rodriguez <andre...@gmail.com> The kernel-doc spec dictates a function name ends in (). Signed-off-by: Andres Rodriguez <andre...@gmail.com> Acked-by: Randy Dunlap <rdun...@infradead.org> Acked-by: Luis R. Rodriguez <mcg...@kernel.org> Signed-off-by

[PATCH v5 4/6] firmware_loader: document firmware_sysfs_fallback()

2018-05-04 Thread Luis R. Rodriguez
This also sets the expecations for future fallback interfaces, even if they are not exported. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/fallback.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/base/firmware_

[PATCH v5 6/6] firmware_loader: move kconfig FW_LOADER entries to its own file

2018-05-04 Thread Luis R. Rodriguez
This will make it easier to track and easier to understand what components and features are part of the FW_LOADER. There are some components related to firmware which have *nothing* to do with the FW_LOADER, souch as PREVENT_FIRMWARE_BUILD. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.

[PATCH v5 5/6] firmware_loader: enhance Kconfig documentation over FW_LOADER

2018-05-04 Thread Luis R. Rodriguez
into the firmware_loader/ directory later. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/Kconfig | 160 ++- 1 file changed, 126 insertions(+), 34 deletions(-) diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 29b0eb452b3a..bf2d46

Re: [PATCH 5/9] firmware: add function to load firmware without warnings v5

2018-05-03 Thread Luis R. Rodriguez
On Mon, Apr 23, 2018 at 04:12:01PM -0400, Andres Rodriguez wrote: > diff --git a/include/linux/firmware.h b/include/linux/firmware.h > index db8351a42405..a34e16f77f20 100644 > --- a/include/linux/firmware.h > +++ b/include/linux/firmware.h > @@ -42,6 +42,8 @@ struct builtin_fw { > #if

Re: [PATCH 7/9] firmware: use rename fw_sysfs_fallback to use the firmware_ prefix

2018-05-03 Thread Luis R. Rodriguez
On Mon, Apr 23, 2018 at 04:12:03PM -0400, Andres Rodriguez wrote: > Use the correct prefix for symbols exported by firmware_loader(). This > is done since firmware_sysfs_fallback() is now exposed through > kernel-doc. > > Signed-off-by: Andres Rodriguez > --- >

Re: [PATCH 6/9] firmware: print firmware name on fallback path

2018-05-03 Thread Luis R. Rodriguez
On Mon, Apr 23, 2018 at 04:12:02PM -0400, Andres Rodriguez wrote: > Previously, one could assume the firmware name from the preceding > message: "Direct firmware load for {name} failed with error %d". > > However, with the new firmware_request_nowarn() entrypoint, the message > outlined above

Re: [PATCH 5/9] firmware: add function to load firmware without warnings v5

2018-05-03 Thread Luis R. Rodriguez
On Mon, Apr 23, 2018 at 04:12:01PM -0400, Andres Rodriguez wrote: > Currently the firmware loader only exposes one silent path for querying > optional firmware, and that is firmware_request_direct(). This function > also disables the fallback path, which might not always be the > desired

Re: [PATCH 4/9] firmware: use () to terminate kernel-doc function names

2018-05-03 Thread Luis R. Rodriguez
On Mon, Apr 23, 2018 at 04:12:00PM -0400, Andres Rodriguez wrote: > The kernel-doc spec dictates a function name ends in (). > > Signed-off-by: Andres Rodriguez > Acked-by: Randy Dunlap 0-day never got back to me about my full sweep API rename so I

Re: [PATCH 3/9] firmware: add kernel-doc for enum fw_opt

2018-05-03 Thread Luis R. Rodriguez
On Mon, Apr 23, 2018 at 04:11:59PM -0400, Andres Rodriguez wrote: > Some basic definitions for the FW_OPT_* values > > v2: Documentation corrections from Luis. Likewise. > Signed-off-by: Andres Rodriguez > --- > drivers/base/firmware_loader/firmware.h | 20

Re: [PATCH 2/9] firmware: wrap FW_OPT_* into an enum

2018-05-03 Thread Luis R. Rodriguez
On Mon, Apr 23, 2018 at 04:11:58PM -0400, Andres Rodriguez wrote: > This should let us associate enum kdoc to these values. > > v2: use BIT() macro No need to keep the changelog of series here, best to put them below as I note. > > Signed-off-by: Andres Rodriguez > ---

Re: [PATCH 1/9] firmware: some documentation fixes

2018-05-03 Thread Luis R. Rodriguez
On Mon, Apr 23, 2018 at 04:11:57PM -0400, Andres Rodriguez wrote: > Including: > - Fixup outdated kernel-doc paths > - Slightly too short title underline > - Some typos > > Signed-off-by: Andres Rodriguez This already got merged.

[PATCH v4 0/3] firmware: add firmware_request_cache()

2018-03-21 Thread Luis R. Rodriguez
addressing the firmware API rename for the rest of the callers. That will take some time as I'm running quite a bit of tests on those changes and I am going to wait for 0-day to give me its blesssings. Question, feedback, and specially rants are greatly appreciated. Luis Luis R. Rodriguez (3

[PATCH v4 2/3] firmware: add firmware_request_cache() to help with cache on reboot

2018-03-21 Thread Luis R. Rodriguez
the firmware on a reboot and then suspend they can miss looking for the firmware on resume. To help with this we need a way to cache the firmware when such an optimization has taken place. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- .../driver-api/firmware/request_firmwa

[PATCH v4 1/3] firmware: fix typo on pr_info_once() when ignore_sysfs_fallback is used

2018-03-21 Thread Luis R. Rodriguez
When the sysctl knob is used ignore the fallback mechanism we pr_info_once() to ensure its noted the knob was used. The print incorrectly states its a debugfs knob, its a sysctl knob, so correct this typo. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_

[PATCH v4 3/3] mt7601u: use firmware_request_cache() to address cache on reboot

2018-03-21 Thread Luis R. Rodriguez
back this fixes his woes with both suspend and hibernation. Reported-by: Cantabile <cantabile.d...@gmail.com> Tested-by: Cantabile <cantabile.d...@gmail.com> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/net/wireless/mediatek/mt7601u/mcu.c | 2 +- 1 file ch

Re: [PATCH v3 19/20] firmware: add request_firmware_cache() to help with cache on reboot

2018-03-20 Thread Luis R. Rodriguez
On Tue, Mar 20, 2018 at 02:54:44PM -0400, Konstantin Ryabitsev wrote: > On 03/20/18 14:24, Luis R. Rodriguez wrote: > > *Iff* this seems sensible, this would only mean kernel.org would have to > > start > > accepting git notes long term, for those who optionally want to p

Re: [PATCH v3 19/20] firmware: add request_firmware_cache() to help with cache on reboot

2018-03-20 Thread Luis R. Rodriguez
On Tue, Mar 20, 2018 at 06:38:01PM +0100, Greg KH wrote: > On Tue, Mar 20, 2018 at 05:34:09PM +0000, Luis R. Rodriguez wrote: > > On Tue, Mar 20, 2018 at 09:30:55AM +0100, Greg KH wrote: > > > On Sat, Mar 10, 2018 at 06:15:00AM -0800, Luis R. Rodriguez wrote: > >

Re: [PATCH v3 19/20] firmware: add request_firmware_cache() to help with cache on reboot

2018-03-20 Thread Luis R. Rodriguez
On Tue, Mar 20, 2018 at 09:30:55AM +0100, Greg KH wrote: > On Sat, Mar 10, 2018 at 06:15:00AM -0800, Luis R. Rodriguez wrote: > > +EXPORT_SYMBOL_GPL(request_firmware_cache); > > I know you are just following the existing naming scheme, but please > let's not continue the prob

Re: [PATCH v3 11/20] firmware: enable to force disable the fallback mechanism at run time

2018-03-18 Thread Luis R. Rodriguez
On Wed, Mar 14, 2018 at 12:00 PM, Greg KH <gre...@linuxfoundation.org> wrote: > On Sat, Mar 10, 2018 at 06:14:52AM -0800, Luis R. Rodriguez wrote: >> You currently need four different kernel builds to test the firmware >> API fully. By adding a proc knob to force disable t

Re: [PATCH v3 05/20] firmware: simplify CONFIG_FW_LOADER_USER_HELPER_FALLBACK further

2018-03-14 Thread Luis R. Rodriguez
On Wed, Mar 14, 2018 at 11:53 AM, Greg KH <gre...@linuxfoundation.org> wrote: > On Sat, Mar 10, 2018 at 06:14:46AM -0800, Luis R. Rodriguez wrote: >> All CONFIG_FW_LOADER_USER_HELPER_FALLBACK really is, is just a bool, >> initailized at build time. Define it as such. This si

Re: [PATCH v3 07/20] firmware: move loading timeout under struct firmware_fallback_config

2018-03-14 Thread Luis R. Rodriguez
On Wed, Mar 14, 2018 at 11:56 AM, Greg KH <gre...@linuxfoundation.org> wrote: > On Sat, Mar 10, 2018 at 06:14:48AM -0800, Luis R. Rodriguez wrote: >> The timeout is a fallback construct, so we can just stuff the >> timeout configuration under struct firmware_fallback_config

Re: [PATCH v3 00/20] firmware: development for v4.17

2018-03-14 Thread Luis R. Rodriguez
On Sat, Mar 10, 2018 at 09:16:36AM -0800, Kees Cook wrote: > On Sat, Mar 10, 2018 at 6:14 AM, Luis R. Rodriguez <mcg...@kernel.org> wrote: > > Greg, > > > > Here's a respin of what I have queued up for v4.17 for the firmware API. It > > combines the cleanup I've

Re: [PATCH] firmware: add a function to load optional firmware v2

2018-03-13 Thread Luis R. Rodriguez
On Tue, Mar 13, 2018 at 03:16:34PM +0200, Kalle Valo wrote: > "Luis R. Rodriguez" <mcg...@kernel.org> writes: > > >> +/** > >> + * request_firmware_optional: - request for an optional fw module > >> + * @firmware_p: pointer to firmware image >

Re: [PATCH] firmware: add a function to load optional firmware v2

2018-03-13 Thread Luis R. Rodriguez
On Tue, Mar 13, 2018 at 03:39:23PM +0200, Kalle Valo wrote: > "Luis R. Rodriguez" <mcg...@kernel.org> writes: > > > On Mon, Mar 12, 2018 at 12:10:47AM +0100, Arend van Spriel wrote: > >> On 3/11/2018 5:05 PM, Andres Rodriguez wrote: > >> > >

Re: [PATCH] firmware: add a function to load optional firmware v2

2018-03-12 Thread Luis R. Rodriguez
On Mon, Mar 12, 2018 at 12:10:47AM +0100, Arend van Spriel wrote: > On 3/11/2018 5:05 PM, Andres Rodriguez wrote: > > > Your patch series then should also have the driver callers who you > > > want to modify to use this new API. Collect from the 802.11 folks the > > > other drivers which I think

Re: [PATCH] firmware: add a function to load optional firmware v2

2018-03-10 Thread Luis R. Rodriguez
First, thanks for your patch! On Fri, Mar 9, 2018 at 3:09 PM, Andres Rodriguez wrote: > Currently the firmware loader only exposes one silent path for querying > optional firmware, and that is request_firmware_direct(). This function > also disables the usermodehelper

[PATCH v3 00/20] firmware: development for v4.17

2018-03-10 Thread Luis R. Rodriguez
rmware-dev-for-v4.17 Luis R. Rodriguez (20): test_firmware: add simple firmware firmware test library test_firmware: enable custom fallback testing on limited kernel configs test_firmware: replace syfs fallback check with kconfig_has helper firmware: enable to split firmware_class into s

[PATCH v3 03/20] test_firmware: replace syfs fallback check with kconfig_has helper

2018-03-10 Thread Luis R. Rodriguez
Now that we have a kconfig checker just use that instead of relying on testing a sysfs directory being present, since our requirements are spelled out. Acked-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- tools/testing/selfte

[PATCH v3 02/20] test_firmware: enable custom fallback testing on limited kernel configs

2018-03-10 Thread Luis R. Rodriguez
for now. We stuff the new kconfig_has() helper into our shared library as we'll later expando on its use elsewhere. Acked-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- tools/testing/selftests/firmware/config | 4 t

[PATCH v3 01/20] test_firmware: add simple firmware firmware test library

2018-03-10 Thread Luis R. Rodriguez
We'll expland on this later, for now just add basic module checker. While at it, move this all to use /bin/bash as we'll have much more flexibility with it. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- tools/testing/selftests/firmware/fw_fallback.sh | 7 ++-- tools/t

[PATCH v3 04/20] firmware: enable to split firmware_class into separate target files

2018-03-10 Thread Luis R. Rodriguez
. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/Makefile| 1 + drivers/base/{firmware_class.c => firmware_loader.c} | 0 2 files changed, 1 insertion(+) rename drivers/base/{firmware_class.c => firmware_loader.c} (100%) diff --git a/

[PATCH v3 07/20] firmware: move loading timeout under struct firmware_fallback_config

2018-03-10 Thread Luis R. Rodriguez
, and that is used as an unsigned long. There a few cases however where it makes sense to get or set the timeout as an int, the helpers annotate these use cases have been properly vetted for. Acked-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> ---

[PATCH v3 06/20] firmware: use helpers for setting up a temporary cache timeout

2018-03-10 Thread Luis R. Rodriguez
. Acked-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader.c | 49 ++ 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/drivers/base/firmware_loader.c b/

[PATCH v3 05/20] firmware: simplify CONFIG_FW_LOADER_USER_HELPER_FALLBACK further

2018-03-10 Thread Luis R. Rodriguez
All CONFIG_FW_LOADER_USER_HELPER_FALLBACK really is, is just a bool, initailized at build time. Define it as such. This simplifies the logic even further, removing now all explicit #ifdefs around the code. Acked-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodrigue

[PATCH v3 08/20] firmware: split firmware fallback functionality into its own file

2018-03-10 Thread Luis R. Rodriguez
enable firmware loading is so that we can later enable the kernel after subsequent patches to tweak this configuration, even if the firmware loader is modular. This introduces no functional changes. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/Makefile

Re: [RFC 0/1] Loading optional firmware

2018-03-10 Thread Luis R. Rodriguez
On Fri, Mar 9, 2018 at 2:12 PM, Andres Rodriguez wrote: > Hi Everyone, > > Wanted to inquire your opinions about the following matter. > > We are experiencing some end user confusion regarding the following messages > being printed to dmesg: > > [0.571324] amdgpu

[PATCH v3 14/20] rename: _request_firmware_load() fw_load_sysfs_fallback()

2018-03-10 Thread Luis R. Rodriguez
This reflects much clearer what is being done. While at it, kdoc'ify it. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- Documentation/driver-api/firmware/fallback-mechanisms.rst | 2 +- drivers/base/firmware_loader/fallback.c | 13 ++--- 2 files chang

[PATCH v3 10/20] firmware: enable run time change of forcing fallback loader

2018-03-10 Thread Luis R. Rodriguez
to inspect if CONFIG_FW_LOADER_USER_HELPER_FALLBACK was enabled at build time by checking the proc value at boot time. Acked-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/fallback.c | 1 + drivers/base/fir

[PATCH v3 09/20] firmware: move firmware loader into its own directory

2018-03-10 Thread Luis R. Rodriguez
This will make it much easier to manage as we manage to keep trimming componnents down into their own files to more easily manage and maintain this codebase. Suggested-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> ---

[PATCH v3 11/20] firmware: enable to force disable the fallback mechanism at run time

2018-03-10 Thread Luis R. Rodriguez
org> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/fallback.c | 5 + drivers/base/firmware_loader/fallback.h | 4 drivers/base/firmware_loader/fallback_table.c | 9 + 3 files changed, 18 insertions(+) diff --git a/

[PATCH v3 15/20] firmware: fix checking for return values for fw_add_devm_name()

2018-03-10 Thread Luis R. Rodriguez
make resume fail. This is all theoretical, no known issues have been reported. This small issue has been present way since the addition of the devres firmware cache names on v3.7. Fixes: f531f05ae9437 ("firmware loader: store firmware name into devres list") Signed-off-by: Luis R. Rodr

[PATCH v3 17/20] test_firmware: modify custom fallback tests to use unique files

2018-03-10 Thread Luis R. Rodriguez
with the same file. We'll soon become strict about this on the firmware interface to reject such calls later, so correct the test scripts to avoid such uses as well. We address this on the tests scripts by simply using unique names when testing the custom fallback interface. Signed-off-by: Luis R. Rodriguez

[PATCH v3 16/20] firmware: add helper to check to see if fw cache is setup

2018-03-10 Thread Luis R. Rodriguez
Add a helper to check if the firmware cache is already setup for a device. This will be used later. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/main.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/driver

[PATCH v3 18/20] firmware: ensure the firmware cache is not used on incompatible calls

2018-03-10 Thread Luis R. Rodriguez
later. One of the reasons we want to enforce this is the firmware cache is used for helping with suspend/resume, and if incompatible calls use it they can stall suspend. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/base/firmware_loader/main.c | 14 ++ 1 file c

[PATCH v3 13/20] test_firmware: test three firmware kernel configs using a proc knob

2018-03-10 Thread Luis R. Rodriguez
ed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- tools/testing/selftests/firmware/Makefile| 2 +- tools/testing/selftests/firmware/fw_lib.sh | 51 + tools/testing/selftests/firmware/fw_run_tests.sh | 70 3 files changed, 122 insertions(+)

[PATCH v3 19/20] firmware: add request_firmware_cache() to help with cache on reboot

2018-03-10 Thread Luis R. Rodriguez
the firmware on a reboot and then suspend they can miss looking for the firmware on resume. To help with this we need a way to cache the firmware when such an optimization has taken place. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- .../driver-api/firmware/request_firmwa

[PATCH v3 20/20] mt7601u: use request_firmware_cache() to address cache on reboot

2018-03-10 Thread Luis R. Rodriguez
back this fixes his woes with both suspend and hibernation. Reported-by: Cantabile <cantabile.d...@gmail.com> Tested-by: Cantabile <cantabile.d...@gmail.com> Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- drivers/net/wireless/mediatek/mt7601u/mcu.c | 2 +- 1 file ch

[PATCH v3 12/20] test_firmware: expand on library with shared helpers

2018-03-10 Thread Luis R. Rodriguez
This expands our library with as many things we could find which both scripts we use share. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- tools/testing/selftests/firmware/fw_fallback.sh | 31 +++--- tools/testing/selftests/firmware/fw_filesystem.s

Re: [PATCH] mt7601u: Fix system freeze after resuming from hibernation

2018-03-01 Thread Luis R. Rodriguez
On Thu, Mar 01, 2018 at 10:11:01PM +0200, cantabile wrote: > On 01/03/18 19:29, Luis R. Rodriguez wrote: > > > > Correct? > > > > The above log is from "20180227-firmware-cache" kernel plus your suggested > change that makes it always upload the firmware

Re: [PATCH] mt7601u: Fix system freeze after resuming from hibernation

2018-03-01 Thread Luis R. Rodriguez
On Thu, Mar 01, 2018 at 04:05:29PM +0200, cantabile wrote: > On 01/03/18 02:28, Luis R. Rodriguez wrote: > > On Wed, Feb 28, 2018 at 11:18:59PM +0200, cantabile wrote: > > > > > Feb 28 22:46:19 home kernel: mt7601u 2-3:1.0: Firmware Version: 0.1.00 > > > Build:

Re: [PATCH] mt7601u: Fix system freeze after resuming from hibernation

2018-02-28 Thread Luis R. Rodriguez
On Wed, Feb 28, 2018 at 11:18:59PM +0200, cantabile wrote: > On 28/02/18 20:48, Luis R. Rodriguez wrote: > > On Wed, Feb 28, 2018 at 08:02:59PM +0200, cantabile wrote: > > > On 27/02/18 22:42, Luis R. Rodriguez wrote: > > OK so we know that the optimization is opt

  1   2   3   >