soc: ti: wkup_m3_ipc: Fix race condition with rproc_boot
[rpmsg/hwspinlock.git] / drivers / soc / ti / wkup_m3_ipc.c
index 9f0154e3838114a9010d7497fdd10d08f17d6ed4..fc386e932f3c26bc4f77824f375c5204ea84e693 100644 (file)
@@ -532,6 +532,8 @@ static void wkup_m3_rproc_boot_thread(struct wkup_m3_ipc *m3_ipc)
        ret = rproc_boot(m3_ipc->rproc);
        if (ret)
                dev_err(dev, "rproc_boot failed\n");
+       else
+               m3_ipc_state = m3_ipc;
 
        do_exit(0);
 }
@@ -636,8 +638,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
                goto err_put_rproc;
        }
 
-       m3_ipc_state = m3_ipc;
-
        return 0;
 
 err_put_rproc: