]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: crtc: Fix runtime_pm reference counting
authorMaxime Ripard <maxime@cerno.tech>
Thu, 3 Feb 2022 10:20:03 +0000 (11:20 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 17 Feb 2022 16:27:59 +0000 (17:27 +0100)
commitb0f99d598d9ea436d4db7ffefb93863a8f1a8b63
tree60b2ad4161541bb569509a104b44ddc11fcb1f8d
parentfd6c86168b784ccbac39026d0a752cb45cd79bd8
drm/vc4: crtc: Fix runtime_pm reference counting

At boot on the BCM2711, if the HDMI controllers are running, the CRTC
driver will disable itself and its associated HDMI controller to work
around a hardware bug that would leave some pixels stuck in a FIFO.

In order to avoid that issue, we need to run some operations in lockstep
between the CRTC and HDMI controller, and we need to make sure the HDMI
controller will be powered properly.

However, since we haven't enabled it through KMS, the runtime_pm state
is off at this point so we need to make sure the device is powered
through pm_runtime_resume_and_get, and once the operations are complete,
we call pm_runtime_put.

However, the HDMI controller will do that itself in its
post_crtc_powerdown, which means we'll end up calling pm_runtime_put for
a single pm_runtime_get, throwing the reference counting off. Let's
remove the pm_runtime_put call in the CRTC code in order to have the
proper counting.

Fixes: 575eecc6ee80 ("drm/vc4: crtc: Make sure the HDMI controller is powered when disabling")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220203102003.1114673-1-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_crtc.c