From: Sukwon Ryoo Date: Fri, 15 Nov 2019 03:53:59 +0000 (+0900) Subject: [MODAP-55016][COMMON] driver: chub: No new thread when running X-Git-Tag: MMI-QSB30.62-17~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=816d419d2aea1aa407346793719e4194de79f8aa;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [MODAP-55016][COMMON] driver: chub: No new thread when running Change-Id: I69d2ff453d915dc50f8d005c4f52bac86cb05fe7 Signed-off-by: Sukwon Ryoo --- 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;