]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
remoteproc: Reduce asynchronous request_firmware to auto-boot only
authorSarangdhar Joshi <spjoshi@codeaurora.org>
Tue, 24 Jan 2017 23:13:00 +0000 (15:13 -0800)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 6 Feb 2017 21:05:22 +0000 (13:05 -0800)
The rproc_add_virtio_devices() requests firmware asynchronously and
triggers boot if the auto_boot flag is set. However, this
asynchronous call seems to be redundant for non auto-boot scenario
since the rproc_boot() would call request_firmware() anyways. Move
the auto_boot check to rproc_add() so that a redundant call to
_request_firmware can be avoided for non auto-boot case.

Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/remoteproc_core.c

index a7ee05006ccacef43bd44d654b2c58b54c72cd68..a112f5969d4a28bd82217759991be314466daa6d 100644 (file)
@@ -972,9 +972,7 @@ static void rproc_fw_config_virtio(const struct firmware *fw, void *context)
 {
        struct rproc *rproc = context;
 
-       /* if rproc is marked always-on, request it to boot */
-       if (rproc->auto_boot)
-               rproc_boot(rproc);
+       rproc_boot(rproc);
 
        release_firmware(fw);
 }
@@ -1286,9 +1284,13 @@ int rproc_add(struct rproc *rproc)
 
        /* create debugfs entries */
        rproc_create_debug_dir(rproc);
-       ret = rproc_add_virtio_devices(rproc);
-       if (ret < 0)
-               return ret;
+
+       /* if rproc is marked always-on, request it to boot */
+       if (rproc->auto_boot) {
+               ret = rproc_add_virtio_devices(rproc);
+               if (ret < 0)
+                       return ret;
+       }
 
        /* expose to rproc_get_by_phandle users */
        mutex_lock(&rproc_list_mutex);