drm/vc4: hdmi: Drop devm interrupt handler for hotplug interrupts
authorMaxime Ripard <maxime@cerno.tech>
Mon, 5 Jul 2021 15:31:48 +0000 (17:31 +0200)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Tue, 6 Jul 2021 10:56:31 +0000 (11:56 +0100)
commitc6fa884e792822e33789622bbb74831f54e02529
treef7b233c44f02faf82bc5e3a85ea503bd465e1e46
parente6fa19ad1503290bbebe821e4c18c9b0e5666f0b
drm/vc4: hdmi: Drop devm interrupt handler for hotplug interrupts

The hotplugs interrupt handlers are registered through the
devm_request_threaded_irq function. However, while free_irq is indeed
called properly when the device is unbound or bind fails, it's called
after unbind or bind is done.

In our particular case, it means that on failure it creates a window
where our interrupt handler can be called, but we're freeing every
resource (CEC adapter, DRM objects, etc.) it might need.

In order to address this, let's switch to the non-devm variant to
control better when the handler will be unregistered and allow us to
make it safe.

Fixes: f4790083c7c2 ("drm/vc4: hdmi: Rely on interrupts to handle hotplug")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_hdmi.c