remoteproc: shutdown before rpmsg deinit
authorWendy Liang <jliang@xilinx.com>
Tue, 9 Aug 2016 23:10:27 +0000 (16:10 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:47 +0000 (22:01 -0700)
As the rpmsg deinit will delete the remoteproc,
will need to shutdown the remote before the remoteproc
is deleted.

There should be another fix to do the shutdown after
rpmsg channels shutdown but before deleting the remoteproc.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/remoteproc/remoteproc.c

index 723cd5d9ff33485bbdb6393a6ffe8735bc5b380d..d66b20c718ace55eafab0d91d55cdbcfec02cc66 100644 (file)
@@ -337,12 +337,13 @@ int remoteproc_shutdown(struct remote_proc *rproc)
 {
 
        if (rproc) {
+               if (rproc->proc) {
+                       hil_shutdown_cpu(rproc->proc);
+               }
                if (rproc->rdev) {
                        rpmsg_deinit(rproc->rdev);
                        rproc->rdev = RPROC_NULL;
-               }
-               if (rproc->proc) {
-                       hil_shutdown_cpu(rproc->proc);
+                       rproc->proc = RPROC_NULL;
                }
        }