aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2020-06-29 14:00:32 +0800
committerPaul Gortmaker <paul.gortmaker@windriver.com>2020-07-24 16:24:27 -0400
commitd1e45c3d10b585850a811b3c8300890dce3f96ef (patch)
treeb4ba7d3c72e75374c06f1a74ac93a46a4f541416
parent301b86e3e565aff0f63df6886edf9bad3190e200 (diff)
downloadlinux-yocto-d1e45c3d10b585850a811b3c8300890dce3f96ef.tar.gz
linux-yocto-d1e45c3d10b585850a811b3c8300890dce3f96ef.tar.bz2
linux-yocto-d1e45c3d10b585850a811b3c8300890dce3f96ef.zip
drm: sun4i: hdmi: Remove extra HPD polling
commit bda8eaa6dee7525f4dac950810a85a88bf6c2ba0 upstream. The HPD sense mechanism in Allwinner's old HDMI encoder hardware is more or less an input-only GPIO. Other GPIO-based HPD implementations directly return the current state, instead of polling for a specific state and returning the other if that times out. Remove the I/O polling from sun4i_hdmi_connector_detect() and directly return a known state based on the current reading. This also gets rid of excessive CPU usage by kworker as reported on Stack Exchange [1] and Armbian forums [2]. [1] https://superuser.com/questions/1515001/debian-10-buster-on-cubietruck-with-bug-in-sun4i-drm-hdmi [2] https://forum.armbian.com/topic/14282-headless-systems-and-sun4i_drm_hdmi-a10a20/ Fixes: 9c5681011a0c ("drm/sun4i: Add HDMI support") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20200629060032.24134-1-wens@kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index 9f037095b506..04089b7487c2 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -261,9 +261,8 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force)
struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector);
unsigned long reg;
- if (readl_poll_timeout(hdmi->base + SUN4I_HDMI_HPD_REG, reg,
- reg & SUN4I_HDMI_HPD_HIGH,
- 0, 500000)) {
+ reg = readl(hdmi->base + SUN4I_HDMI_HPD_REG);
+ if (reg & SUN4I_HDMI_HPD_HIGH) {
cec_phys_addr_invalidate(hdmi->cec_adap);
return connector_status_disconnected;
}