UPSTREAM: drm: bridge: dw-hdmi: Don't forward HPD events to DRM core before attach
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 17 Jan 2017 08:28:56 +0000 (10:28 +0200)
committerZheng Yang <zhengyang@rock-chips.com>
Fri, 28 Apr 2017 08:20:37 +0000 (16:20 +0800)
Hotplug events should only be forwarded to the DRM core by the interrupt
handler when the bridge has been attached, otherwise the DRM device
pointer will be NULL, resulting in a crash.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-7-laurent.pinchart+renesas@ideasonboard.com
Change-Id: Ic1387b5253d4586774cdb82e089effdd4104e380
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(cherry pick from ba5d7e6160b7aed4df92d1764aa90790db0e7996)

drivers/gpu/drm/bridge/dw-hdmi.c

index 3ec4d712c5b8edf73a9aea03011ca90bfeeeb7bd..99d51b21d077daf3eb840c0210da895d29dc8d23 100644 (file)
@@ -291,7 +291,8 @@ static void repo_hpd_event(struct work_struct *p_work)
 {
        struct dw_hdmi *hdmi = container_of(p_work, struct dw_hdmi, work.work);
 
-       drm_helper_hpd_irq_event(hdmi->bridge.dev);
+       if (hdmi->bridge.dev)
+               drm_helper_hpd_irq_event(hdmi->bridge.dev);
 #ifdef CONFIG_SWITCH
        if (hdmi->hpd_state)
                switch_set_state(&hdmi->switchdev, 1);