summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/dp/dp_ctrl.c
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2024-03-16 00:36:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-30 10:49:38 +0300
commite51e7096fd4e24a0c9de175a44875d46fa72eaff (patch)
tree2eb38a098be3309b22de3f032f27256f91967179 /drivers/gpu/drm/msm/dp/dp_ctrl.c
parent67032a7f2e8a0218daaa0827c9f9c812a069b3f8 (diff)
downloadlinux-e51e7096fd4e24a0c9de175a44875d46fa72eaff.tar.xz
drm/msm/dp: Avoid a long timeout for AUX transfer if nothing connected
[ Upstream commit 5d1a7493343cc00d9019880b686e4e0a0f649531 ] As documented in the description of the transfer() function of "struct drm_dp_aux", the transfer() function can be called at any time regardless of the state of the DP port. Specifically if the kernel has the DP AUX character device enabled and userspace accesses "/dev/drm_dp_auxN" directly then the AUX transfer function will be called regardless of whether a DP device is connected. For eDP panels we have a special rule where we wait (with a 5 second timeout) for HPD to go high. This rule was important before all panels drivers were converted to call wait_hpd_asserted() and actually can be removed in a future commit. For external DP devices we never checked for HPD. That means that trying to access the DP AUX character device (AKA `hexdump -C /dev/drm_dp_auxN`) would very, very slowly timeout. Specifically on my system: $ time hexdump -C /dev/drm_dp_aux0 hexdump: /dev/drm_dp_aux0: Connection timed out real 0m8.200s We want access to the drm_dp_auxN character device to fail faster than 8 seconds when no DP cable is plugged in. Let's add a test to make transfers fail right away if a device isn't plugged in. Rather than testing the HPD line directly, we have the dp_display module tell us when AUX transfers should be enabled so we can handle cases where HPD is signaled out of band like with Type C. Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/583127/ Link: https://lore.kernel.org/r/20240315143621.v2.1.I16aff881c9fe82b5e0fc06ca312da017aa7b5b3e@changeid Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/msm/dp/dp_ctrl.c')
0 files changed, 0 insertions, 0 deletions