[RFC PATCH 12/13] driver core: firmware loader: use small timeout for cache device firmware

From: Ming Lei
Date: Tue Jul 24 2012 - 13:01:41 EST


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@xxxxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/