Skip to content

Commit bda8eaa

Browse files
wensmripard
authored andcommitted
drm: sun4i: hdmi: Remove extra HPD polling
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: 9c56810 ("drm/sun4i: Add HDMI support") Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 4ab59c3 commit bda8eaa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,8 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force)
259259
struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector);
260260
unsigned long reg;
261261

262-
if (readl_poll_timeout(hdmi->base + SUN4I_HDMI_HPD_REG, reg,
263-
reg & SUN4I_HDMI_HPD_HIGH,
264-
0, 500000)) {
262+
reg = readl(hdmi->base + SUN4I_HDMI_HPD_REG);
263+
if (reg & SUN4I_HDMI_HPD_HIGH) {
265264
cec_phys_addr_invalidate(hdmi->cec_adap);
266265
return connector_status_disconnected;
267266
}

0 commit comments

Comments
 (0)