[media] s5p-mfc: fix a race in interrupt flags handling
authorPawel Osciak <posciak@chromium.org>
Tue, 21 Oct 2014 11:07:07 +0000 (08:07 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 28 Oct 2014 17:54:11 +0000 (15:54 -0200)
commitf2035364ccbf357ae23bddd6ebf67b35ecdc6a67
treee925b74b860b2dd0ff8cb81061ba4c0c7383213f
parent9841dde5d965963cb9d0548054bc2f408cf7d8d5
[media] s5p-mfc: fix a race in interrupt flags handling

Interrupt result flags have to be cleared before a hardware job is run.
Otherwise, if they are cleared asynchronously, we may end up clearing them
after the interrupt for which we wanted to wait has already arrived, thus
overwriting the job results that we intended to wait for.

To prevent this, clear the flags only under hw_lock and before running
a hardware job.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
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>
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c