Skip to content

Commit 030cc78

Browse files
salyzyngregkh
authored andcommitted
firmware_class: make firmware caching configurable
Because firmware caching generates uevent messages that are sent over a netlink socket, it can prevent suspend on many platforms. It's also not always useful, so make it a configurable option. Signed-off-by: Mark Salyzyn <salyzyn@android.com> Cc: Tim Murray <timmurray@google.com> Cc: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org> Cc: Luis Chamberlain <mcgrof@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Rafael J. Wysocki <rafael@kernel.org> Cc: linux-kernel@vger.kernel.org Cc: kernel-team@android.com Acked-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/20191113225429.118495-1-salyzyn@android.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bee3bbe commit 030cc78

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

‎drivers/base/firmware_loader/Kconfig‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,17 @@ config FW_LOADER_COMPRESS
169169
be compressed with either none or crc32 integrity check type (pass
170170
"-C crc32" option to xz command).
171171

172+
config FW_CACHE
173+
bool "Enable firmware caching during suspend"
174+
depends on PM_SLEEP
175+
default y if PM_SLEEP
176+
help
177+
Because firmware caching generates uevent messages that are sent
178+
over a netlink socket, it can prevent suspend on many platforms.
179+
It is also not always useful, so on such platforms we have the
180+
option.
181+
182+
If unsure, say Y.
183+
172184
endif # FW_LOADER
173185
endmenu

‎drivers/base/firmware_loader/main.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct firmware_cache {
5151
struct list_head head;
5252
int state;
5353

54-
#ifdef CONFIG_PM_SLEEP
54+
#ifdef CONFIG_FW_CACHE
5555
/*
5656
* Names of firmware images which have been cached successfully
5757
* will be added into the below list so that device uncache
@@ -557,7 +557,7 @@ static void fw_set_page_data(struct fw_priv *fw_priv, struct firmware *fw)
557557
(unsigned int)fw_priv->size);
558558
}
559559

560-
#ifdef CONFIG_PM_SLEEP
560+
#ifdef CONFIG_FW_CACHE
561561
static void fw_name_devm_release(struct device *dev, void *res)
562562
{
563563
struct fw_name_devm *fwn = res;
@@ -1047,7 +1047,7 @@ request_firmware_nowait(
10471047
}
10481048
EXPORT_SYMBOL(request_firmware_nowait);
10491049

1050-
#ifdef CONFIG_PM_SLEEP
1050+
#ifdef CONFIG_FW_CACHE
10511051
static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain);
10521052

10531053
/**

0 commit comments

Comments
 (0)