]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: rkisp1: Fix IRQ handling due to shared interrupts
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 18 Dec 2023 07:54:01 +0000 (08:54 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:09 +0000 (18:19 -0400)
commitb39b4d207d4f236a74e20d291f6356f2231fd9ee
tree968cc8d3045a7c1cc649361510695cae716d82f4
parent2bbd65c6ca567ed8dbbfc4fb945f57ce64bef342
media: rkisp1: Fix IRQ handling due to shared interrupts

[ Upstream commit ffb635bb398fc07cb38f8a7b4a82cbe5f412f08e ]

The driver requests the interrupts as IRQF_SHARED, so the interrupt
handlers can be called at any time. If such a call happens while the ISP
is powered down, the SoC will hang as the driver tries to access the
ISP registers.

This can be reproduced even without the platform sharing the IRQ line:
Enable CONFIG_DEBUG_SHIRQ and unload the driver, and the board will
hang.

Fix this by adding a new field, 'irqs_enabled', which is used to bail
out from the interrupt handler when the ISP is not operational.

Link: https://lore.kernel.org/r/20231218-rkisp-shirq-fix-v1-2-173007628248@ideasonboard.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c