From: MengLi <meng...@windriver.com> In thread svc_normal_to_secure_thread(), function kfifo_out_spinlocked() always return, so this thread can't release cpu even if there is no data received, and cause cpu is under heave load status. System performance is poor. Therefore, schedule this thread out when there is no data reveived, and wake it up after sending data to it.
Signed-off-by: Meng Li <meng...@windriver.com> --- drivers/misc/intel-service.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/misc/intel-service.c b/drivers/misc/intel-service.c index 4c63330..8aa2a24 100644 --- a/drivers/misc/intel-service.c +++ b/drivers/misc/intel-service.c @@ -278,6 +278,7 @@ int intel_svc_send(struct intel_svc_chan *chan, void *msg) ret = kfifo_in_spinlocked(&chan->ctrl->svc_fifo, p_data, sizeof(*p_data), &chan->ctrl->svc_fifo_lock); + wake_up_process(chan->ctrl->task); kfree(p_data); @@ -537,8 +538,10 @@ static int svc_normal_to_secure_thread(void *data) pdata, sizeof(*pdata), &ctrl->svc_fifo_lock); - if (!ret_fifo) + if (!ret_fifo) { + schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT); continue; + } pr_debug("get from FIFO pa=0x%016x, command=%u, size=%u\n", (unsigned int)pdata->paddr, pdata->command, -- 2.9.3 -- _______________________________________________ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto