drm/nouveau/drm/nouveau: Don't forget to cancel hpd_work on suspend/unload
commit 2f7ca781fd
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
42387d8e4a
commit
9ac837e079
@ -426,7 +426,7 @@ nouveau_display_init(struct drm_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nouveau_display_fini(struct drm_device *dev, bool suspend)
|
nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime)
|
||||||
{
|
{
|
||||||
struct nouveau_display *disp = nouveau_display(dev);
|
struct nouveau_display *disp = nouveau_display(dev);
|
||||||
struct nouveau_drm *drm = nouveau_drm(dev);
|
struct nouveau_drm *drm = nouveau_drm(dev);
|
||||||
@ -451,6 +451,9 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
|
|||||||
}
|
}
|
||||||
drm_connector_list_iter_end(&conn_iter);
|
drm_connector_list_iter_end(&conn_iter);
|
||||||
|
|
||||||
|
if (!runtime)
|
||||||
|
cancel_work_sync(&drm->hpd_work);
|
||||||
|
|
||||||
drm_kms_helper_poll_disable(dev);
|
drm_kms_helper_poll_disable(dev);
|
||||||
disp->fini(dev);
|
disp->fini(dev);
|
||||||
}
|
}
|
||||||
@ -640,11 +643,11 @@ nouveau_display_suspend(struct drm_device *dev, bool runtime)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nouveau_display_fini(dev, true);
|
nouveau_display_fini(dev, true, runtime);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nouveau_display_fini(dev, true);
|
nouveau_display_fini(dev, true, runtime);
|
||||||
|
|
||||||
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
|
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
|
||||||
struct nouveau_framebuffer *nouveau_fb;
|
struct nouveau_framebuffer *nouveau_fb;
|
||||||
|
@ -64,7 +64,7 @@ nouveau_display(struct drm_device *dev)
|
|||||||
int nouveau_display_create(struct drm_device *dev);
|
int nouveau_display_create(struct drm_device *dev);
|
||||||
void nouveau_display_destroy(struct drm_device *dev);
|
void nouveau_display_destroy(struct drm_device *dev);
|
||||||
int nouveau_display_init(struct drm_device *dev);
|
int nouveau_display_init(struct drm_device *dev);
|
||||||
void nouveau_display_fini(struct drm_device *dev, bool suspend);
|
void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime);
|
||||||
int nouveau_display_suspend(struct drm_device *dev, bool runtime);
|
int nouveau_display_suspend(struct drm_device *dev, bool runtime);
|
||||||
void nouveau_display_resume(struct drm_device *dev, bool runtime);
|
void nouveau_display_resume(struct drm_device *dev, bool runtime);
|
||||||
int nouveau_display_vblank_enable(struct drm_device *, unsigned int);
|
int nouveau_display_vblank_enable(struct drm_device *, unsigned int);
|
||||||
|
@ -546,7 +546,7 @@ nouveau_drm_unload(struct drm_device *dev)
|
|||||||
nouveau_debugfs_fini(drm);
|
nouveau_debugfs_fini(drm);
|
||||||
|
|
||||||
if (dev->mode_config.num_crtc)
|
if (dev->mode_config.num_crtc)
|
||||||
nouveau_display_fini(dev, false);
|
nouveau_display_fini(dev, false, false);
|
||||||
nouveau_display_destroy(dev);
|
nouveau_display_destroy(dev);
|
||||||
|
|
||||||
nouveau_bios_takedown(dev);
|
nouveau_bios_takedown(dev);
|
||||||
|
Reference in New Issue
Block a user