]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: hdmi: Drop devm interrupt handler for hotplug interrupts
authorMaxime Ripard <maxime@cerno.tech>
Wed, 7 Jul 2021 09:51:11 +0000 (11:51 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 15 Jul 2021 08:50:05 +0000 (10:50 +0200)
commit34f8f6cf503cc4b61008fbbefb45af013710a032
tree050e9c1e736774f37808f6a20a5dd3d67604b763
parent8eb215410ce8ea9d27a9375a3ae288c21da02134
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: 440c043d1745 ("drm/vc4: hdmi: Rely on interrupts to handle hotplug")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210707095112.1469670-3-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_hdmi.c