diff options
author | Ming Lei <ming.lei@canonical.com> | 2012-08-04 00:01:28 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-16 16:44:44 -0400 |
commit | ffe53f6f388a3aaa208e7c45065ce096d5d2f4e9 (patch) | |
tree | a2e469fca43b4cf677e04de8b7128c1d2693d934 /drivers/base/firmware_class.c | |
parent | 37276a51f803ef63be988e26293ac85188475556 (diff) |
firmware loader: use small timeout for cache device firmware
Because device_cache_fw_images only cache the firmware which has been
loaded sucessfully at leat once, using a small loading timeout should
be reasonable.
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r-- | drivers/base/firmware_class.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 68fd4c698c77..8ca00524d58f 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -1146,10 +1146,22 @@ static void device_cache_fw_images(void) | |||
1146 | { | 1146 | { |
1147 | struct firmware_cache *fwc = &fw_cache; | 1147 | struct firmware_cache *fwc = &fw_cache; |
1148 | struct device *dev; | 1148 | struct device *dev; |
1149 | int old_timeout; | ||
1149 | DEFINE_WAIT(wait); | 1150 | DEFINE_WAIT(wait); |
1150 | 1151 | ||
1151 | pr_debug("%s\n", __func__); | 1152 | pr_debug("%s\n", __func__); |
1152 | 1153 | ||
1154 | /* | ||
1155 | * use small loading timeout for caching devices' firmware | ||
1156 | * because all these firmware images have been loaded | ||
1157 | * successfully at lease once, also system is ready for | ||
1158 | * completing firmware loading now. The maximum size of | ||
1159 | * firmware in current distributions is about 2M bytes, | ||
1160 | * so 10 secs should be enough. | ||
1161 | */ | ||
1162 | old_timeout = loading_timeout; | ||
1163 | loading_timeout = 10; | ||
1164 | |||
1153 | device_pm_lock(); | 1165 | device_pm_lock(); |
1154 | list_for_each_entry(dev, &dpm_list, power.entry) | 1166 | list_for_each_entry(dev, &dpm_list, power.entry) |
1155 | dev_cache_fw_image(dev); | 1167 | dev_cache_fw_image(dev); |
@@ -1171,6 +1183,8 @@ static void device_cache_fw_images(void) | |||
1171 | } | 1183 | } |
1172 | spin_unlock(&fwc->name_lock); | 1184 | spin_unlock(&fwc->name_lock); |
1173 | finish_wait(&fwc->wait_queue, &wait); | 1185 | finish_wait(&fwc->wait_queue, &wait); |
1186 | |||
1187 | loading_timeout = old_timeout; | ||
1174 | } | 1188 | } |
1175 | 1189 | ||
1176 | /** | 1190 | /** |