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/rockchip: cdn-dp: Use drm_connector_helper_hpd_irq_event()

The code for detecting and updating the connector status in
cdn_dp_pd_event_work() has a number of problems.

- It does not aquire the locks to call the detect helper and update
the connector status. These are struct drm_mode_config.connection_mutex
and struct drm_mode_config.mutex.

- It does not use drm_helper_probe_detect(), which helps with the
details of locking and detection.

- It uses the connector's status field to determine a change to
the connector status. The epoch_counter field is the correct one. The
field signals a change even if the connector status' value did not
change.

Replace the code with a call to drm_connector_helper_hpd_irq_event(),
which fixes all these problems.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 81632df69772 ("drm/rockchip: cdn-dp: do not use drm_helper_hpd_irq_event")
Cc: Chris Zhong <zyw@rock-chips.com>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: Andy Yan <andy.yan@rock-chips.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: <stable@vger.kernel.org> # v4.11+
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20241105133848.480407-1-tzimmermann@suse.de

authored by

Thomas Zimmermann and committed by
Heiko Stuebner
666e1960 baf4afc5

+1 -8
+1 -8
drivers/gpu/drm/rockchip/cdn-dp-core.c
··· 947 947 { 948 948 struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device, 949 949 event_work); 950 - struct drm_connector *connector = &dp->connector; 951 - enum drm_connector_status old_status; 952 - 953 950 int ret; 954 951 955 952 mutex_lock(&dp->lock); ··· 1006 1009 1007 1010 out: 1008 1011 mutex_unlock(&dp->lock); 1009 - 1010 - old_status = connector->status; 1011 - connector->status = connector->funcs->detect(connector, false); 1012 - if (old_status != connector->status) 1013 - drm_kms_helper_hotplug_event(dp->drm_dev); 1012 + drm_connector_helper_hpd_irq_event(&dp->connector); 1014 1013 } 1015 1014 1016 1015 static int cdn_dp_pd_event(struct notifier_block *nb,