From: Chris Zhong Date: Fri, 30 Dec 2016 07:34:36 +0000 (+0800) Subject: drm/rockchip: cdn-dp: do not use drm_helper_hpd_irq_event X-Git-Tag: firefly_0821_release~809 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4e23ecb9dc44118bfc2181a843c2694cdfc9e6f9;p=firefly-linux-kernel-4.4.55.git drm/rockchip: cdn-dp: do not use drm_helper_hpd_irq_event The cdn_dp_pd_event_work is using drm_helper_hpd_irq_event to update the connector status, this function is used to update all connectors of drm_device. Therefore, the detect of other connector will be call, when cdn_dp_pd_event_work is triggered, every time. It is not necessary, and it may cause system crash. replace drm_helper_hpd_irq_event with drm_kms_helper_hotplug_event, only update cdn-dp status. Change-Id: I6130d008d6d5187c934879b2f461f71699ea1532 Signed-off-by: Chris Zhong --- diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index 32a4e5f2cafa..9815856c0462 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -932,6 +932,9 @@ static void cdn_dp_pd_event_work(struct work_struct *work) { struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device, event_work); + struct drm_connector *connector = &dp->connector; + enum drm_connector_status old_status; + int ret; u8 sink_count; @@ -994,7 +997,11 @@ static void cdn_dp_pd_event_work(struct work_struct *work) out: mutex_unlock(&dp->lock); - drm_helper_hpd_irq_event(dp->drm_dev); + + old_status = connector->status; + connector->status = connector->funcs->detect(connector, false); + if (old_status != connector->status) + drm_kms_helper_hotplug_event(dp->drm_dev); } static int cdn_dp_pd_event(struct notifier_block *nb,