Skip to content

Commit 9ac837e

Browse files
Lyudegregkh
authored andcommitted
drm/nouveau/drm/nouveau: Don't forget to cancel hpd_work on suspend/unload
commit 2f7ca78 upstream. Currently, there's nothing in nouveau that actually cancels this work struct. So, cancel it on suspend/unload. Otherwise, if we're unlucky enough hpd_work might try to keep running up until the system is suspended. Signed-off-by: Lyude Paul <lyude@redhat.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 42387d8 commit 9ac837e

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

drivers/gpu/drm/nouveau/nouveau_display.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ nouveau_display_init(struct drm_device *dev)
426426
}
427427

428428
void
429-
nouveau_display_fini(struct drm_device *dev, bool suspend)
429+
nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime)
430430
{
431431
struct nouveau_display *disp = nouveau_display(dev);
432432
struct nouveau_drm *drm = nouveau_drm(dev);
@@ -451,6 +451,9 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
451451
}
452452
drm_connector_list_iter_end(&conn_iter);
453453

454+
if (!runtime)
455+
cancel_work_sync(&drm->hpd_work);
456+
454457
drm_kms_helper_poll_disable(dev);
455458
disp->fini(dev);
456459
}
@@ -640,11 +643,11 @@ nouveau_display_suspend(struct drm_device *dev, bool runtime)
640643
}
641644
}
642645

643-
nouveau_display_fini(dev, true);
646+
nouveau_display_fini(dev, true, runtime);
644647
return 0;
645648
}
646649

647-
nouveau_display_fini(dev, true);
650+
nouveau_display_fini(dev, true, runtime);
648651

649652
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
650653
struct nouveau_framebuffer *nouveau_fb;

drivers/gpu/drm/nouveau/nouveau_display.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ nouveau_display(struct drm_device *dev)
6464
int nouveau_display_create(struct drm_device *dev);
6565
void nouveau_display_destroy(struct drm_device *dev);
6666
int nouveau_display_init(struct drm_device *dev);
67-
void nouveau_display_fini(struct drm_device *dev, bool suspend);
67+
void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime);
6868
int nouveau_display_suspend(struct drm_device *dev, bool runtime);
6969
void nouveau_display_resume(struct drm_device *dev, bool runtime);
7070
int nouveau_display_vblank_enable(struct drm_device *, unsigned int);

drivers/gpu/drm/nouveau/nouveau_drm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ nouveau_drm_unload(struct drm_device *dev)
546546
nouveau_debugfs_fini(drm);
547547

548548
if (dev->mode_config.num_crtc)
549-
nouveau_display_fini(dev, false);
549+
nouveau_display_fini(dev, false, false);
550550
nouveau_display_destroy(dev);
551551

552552
nouveau_bios_takedown(dev);

0 commit comments

Comments
 (0)