]> www.infradead.org Git - users/jedix/linux-maple.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)
committerHans Verkuil <hverkuil@xs4all.nl>
Sat, 15 Feb 2025 10:18:42 +0000 (11:18 +0100)
commitac35f768986610480a1c01323d9cf9f5eaf3ee9b
treece49cddd4f9b7ec73d4080a3f710649217c7566c
parent6bae4d5053da634eecb611118e7cd91a677a4bbf
media: chips-media: wave5: Avoid race condition in the interrupt handler

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>
drivers/media/platform/chips-media/wave5/wave5-vpu.c