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
This commit is contained in:
Tim Murray 2016-10-20 13:53:58 -07:00 committed by Artem Borisov
parent a44f81c6a7
commit 6cbd3d6de6
2 changed files with 8 additions and 3 deletions

View file

@ -156,6 +156,11 @@ config FW_LOADER_USER_HELPER
no longer required unless you have a special firmware file that
resides in a non-standard path.
config FW_CACHE
bool "Enable firmware caching during suspend"
depends on PM_SLEEP
default n
config DEBUG_DRIVER
bool "Driver Core verbose debug messages"
depends on DEBUG_KERNEL

View file

@ -1534,7 +1534,7 @@ int uncache_firmware(const char *fw_name)
return -EINVAL;
}
#ifdef CONFIG_PM_SLEEP
#ifdef CONFIG_FW_CACHE
static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain);
static struct fw_cache_entry *alloc_fw_cache_entry(const char *name)
@ -1800,7 +1800,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);
@ -1827,7 +1827,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