summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2016-10-20 13:53:58 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-07-17 03:21:57 -0700
commit8be65bee667c18fdccdc185ab8135a66d5b6004e (patch)
tree6fd08dca07e7f737871a5287608df7f713ced9e6
parent385635a167a7f7b8d7e8501e782e173244b7cdf3 (diff)
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. bug 32180327 Change-Id: I1250512b27edb56caa78d536e5ccf1fb669476ad Signed-off-by: Tim Murray <timmurray@google.com> Git-repo: https://source.codeaurora.org/quic/la/kernel/msm-4.4 Git-commit: e3198d51be98ec5606e2a2c5112a8a974d354fbc Signed-off-by: Chintan Pandya <cpandya@codeaurora.org> Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
-rw-r--r--drivers/base/Kconfig5
-rw-r--r--drivers/base/firmware_class.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 59992788966c..602cbb04bee8 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -165,6 +165,11 @@ config FW_LOADER_USER_HELPER_FALLBACK
If you are unsure about this, say N here.
+config FW_CACHE
+ bool "Enable firmware caching during suspend"
+ depends on PM_SLEEP
+ default n
+
config WANT_DEV_COREDUMP
bool
help
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index a1696e1d199f..c1093c0d4dea 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -1148,7 +1148,7 @@ static int fw_load_from_user_helper(struct firmware *firmware,
return _request_firmware_load(fw_priv, desc->opt_flags, timeout);
}
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_FW_CACHE
/* kill pending requests without uevent to avoid blocking suspend */
static void kill_requests_without_uevent(void)
{
@@ -1626,7 +1626,7 @@ request_firmware_nowait_into_buf(
}
EXPORT_SYMBOL_GPL(request_firmware_nowait_into_buf);
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_FW_CACHE
static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain);
/**
@@ -1972,7 +1972,7 @@ static void __init fw_cache_init(void)
INIT_LIST_HEAD(&fw_cache.head);
fw_cache.state = FW_LOADER_NO_CACHE;
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_FW_CACHE
spin_lock_init(&fw_cache.name_lock);
INIT_LIST_HEAD(&fw_cache.fw_names);
@@ -1999,7 +1999,7 @@ static int __init firmware_class_init(void)
static void __exit firmware_class_exit(void)
{
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_FW_CACHE
unregister_syscore_ops(&fw_syscore_ops);
unregister_pm_notifier(&fw_cache.pm_notify);
#endif