aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrathyush K <prathyush.k@samsung.com>2014-10-21 07:06:57 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-28 13:42:43 -0400
commit643709941d152a8dee58f5ea9f9e19d3f1725722 (patch)
tree81615edffa8ea16b2737b13c71896a7c7b325ed5
parent53c51492d6e800fad07cb0fdaf68a5515ebf3058 (diff)
[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 <prathyush.k@samsung.com> Signed-off-by: Kiran AVND <avnd.kiran@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 165bc86c5962..79c953779fe9 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)
1284 m_dev->int_cond, msecs_to_jiffies(MFC_INT_TIMEOUT)); 1284 m_dev->int_cond, msecs_to_jiffies(MFC_INT_TIMEOUT));
1285 if (ret == 0) { 1285 if (ret == 0) {
1286 mfc_err("Waiting for hardware to finish timed out\n"); 1286 mfc_err("Waiting for hardware to finish timed out\n");
1287 clear_bit(0, &m_dev->enter_suspend);
1287 return -EIO; 1288 return -EIO;
1288 } 1289 }
1289 } 1290 }
1290 1291
1291 return s5p_mfc_sleep(m_dev); 1292 ret = s5p_mfc_sleep(m_dev);
1293 if (ret) {
1294 clear_bit(0, &m_dev->enter_suspend);
1295 clear_bit(0, &m_dev->hw_lock);
1296 }
1297 return ret;
1292} 1298}
1293 1299
1294static int s5p_mfc_resume(struct device *dev) 1300static int s5p_mfc_resume(struct device *dev)