]> git.baikalelectronics.ru Git - kernel.git/commit
media: cedrus: Fix watchdog race condition
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 18 Aug 2022 20:33:06 +0000 (22:33 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 30 Aug 2022 12:45:10 +0000 (14:45 +0200)
commit247c17a190a21d6610616a5a22527b95bf501a5f
treeecffc3e9bc8298933aab897dadd909a908a6c712
parentc5adf6c810112e42232e1984302783e08555ec5c
media: cedrus: Fix watchdog race condition

The watchdog needs to be scheduled before we trigger the decode
operation, otherwise there is a risk that the decoder IRQ will be
called before we have schedule the watchdog. As a side effect, the
watchdog would never be cancelled and its function would be called
at an inappropriate time.

This was observed while running Fluster with GStreamer as a backend.
Some programming error would cause the decoder IRQ to be call very
quickly after the trigger. Later calls into the driver would deadlock
due to the unbalanced state.

Cc: stable@vger.kernel.org
Fixes: 4de968aa4935 ("media: cedrus: Add watchdog for job completion")
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/sunxi/cedrus/cedrus_dec.c