drm/vc4: hdmi: Remove mutex in detect
authorMaxime Ripard <maxime@cerno.tech>
Thu, 28 Oct 2021 12:59:37 +0000 (14:59 +0200)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Mon, 19 Sep 2022 19:33:09 +0000 (20:33 +0100)
commit792a4ac53ae563255a8ad4c940e06d650d1c1334
tree06f491650ec9ea61b899f11fe203380ce5a391f8
parent957ae42fa28b04957c6ad64d87e3c736479275c5
drm/vc4: hdmi: Remove mutex in detect

We recently introduced a new mutex to protect concurrent execution of
ALSA and KMS hooks, and the concurrent access to some of vc4_hdmi
fields.

However, using it in the detect hook was creating a reentrency issue
with CEC code. Indeed, calling cec_s_phys_addr_from_edid from detect
might call the CEC adap_enable hook with the lock held, eventually
resulting in a deadlock.

Since we didn't really need to protect anything at the moment in the CEC
code, the decision was made to ignore the mutex in those CEC hooks,
working around the issue.

However, we can have the same thing happening if we end up triggering a
mode set from the detect callback, for example using
drm_atomic_helper_connector_hdmi_reset_link().

Since we don't really need to protect anything in detect either, let's
just drop the lock in detect, and add it again in CEC.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hdmi.h