Commit 030cc787 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Greg Kroah-Hartman

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: default avatarMark 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: default avatarLuis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20191113225429.118495-1-salyzyn@android.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bee3bbe6
...@@ -169,5 +169,17 @@ config FW_LOADER_COMPRESS ...@@ -169,5 +169,17 @@ config FW_LOADER_COMPRESS
be compressed with either none or crc32 integrity check type (pass be compressed with either none or crc32 integrity check type (pass
"-C crc32" option to xz command). "-C crc32" option to xz command).
config FW_CACHE
bool "Enable firmware caching during suspend"
depends on PM_SLEEP
default y if PM_SLEEP
help
Because firmware caching generates uevent messages that are sent
over a netlink socket, it can prevent suspend on many platforms.
It is also not always useful, so on such platforms we have the
option.
If unsure, say Y.
endif # FW_LOADER endif # FW_LOADER
endmenu endmenu
...@@ -51,7 +51,7 @@ struct firmware_cache { ...@@ -51,7 +51,7 @@ struct firmware_cache {
struct list_head head; struct list_head head;
int state; int state;
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_FW_CACHE
/* /*
* Names of firmware images which have been cached successfully * Names of firmware images which have been cached successfully
* will be added into the below list so that device uncache * 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) ...@@ -557,7 +557,7 @@ static void fw_set_page_data(struct fw_priv *fw_priv, struct firmware *fw)
(unsigned int)fw_priv->size); (unsigned int)fw_priv->size);
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_FW_CACHE
static void fw_name_devm_release(struct device *dev, void *res) static void fw_name_devm_release(struct device *dev, void *res)
{ {
struct fw_name_devm *fwn = res; struct fw_name_devm *fwn = res;
...@@ -1047,7 +1047,7 @@ request_firmware_nowait( ...@@ -1047,7 +1047,7 @@ request_firmware_nowait(
} }
EXPORT_SYMBOL(request_firmware_nowait); EXPORT_SYMBOL(request_firmware_nowait);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_FW_CACHE
static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain); static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment