From 9090c9e65902f29b4464c37bfb76bc59cdbdf7a4 Mon Sep 17 00:00:00 2001 From: Sukwon Ryoo Date: Fri, 15 Nov 2019 12:53:59 +0900 Subject: [PATCH] [MODAP-55016][COMMON] driver: chub: No new thread when running Change-Id: I69d2ff453d915dc50f8d005c4f52bac86cb05fe7 Signed-off-by: Sukwon Ryoo --- drivers/staging/nanohub/chub.c | 6 ++++-- drivers/staging/nanohub/main.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/nanohub/chub.c b/drivers/staging/nanohub/chub.c index 39174abb4579..688b69bba153 100644 --- a/drivers/staging/nanohub/chub.c +++ b/drivers/staging/nanohub/chub.c @@ -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) diff --git a/drivers/staging/nanohub/main.c b/drivers/staging/nanohub/main.c index 64717c56ab45..4fffce08e6e7 100644 --- a/drivers/staging/nanohub/main.c +++ b/drivers/staging/nanohub/main.c @@ -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; -- 2.20.1