Maxime Ripard ac4ba79bb0 drm/vc4: hdmi: Make sure the device is powered with CEC
Commit 20b0dfa86bef0e80b41b0e5ac38b92f23b6f27f9 upstream.

The original commit depended on a rework commit (724fc856c09e ("drm/vc4:
hdmi: Split the CEC disable / enable functions in two")) that
(rightfully) didn't reach stable.

However, probably because the context changed, when the patch was
applied to stable the pm_runtime_put called got moved to the end of the
vc4_hdmi_cec_adap_enable function (that would have become
vc4_hdmi_cec_disable with the rework) to vc4_hdmi_cec_init.

This means that at probe time, we now drop our reference to the clocks
and power domains and thus end up with a CPU hang when the CPU tries to
access registers.

The call to pm_runtime_resume_and_get() is also problematic since the
.adap_enable CEC hook is called both to enable and to disable the
controller. That means that we'll now call pm_runtime_resume_and_get()
at disable time as well, messing with the reference counting.

The behaviour we should have though would be to have
pm_runtime_resume_and_get() called when the CEC controller is enabled,
and pm_runtime_put when it's disabled.

We need to move things around a bit to behave that way, but it aligns
stable with upstream.

Cc: <stable@vger.kernel.org> # 5.10.x
Cc: <stable@vger.kernel.org> # 5.15.x
Cc: <stable@vger.kernel.org> # 5.16.x
Reported-by: Michael Stapelberg <michael+drm@stapelberg.ch>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-05 12:37:55 +01:00
..
2021-07-19 09:44:58 +02:00
2020-09-23 09:52:24 +10:00
2020-08-11 11:58:31 +10:00
2020-09-08 14:41:40 +10:00
2020-08-06 14:27:31 -07:00
2020-09-08 14:41:40 +10:00
2021-05-14 09:50:22 +02:00
2022-01-27 10:53:57 +01:00
2021-11-26 10:39:20 +01:00
2020-09-11 10:47:19 +02:00
2021-05-11 14:47:26 +02:00
2020-05-27 14:31:42 +03:00
2020-08-25 11:00:02 +02:00
2020-09-21 10:45:08 +02:00
2020-05-29 12:58:11 +02:00
2020-09-21 10:45:08 +02:00
2020-08-11 11:58:31 +10:00
2020-08-25 11:00:02 +02:00
2020-06-24 15:45:51 +10:00
2021-03-30 14:31:51 +02:00