Re: [PATCH v6 07/11] drm/mediatek: dp: Avoid mutex locks if audio is not supported/enabled

From: Alexandre Mergnat
Date: Thu Jul 20 2023 - 09:05:09 EST




On 17/07/2023 16:14, AngeloGioacchino Del Regno wrote:
If a controller (usually, eDP!) does not support audio, or audio is not
enabled because the endpoint has no audio support, it's useless to lock
a mutex only to unlock it right after because there's no .plugged_cb().

Check if the audio is supported and enabled before locking the mutex in
mtk_dp_update_plugged_status(): if not, we simply return immediately.

While at it, since the update_plugged_status_lock mutex would not be
used if the controller doesn't support audio at all, initialize it
only if `audio_supported` is true.

Reviewed-by: Alexandre Mergnat <amergnat@xxxxxxxxxxxx>

--
Regards,
Alexandre