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

Configure Feed

Select the types of activity you want to include in your feed.

drm/bridge/synopsys: dw-hdmi: Fix unwedge crash when no pinctrl entries

In commit 50f9495efe30 ("drm/bridge/synopsys: dw-hdmi: Add "unwedge"
for ddc bus") I stupidly used IS_ERR() to check for whether we have an
"unwedge" pinctrl state even though on most flows through the driver
the unwedge state will just be NULL.

Fix it so that we consistently use NULL for no unwedge state.

Fixes: 50f9495efe30 ("drm/bridge/synopsys: dw-hdmi: Add "unwedge" for ddc bus")
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
Reported-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190610175234.196844-1-dianders@chromium.org

authored by

Douglas Anderson and committed by
Sean Paul
0bd79f91 427231bc

+8 -6
+8 -6
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
··· 256 256 static bool dw_hdmi_i2c_unwedge(struct dw_hdmi *hdmi) 257 257 { 258 258 /* If no unwedge state then give up */ 259 - if (IS_ERR(hdmi->unwedge_state)) 259 + if (!hdmi->unwedge_state) 260 260 return false; 261 261 262 262 dev_info(hdmi->dev, "Attempting to unwedge stuck i2c bus\n"); ··· 2691 2691 hdmi->default_state = 2692 2692 pinctrl_lookup_state(hdmi->pinctrl, "default"); 2693 2693 2694 - if (IS_ERR(hdmi->default_state) && 2695 - !IS_ERR(hdmi->unwedge_state)) { 2696 - dev_warn(dev, 2697 - "Unwedge requires default pinctrl\n"); 2698 - hdmi->unwedge_state = ERR_PTR(-ENODEV); 2694 + if (IS_ERR(hdmi->default_state) || 2695 + IS_ERR(hdmi->unwedge_state)) { 2696 + if (!IS_ERR(hdmi->unwedge_state)) 2697 + dev_warn(dev, 2698 + "Unwedge requires default pinctrl\n"); 2699 + hdmi->default_state = NULL; 2700 + hdmi->unwedge_state = NULL; 2699 2701 } 2700 2702 } 2701 2703