summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2012-08-14 12:13:51 +0300
committerXavier Boudet <x-boudet@ti.com>2012-08-14 14:41:13 +0200
commit0c76dba0c24ea4438b8097d2730fced4442faf5e (patch)
tree0621c276df9861cec07f9d57c9d3a0789c75efd6
parent3436750bbcd0c9628a66548ec7bcceeb00b45abd (diff)
remoteproc: sleep between request_firmware retrys
request_firmware() can return immediately e.g. if firmware file is not present. Sleep before retrys so that we don't hog the CPU if firmware is not available. This patch also prevents console flooding with WARNINGS if the firmware does not exist and the system is suspended. [ 37.491149] ------------[ cut here ]------------ [ 37.491149] WARNING: at drivers/base/firmware_class.c:597 request_firmware+0x58/0xcc() [ 37.491149] Modules linked in: omap_remoteproc remoteproc omap_rpmsg_resmgr rpmsg_resmgr virtio_rpmsg_bus arc4 wl12xx wlcore mac80211 cfg80211 wlcore_sdio [ 37.491180] Backtrace: [ 37.491180] [<c0012cb0>] (dump_backtrace+0x0/0x118) from [<c0497af0>] (dump_stack+0x20/0x24) [ 37.491180] r6:c05d7c73 r5:00000255 r4:00000000 r3:00000000 [ 37.491210] [<c0497ad0>] (dump_stack+0x0/0x24) from [<c003e4f4>] (warn_slowpath_common+0x5c/0x74) [ 37.491210] [<c003e498>] (warn_slowpath_common+0x0/0x74) from [<c003e538>] (warn_slowpath_null+0x2c/0x34) [ 37.491241] r8:ed73e200 r7:fffffff5 r6:ed698c28 r5:c05b7e54 r4:edb57f8c [ 37.491241] r3:00000009 [ 37.491241] [<c003e50c>] (warn_slowpath_null+0x0/0x34) from [<c02bcf20>] (request_firmware+0x58/0xcc) [ 37.491271] [<c02bcec8>] (request_firmware+0x0/0xcc) from [<bf109d1c>] (rproc_loader_thread+0x74/0xf0 [remoteproc]) [ 37.491271] r8:ed698c30 r7:ffffb2a4 r6:ed698c28 r5:ed698c00 r4:fffffff5 [ 37.491302] [<bf109ca8>] (rproc_loader_thread+0x0/0xf0 [remoteproc]) from [<c005d900>] (kthread+0x98/0xa4) [ 37.491333] r8:00000000 r7:bf109ca8 r6:edb57fc4 r5:ed698c00 r4:ed6f1da8 [ 37.491333] [<c005d868>] (kthread+0x0/0xa4) from [<c00425a8>] (do_exit+0x0/0x78c) [ 37.491363] r7:00000013 r6:c00425a8 r5:c005d868 r4:ed6f1da8 [ 37.491363] ---[ end trace 267d532979540df3 ]--- Signed-off-by: Roger Quadros <rogerq@ti.com>
-rw-r--r--drivers/remoteproc/remoteproc_core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 75bc564cca27..a44c5e480b2a 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1946,6 +1946,7 @@ static int rproc_loader_thread(struct rproc *rproc)
/* make some retries in case FS is not up yet */
do {
ret = request_firmware(&fw, rproc->firmware, dev);
+ msleep(2000);
} while (ret && time_after(to, jiffies));
if (ret || !fw) {