Skip to contentSkip to conversation

drm: Fix output poll work for drm_kms_helper_poll=n

PATCH In review Imre Deak 2 participants 3 messages Mar 1, 2024 – Mar 4, 2024

Subsystems (2)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/1 drm: Fix output poll work for drm_kms_helper_poll=n

If drm_kms_helper_poll=n the output poll work will only get scheduled from drm_helper_probe_single_connector_modes() to handle a delayed hotplug event. Since polling is disabled the work in this case should just call drm_kms_helper_hotplug_event() w/o detecting the state of connectors and rescheduling the work.

After commit d33a54e3991d after a delayed hotplug event above the connectors did get re-detected in the poll work and the work got re-scheduled periodically (since poll_running is also false if drm_kms_helper_poll=n), in effect ignoring the drm_kms_helper_poll=n kernel param.

Fix the above by calling only drm_kms_helper_hotplug_event() for a delayed hotplug event if drm_kms_helper_hotplug_event=n, as was done before d33a54e3991d.

Cc Dmitry Baryshkov <[email protected]>
Fixes d33a54e3991d ("drm/probe_helper: sort out poll_running vs poll_enabled")
---
 drivers/gpu/drm/drm_probe_helper.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_probe_helper.c +5 -3
index 19ecb749704be..4d60cc810b577 100644
@@ -767,9 +767,11 @@ static void output_poll_execute(struct work_struct *work)
 	changed = dev->mode_config.delayed_event;
 	dev->mode_config.delayed_event = false;
 
-	if (!drm_kms_helper_poll && dev->mode_config.poll_running) {
-		drm_kms_helper_disable_hpd(dev);
-		dev->mode_config.poll_running = false;
+	if (!drm_kms_helper_poll) {
+		if (dev->mode_config.poll_running) {
+			drm_kms_helper_disable_hpd(dev);
+			dev->mode_config.poll_running = false;
+		}
 		goto out;
 	}
 
Signature · 1 line
2.43.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Imre Deak

If drm_kms_helper_poll=n the output poll work will only get scheduled from drm_helper_probe_single_connector_modes() to handle a delayed hotplug event. Since polling is disabled the work in this case should just call drm_kms_helper_hotplug_event() w/o detecting the state of connectors and rescheduling the work.

After commit d33a54e3991d after a delayed hotplug event above the connectors did get re-detected in the poll work and the work got re-scheduled periodically (since poll_running is also false if drm_kms_helper_poll=n), in effect ignoring the drm_kms_helper_poll=n kernel param.

Quoted 7 lines

Fix the above by calling only drm_kms_helper_hotplug_event() for a delayed hotplug event if drm_kms_helper_hotplug_event=n, as was done before d33a54e3991d.

Cc Dmitry Baryshkov <[email protected]>
Fixes d33a54e3991d ("drm/probe_helper: sort out poll_running vs poll_enabled")
Quoted 4 lines
---
 drivers/gpu/drm/drm_probe_helper.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
author
#2 lore raw
Quoted 18 lines · Dmitry Baryshkov
Quoted 17 lines · Imre Deak

If drm_kms_helper_poll=n the output poll work will only get scheduled from drm_helper_probe_single_connector_modes() to handle a delayed hotplug event. Since polling is disabled the work in this case should just call drm_kms_helper_hotplug_event() w/o detecting the state of connectors and rescheduling the work.

After commit d33a54e3991d after a delayed hotplug event above the connectors did get re-detected in the poll work and the work got re-scheduled periodically (since poll_running is also false if drm_kms_helper_poll=n), in effect ignoring the drm_kms_helper_poll=n kernel param.

Fix the above by calling only drm_kms_helper_hotplug_event() for a delayed hotplug event if drm_kms_helper_hotplug_event=n, as was done before d33a54e3991d.

Quoted 5 lines
Quoted 3 lines
Cc Dmitry Baryshkov <[email protected]>
Fixes d33a54e3991d ("drm/probe_helper: sort out poll_running vs poll_enabled")

Patch is pushed to drm-misc-fixes, thanks for the report and review.

Quoted 9 lines
Quoted 5 lines
---
 drivers/gpu/drm/drm_probe_helper.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Signature · 2 lines
With best wishes
Dmitry