From 7b375bda9a023730ee7cbdf1dcfe1d2fa044bdb9 Mon Sep 17 00:00:00 2001 From: Zhou Peng Date: Thu, 13 Sep 2018 10:37:48 +0800 Subject: [PATCH] MLK-19561: [i.MX8MQ/Hantro]: Avoid wrong HW state caused by unexpected event break Replace wait_event_interruptible_timeout()/wake_up_interruptible_all() with wait_event_timeout()/wake_up_all() So one complete decode process is guaranteed Signed-off-by: Zhou Peng (cherry picked from commit b054e4005139c31b764de39c347d9c7c34143b22) --- drivers/mxc/hantro/hantrodec.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/mxc/hantro/hantrodec.c b/drivers/mxc/hantro/hantrodec.c index 0346a06fbb15..e3f60ce39844 100755 --- a/drivers/mxc/hantro/hantrodec.c +++ b/drivers/mxc/hantro/hantrodec.c @@ -1,7 +1,7 @@ /***************************************************************************** * The GPL License (GPL) * - * Copyright (c) 2015-2017, VeriSilicon Inc. + * Copyright (c) 2015-2018, VeriSilicon Inc. * Copyright (c) 2011-2014, Google Inc. * * This program is free software; you can redistribute it and/or @@ -817,12 +817,13 @@ long WaitDecReadyAndRefreshRegs(hantrodec_t *dev, struct core_desc *Core) PDEBUG("wait_event_interruptible DEC[%d]\n", id); - ret = wait_event_interruptible_timeout(dec_wait_queue, CheckDecIrq(dev, id), msecs_to_jiffies(200)); + //ret = wait_event_interruptible_timeout(dec_wait_queue, CheckDecIrq(dev, id), msecs_to_jiffies(200)); + ret = wait_event_timeout(dec_wait_queue, CheckDecIrq(dev, id), msecs_to_jiffies(200)); if (ret == -ERESTARTSYS) { - pr_err("DEC[%d] failed to wait_event_interruptible interrupted\n", id); + pr_err("DEC[%d] failed to wait_event interrupted\n", id); return -ERESTARTSYS; } else if (ret == 0) { - pr_err("DEC[%d] wait_event_interruptible timeout\n", id); + pr_err("DEC[%d] wait_event timeout\n", id); timeout = 1; } @@ -1669,7 +1670,8 @@ irqreturn_t hantrodec_isr(int irq, void *dev_id) dec_irq |= (1 << i); - wake_up_interruptible_all(&dec_wait_queue); + //wake_up_interruptible_all(&dec_wait_queue); + wake_up_all(&dec_wait_queue); handled++; } }