diff options
author | Lyude Paul <lyude@redhat.com> | 2018-08-07 17:32:48 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2018-09-06 16:54:27 -0400 |
commit | 2f7ca781fd382cf8dde73ed36dfdd93fd05b3332 (patch) | |
tree | 782a963981c48fddd575cb89c961793617814565 | |
parent | 79e765ad665da4b8aa7e9c878bd2fef837f6fea5 (diff) |
drm/nouveau/drm/nouveau: Don't forget to cancel hpd_work on suspend/unload
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>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index e4024af5a46f..540c0cbbfcee 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -442,7 +442,7 @@ nouveau_display_init(struct drm_device *dev) | |||
442 | } | 442 | } |
443 | 443 | ||
444 | void | 444 | void |
445 | nouveau_display_fini(struct drm_device *dev, bool suspend) | 445 | nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime) |
446 | { | 446 | { |
447 | struct nouveau_display *disp = nouveau_display(dev); | 447 | struct nouveau_display *disp = nouveau_display(dev); |
448 | struct nouveau_drm *drm = nouveau_drm(dev); | 448 | struct nouveau_drm *drm = nouveau_drm(dev); |
@@ -467,6 +467,9 @@ nouveau_display_fini(struct drm_device *dev, bool suspend) | |||
467 | } | 467 | } |
468 | drm_connector_list_iter_end(&conn_iter); | 468 | drm_connector_list_iter_end(&conn_iter); |
469 | 469 | ||
470 | if (!runtime) | ||
471 | cancel_work_sync(&drm->hpd_work); | ||
472 | |||
470 | drm_kms_helper_poll_disable(dev); | 473 | drm_kms_helper_poll_disable(dev); |
471 | disp->fini(dev); | 474 | disp->fini(dev); |
472 | } | 475 | } |
@@ -635,11 +638,11 @@ nouveau_display_suspend(struct drm_device *dev, bool runtime) | |||
635 | } | 638 | } |
636 | } | 639 | } |
637 | 640 | ||
638 | nouveau_display_fini(dev, true); | 641 | nouveau_display_fini(dev, true, runtime); |
639 | return 0; | 642 | return 0; |
640 | } | 643 | } |
641 | 644 | ||
642 | nouveau_display_fini(dev, true); | 645 | nouveau_display_fini(dev, true, runtime); |
643 | 646 | ||
644 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 647 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
645 | struct nouveau_framebuffer *nouveau_fb; | 648 | struct nouveau_framebuffer *nouveau_fb; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.h b/drivers/gpu/drm/nouveau/nouveau_display.h index 54aa7c3fa42d..ff92b54ce448 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.h +++ b/drivers/gpu/drm/nouveau/nouveau_display.h | |||
@@ -62,7 +62,7 @@ nouveau_display(struct drm_device *dev) | |||
62 | int nouveau_display_create(struct drm_device *dev); | 62 | int nouveau_display_create(struct drm_device *dev); |
63 | void nouveau_display_destroy(struct drm_device *dev); | 63 | void nouveau_display_destroy(struct drm_device *dev); |
64 | int nouveau_display_init(struct drm_device *dev); | 64 | int nouveau_display_init(struct drm_device *dev); |
65 | void nouveau_display_fini(struct drm_device *dev, bool suspend); | 65 | void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime); |
66 | int nouveau_display_suspend(struct drm_device *dev, bool runtime); | 66 | int nouveau_display_suspend(struct drm_device *dev, bool runtime); |
67 | void nouveau_display_resume(struct drm_device *dev, bool runtime); | 67 | void nouveau_display_resume(struct drm_device *dev, bool runtime); |
68 | int nouveau_display_vblank_enable(struct drm_device *, unsigned int); | 68 | int nouveau_display_vblank_enable(struct drm_device *, unsigned int); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 04f704b77a3c..f1a119113d04 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -627,7 +627,7 @@ nouveau_drm_unload(struct drm_device *dev) | |||
627 | nouveau_debugfs_fini(drm); | 627 | nouveau_debugfs_fini(drm); |
628 | 628 | ||
629 | if (dev->mode_config.num_crtc) | 629 | if (dev->mode_config.num_crtc) |
630 | nouveau_display_fini(dev, false); | 630 | nouveau_display_fini(dev, false, false); |
631 | nouveau_display_destroy(dev); | 631 | nouveau_display_destroy(dev); |
632 | 632 | ||
633 | nouveau_bios_takedown(dev); | 633 | nouveau_bios_takedown(dev); |