Skip to content

Commit ff20cc9

Browse files
Lyudegregkh
authored andcommitted
drm/nouveau: Don't enabling polling twice on runtime resume
[ Upstream commit cae9ff036eea577856d5b12860b4c79c5e71db4a ] As it turns out, on cards that actually have CRTCs on them we're already calling drm_kms_helper_poll_enable(drm_dev) from nouveau_display_resume() before we call it in nouveau_pmops_runtime_resume(). This leads us to accidentally trying to enable polling twice, which results in a potential deadlock between the RPM locks and drm_dev->mode_config.mutex if we end up trying to enable polling the second time while output_poll_execute is running and holding the mode_config lock. As such, make sure we only enable polling in nouveau_pmops_runtime_resume() if we need to. This fixes hangs observed on the ThinkPad W541 Signed-off-by: Lyude <lyude@redhat.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Kilian Singer <kilian.singer@quantumtechnology.info> Cc: Lukas Wunner <lukas@wunner.de> Cc: David Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 711f479 commit ff20cc9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/gpu/drm/nouveau/nouveau_display.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ nouveau_display_init(struct drm_device *dev)
370370
return ret;
371371

372372
/* enable polling for external displays */
373-
drm_kms_helper_poll_enable(dev);
373+
if (!dev->mode_config.poll_enabled)
374+
drm_kms_helper_poll_enable(dev);
374375

375376
/* enable hotplug interrupts */
376377
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {

drivers/gpu/drm/nouveau/nouveau_drm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,10 @@ nouveau_pmops_runtime_resume(struct device *dev)
743743
pci_set_master(pdev);
744744

745745
ret = nouveau_do_resume(drm_dev, true);
746-
drm_kms_helper_poll_enable(drm_dev);
746+
747+
if (!drm_dev->mode_config.poll_enabled)
748+
drm_kms_helper_poll_enable(drm_dev);
749+
747750
/* do magic */
748751
nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25));
749752
vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON);

0 commit comments

Comments
 (0)