media: vsp1: mask interrupts before enabling
authorNikita Yushchenko <nikita.yoush@cogentembedded.com>
Thu, 20 Jan 2022 08:15:30 +0000 (09:15 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 17 Feb 2022 09:28:42 +0000 (10:28 +0100)
commitc7cfc7b90e25468c98dfb1082474644f2a3e2df7
tree4254fb6e36ca74a5dddd027549e7d05b6169dbc3
parent53c264544dfce30f7741a2b1e78f90d046e5d8ff
media: vsp1: mask interrupts before enabling

VSP hardware could be used (e.g. by the bootloader) before driver load,
and some interrupts could be left in enabled and pending state. In this
case, setting up VSP interrupt handler without masking interrupts before
causes interrupt handler to be immediately called (and crash due to null
vsp->info dereference).

Fix that by explicitly masking all interrupts before setting the interrupt
handler. To do so, have to set the interrupt handler later, after hw
revision is already detected and number of interrupts to mask gets
known.

Based on patch by Koji Matsuoka <koji.matsuoka.xm@renesas.com> included
in the Renesas BSP kernel.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/vsp1/vsp1_drv.c