aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/firmware_class.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2012-08-04 12:01:28 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-16 13:44:44 -0700
commitffe53f6f388a3aaa208e7c45065ce096d5d2f4e9 (patch)
treea2e469fca43b4cf677e04de8b7128c1d2693d934 /drivers/base/firmware_class.c
parent37276a51f803ef63be988e26293ac85188475556 (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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 68fd4c698c7..8ca00524d58 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -1146,10 +1146,22 @@ static void device_cache_fw_images(void)
{
struct firmware_cache *fwc = &fw_cache;
struct device *dev;
+ int old_timeout;
DEFINE_WAIT(wait);
pr_debug("%s\n", __func__);
+ /*
+ * use small loading timeout for caching devices' firmware
+ * because all these firmware images have been loaded
+ * successfully at lease once, also system is ready for
+ * completing firmware loading now. The maximum size of
+ * firmware in current distributions is about 2M bytes,
+ * so 10 secs should be enough.
+ */
+ old_timeout = loading_timeout;
+ loading_timeout = 10;
+
device_pm_lock();
list_for_each_entry(dev, &dpm_list, power.entry)
dev_cache_fw_image(dev);
@@ -1171,6 +1183,8 @@ static void device_cache_fw_images(void)
}
spin_unlock(&fwc->name_lock);
finish_wait(&fwc->wait_queue, &wait);
+
+ loading_timeout = old_timeout;
}
/**