]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: chips-media: wave5: Avoid race condition in the interrupt handler
authorJackson.lee <jackson.lee@chipsnmedia.com>
Tue, 17 Dec 2024 04:51:23 +0000 (13:51 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:38 +0000 (10:15 +0200)
commit76cab9f540cce46e8cf9a3189a20a40870e5d36c
treee43efe17e719bdf77e9b8c9a37211ca64ee9ffe4
parent7fafaf00cc5fd1fd7b828a1dc73bda79683b629b
media: chips-media: wave5: Avoid race condition in the interrupt handler

commit ac35f768986610480a1c01323d9cf9f5eaf3ee9b upstream.

In case of multiple active instances, new interrupts can occur as soon
as the current interrupt is cleared. If the driver reads the
instance_info after clearing the interrupt, then there is no guarantee,
that the instance_info is still valid for the current interrupt.

Read the instance_info register for each interrupt before clearing the
interrupt.

Fixes: ed7276ed2fd0 ("media: chips-media: wave5: Add hrtimer based polling support")
Cc: stable@vger.kernel.org
Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/chips-media/wave5/wave5-vpu.c