Skip to content

Commit 409af02

Browse files
Lyudegregkh
authored andcommitted
drm/nouveau/drm/nouveau: Fix bogus drm_kms_helper_poll_enable() placement
commit d77ef13 upstream. Turns out this part is my fault for not noticing when reviewing 9a2eba3 ("drm/nouveau: Fix drm poll_helper handling"). Currently we call drm_kms_helper_poll_enable() from nouveau_display_hpd_work(). This makes basically no sense however, because that means we're calling drm_kms_helper_poll_enable() every time we schedule the hotplug detection work. This is also against the advice mentioned in drm_kms_helper_poll_enable()'s documentation: Note that calls to enable and disable polling must be strictly ordered, which is automatically the case when they're only call from suspend/resume callbacks. Of course, hotplugs can't really be ordered. They could even happen immediately after we called drm_kms_helper_poll_disable() in nouveau_display_fini(), which can lead to all sorts of issues. Additionally; enabling polling /after/ we call drm_helper_hpd_irq_event() could also mean that we'd miss a hotplug event anyway, since drm_helper_hpd_irq_event() wouldn't bother trying to probe connectors so long as polling is disabled. So; simply move this back into nouveau_display_init() again. The race condition that both of these patches attempted to work around has already been fixed properly in d61a5c1 ("drm/nouveau: Fix deadlock on runtime suspend") Fixes: 9a2eba3 ("drm/nouveau: Fix drm poll_helper handling") Signed-off-by: Lyude Paul <lyude@redhat.com> Acked-by: Karol Herbst <kherbst@redhat.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Cc: Lukas Wunner <lukas@wunner.de> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9ac837e commit 409af02

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/gpu/drm/nouveau/nouveau_display.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,6 @@ nouveau_display_hpd_work(struct work_struct *work)
356356
pm_runtime_get_sync(drm->dev->dev);
357357

358358
drm_helper_hpd_irq_event(drm->dev);
359-
/* enable polling for external displays */
360-
drm_kms_helper_poll_enable(drm->dev);
361359

362360
pm_runtime_mark_last_busy(drm->dev->dev);
363361
pm_runtime_put_sync(drm->dev->dev);
@@ -412,6 +410,11 @@ nouveau_display_init(struct drm_device *dev)
412410
if (ret)
413411
return ret;
414412

413+
/* enable connector detection and polling for connectors without HPD
414+
* support
415+
*/
416+
drm_kms_helper_poll_enable(dev);
417+
415418
/* enable hotplug interrupts */
416419
drm_connector_list_iter_begin(dev, &conn_iter);
417420
nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) {

0 commit comments

Comments
 (0)