lkml.org 
[lkml]   [2012]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 12/13] driver core: firmware loader: use small timeout for cache device firmware
Date
Because device_cache_firmwares only cache the firmware which has been
loaded sucessfully at leat once, using a small loading timeout should
be OK.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/base/firmware_class.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 7a96e75..0918b26 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -1130,10 +1130,19 @@ static void device_cache_firmwares(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 devces firmwares
+ * because all these firmwares have been loaded successfully
+ * at lease once
+ */
+ old_timeout = loading_timeout;
+ loading_timeout = 10;
+
device_pm_lock();
list_for_each_entry(dev, &dpm_list, power.entry)
dev_cache_firmware(dev);
@@ -1157,6 +1166,8 @@ static void device_cache_firmwares(void)
}
spin_unlock(&fwc->name_lock);
finish_wait(&fwc->wait_queue, &wait);
+
+ loading_timeout = old_timeout;
}

/**
--
1.7.9.5


\
 
 \ /
  Last update: 2012-07-24 19:41    [W:0.329 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site