Skip to contentSkip to conversation

drm/probe-helper: Cancel previous job before starting new one

PATCH Applied Maxime Ripard 1 participant 2 messages Jan 27, 2023 – Feb 27, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/probe-helper: Cancel previous job before starting new one

From: Dom Cobley <[email protected]>

Currently we schedule a call to output_poll_execute from drm_kms_helper_poll_enable for 10s in future. Later we try to replace that in drm_helper_probe_single_connector_modes with a 0s schedule with delayed_event set.

But as there is already a job in the queue this fails, and the immediate job we wanted with delayed_event set doesn't occur until 10s later.

And that call acts as if connector state has changed, reprobing modes. This has a side effect of waking up a display that has been blanked.

Make sure we cancel the old job before submitting the immediate one.

Fixes 162b6a57ac50 ("drm/probe-helper: don't lose hotplug event")
---
 drivers/gpu/drm/drm_probe_helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_probe_helper.c +3 -1
index 8127be134c39..db954adb446a 100644
@@ -589,9 +589,11 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 		 * disable itself again.
 		 */
 		dev->mode_config.delayed_event = true;
-		if (dev->mode_config.poll_enabled)
+		if (dev->mode_config.poll_enabled) {
+			cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
 			schedule_delayed_work(&dev->mode_config.output_poll_work,
 					      0);
+		}
 	}
 
 	/* Re-enable polling in case the global poll config changed. */
Signature · 1 line
2.39.1
author Applied
#1 lore raw

Re: (subset) [PATCH] drm/probe-helper: Cancel previous job before starting new one

Quoted 9 lines · Maxime Ripard

Currently we schedule a call to output_poll_execute from drm_kms_helper_poll_enable for 10s in future. Later we try to replace that in drm_helper_probe_single_connector_modes with a 0s schedule with delayed_event set.

But as there is already a job in the queue this fails, and the immediate job we wanted with delayed_event set doesn't occur until 10s later.

[...]

Applied to drm/drm-misc (drm-misc-next).

Thanks!
Maxime