]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: hdmi: Add a spinlock to protect register access
authorMaxime Ripard <maxime@cerno.tech>
Mon, 25 Oct 2021 14:11:08 +0000 (16:11 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Fri, 5 Nov 2021 11:53:24 +0000 (12:53 +0100)
commitd32fb78f6c151a7e5dd46d8ced907d931027c40a
treec675e4bee7f906a53c186e7c2d28b5a69f84afbd
parente50b34da647de8ebc4c56a6675f7227b42dd60ad
drm/vc4: hdmi: Add a spinlock to protect register access

The vc4 HDMI driver has multiple path shared between the CEC, ALSA and
KMS frameworks, plus two interrupt handlers (CEC and hotplug) that will
read and modify a number of registers.

Even though not bug has been reported so far, it's definitely unsafe, so
let's just add a spinlock to protect the register access of the HDMI
controller.

Link: https://lore.kernel.org/r/20211025141113.702757-5-maxime@cerno.tech
Fixes: 9c9eb35d1fbd ("drm/vc4: Add KMS support for Raspberry Pi.")
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hdmi.h
drivers/gpu/drm/vc4/vc4_hdmi_phy.c
drivers/gpu/drm/vc4/vc4_hdmi_regs.h