aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/firmware_class.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-05-27 06:30:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-03 17:02:13 -0400
commite771d1aafb92aebe46fcd30d30afa504faee4335 (patch)
tree955a4f222e39d60a44ad65045e918ad2caea5925 /drivers/base/firmware_class.c
parentf8878dcb84f7eb85b11c6be9d7d2581a88675615 (diff)
driver core: firmware loader: don't cache FW_ACTION_NOHOTPLUG firmware
Generally there are only two drivers which don't need uevent to handle firmware loading, so don't cache these firmwares during suspend for these drivers since doing that may block firmware loading forever. Both the two drivers are involved in private firmware images, so they don't hit in direct loading too. Signed-off-by: Ming Lei <ming.lei@canonical.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r--drivers/base/firmware_class.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index e704bf84bdf3..f3c6434b586b 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -993,7 +993,8 @@ _request_firmware_prepare(struct firmware **firmware_p, const char *name,
993 return 1; /* need to load */ 993 return 1; /* need to load */
994} 994}
995 995
996static int assign_firmware_buf(struct firmware *fw, struct device *device) 996static int assign_firmware_buf(struct firmware *fw, struct device *device,
997 bool skip_cache)
997{ 998{
998 struct firmware_buf *buf = fw->priv; 999 struct firmware_buf *buf = fw->priv;
999 1000
@@ -1010,7 +1011,7 @@ static int assign_firmware_buf(struct firmware *fw, struct device *device)
1010 * device may has been deleted already, but the problem 1011 * device may has been deleted already, but the problem
1011 * should be fixed in devres or driver core. 1012 * should be fixed in devres or driver core.
1012 */ 1013 */
1013 if (device) 1014 if (device && !skip_cache)
1014 fw_add_devm_name(device, buf->fw_id); 1015 fw_add_devm_name(device, buf->fw_id);
1015 1016
1016 /* 1017 /*
@@ -1066,8 +1067,10 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
1066 if (!fw_get_filesystem_firmware(device, fw->priv)) 1067 if (!fw_get_filesystem_firmware(device, fw->priv))
1067 ret = fw_load_from_user_helper(fw, name, device, 1068 ret = fw_load_from_user_helper(fw, name, device,
1068 uevent, nowait, timeout); 1069 uevent, nowait, timeout);
1070
1071 /* don't cache firmware handled without uevent */
1069 if (!ret) 1072 if (!ret)
1070 ret = assign_firmware_buf(fw, device); 1073 ret = assign_firmware_buf(fw, device, !uevent);
1071 1074
1072 usermodehelper_read_unlock(); 1075 usermodehelper_read_unlock();
1073 1076