From: Prathyush K Date: Tue, 21 Oct 2014 11:06:57 +0000 (-0300) Subject: [media] s5p-mfc: clear 'enter_suspend' flag if suspend fails X-Git-Tag: v5.15~16478^2~371 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=643709941d152a8dee58f5ea9f9e19d3f1725722;p=platform%2Fkernel%2Flinux-starfive.git [media] s5p-mfc: clear 'enter_suspend' flag if suspend fails The enter_suspend flag is set after we enter mfc suspend function but if suspend fails after that due to any reason (like hardware timeout etc), this flag must be cleared before returning an error. Otherwise, this flag never gets cleared and the MFC suspend will always return an error on subsequent tries. If clock off fails, disable hw_lock also. Signed-off-by: Prathyush K Signed-off-by: Kiran AVND Signed-off-by: Arun Kumar K Signed-off-by: Kamil Debski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 165bc86..79c9537 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1284,11 +1284,17 @@ static int s5p_mfc_suspend(struct device *dev) m_dev->int_cond, msecs_to_jiffies(MFC_INT_TIMEOUT)); if (ret == 0) { mfc_err("Waiting for hardware to finish timed out\n"); + clear_bit(0, &m_dev->enter_suspend); return -EIO; } } - return s5p_mfc_sleep(m_dev); + ret = s5p_mfc_sleep(m_dev); + if (ret) { + clear_bit(0, &m_dev->enter_suspend); + clear_bit(0, &m_dev->hw_lock); + } + return ret; } static int s5p_mfc_resume(struct device *dev)