[MODAP-55016][COMMON] driver: chub: No new thread when running
authorSukwon Ryoo <sw.ryoo@samsung.com>
Fri, 15 Nov 2019 03:53:59 +0000 (12:53 +0900)
committerlulu2 <lulu2@lenovo.com>
Fri, 15 Nov 2019 07:11:53 +0000 (15:11 +0800)
Change-Id: I69d2ff453d915dc50f8d005c4f52bac86cb05fe7
Signed-off-by: Sukwon Ryoo <sw.ryoo@samsung.com>
drivers/staging/nanohub/chub.c
drivers/staging/nanohub/main.c

index 39174abb45794e2d42a64a301ee90f28d243b722..688b69bba1538a8b3e0609cb5226561ad6aab130 100644 (file)
@@ -1047,9 +1047,11 @@ int contexthub_poweron(struct contexthub_ipc_info *ipc)
                                        atomic_read(&ipc->chub_status), ret, ipc->poweron_lock.flag);
                        }
                }
-       }
+       } else
+       /* CHUB already went through poweron sequence */
+               return -EINVAL;
 
-       return ret;
+       return 0;
 }
 
 static int contexthub_download_and_check_image(struct contexthub_ipc_info *ipc, enum ipc_region reg)
index 64717c56ab45a4803c08baf6ded3183f2aa17038..4fffce08e6e7034445605b28e11dc3f0e8194095 100644 (file)
@@ -1351,8 +1351,8 @@ static int nanohub_open(struct inode *inode, struct file *file)
                nonseekable_open(inode, file);
 #ifdef CONFIG_NANOHUB_MAILBOX
                io = file->private_data;
-               nanohub_reset(io->data);
-               io->data->thread = kthread_run(nanohub_kthread, io->data, "nanohub");
+               if (!nanohub_reset(io->data))
+                       io->data->thread = kthread_run(nanohub_kthread, io->data, "nanohub");
                udelay(30);
 #endif
                return 0;