Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/dp: Delete the old 500 ms wait for eDP HPD in aux transfer

Before the introduction of the wait_hpd_asserted() callback in
commit 841d742f094e ("drm/dp: Add wait_hpd_asserted() callback to struct
drm_dp_aux") the API between panel drivers and DP AUX bus drivers was
that it was up to the AUX bus driver to wait for HPD in the transfer()
function.

Now wait_hpd_asserted() has been added. The two panel drivers that are
DP AUX endpoints use it. See commit 2327b13d6c47 ("drm/panel-edp: Take
advantage of wait_hpd_asserted() in struct drm_dp_aux") and
commit 3b5765df375c ("drm/panel: atna33xc20: Take advantage of
wait_hpd_asserted() in struct drm_dp_aux"). We've implemented
wait_hpd_asserted() in the MSM DP driver as of commit e2969ee30252
("drm/msm/dp: move of_dp_aux_populate_bus() to eDP probe()"). There is
no longer any reason for long wait in the AUX transfer() function.
Remove it.

NOTE: the wait_hpd_asserted() is listed as "optional". That means it's
optional for the DP AUX bus to implement. In the case of the MSM DP
driver we implement it so we can assume it will be called.

ALSO NOTE: the wait wasn't actually _hurting_ anything and wasn't even
causing long timeouts, but it's still nice to get rid of unneeded
code. Specificaly it's not truly needed because to handle other DP
drivers that can't power on as quickly (specifically parade-ps8640) we
already avoid DP AUX transfers for eDP panels that aren't powered
on. See commit 8df1ddb5bf11 ("drm/dp: Don't attempt AUX transfers when
eDP panels are not powered").

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/583130/
Link: https://lore.kernel.org/r/20240315143621.v2.3.I535606f6d4f7e3e5588bb75c55996f61980183cd@changeid
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Douglas Anderson and committed by
Dmitry Baryshkov
47be928d c8520d5e

-17
-17
drivers/gpu/drm/msm/dp/dp_aux.c
··· 316 316 goto exit; 317 317 } 318 318 319 - /* 320 - * For eDP it's important to give a reasonably long wait here for HPD 321 - * to be asserted. This is because the panel driver may have _just_ 322 - * turned on the panel and then tried to do an AUX transfer. The panel 323 - * driver has no way of knowing when the panel is ready, so it's up 324 - * to us to wait. For DP we never get into this situation so let's 325 - * avoid ever doing the extra long wait for DP. 326 - */ 327 - if (aux->is_edp) { 328 - ret = dp_catalog_aux_wait_for_hpd_connect_state(aux->catalog, 329 - 500000); 330 - if (ret) { 331 - DRM_DEBUG_DP("Panel not ready for aux transactions\n"); 332 - goto exit; 333 - } 334 - } 335 - 336 319 dp_aux_update_offset_and_segment(aux, msg); 337 320 dp_aux_transfer_helper(aux, msg, true); 338 321