Karol Herbst
2017-Nov-16 17:21 UTC
[Nouveau] [RFC] drm: don't continue with anything after the GPU couldn't be woken up
This should make systems more stable where resuming the GPU fails. This can happen due to bad firmware or due to a bug within the kernel. The last thing which should happen in either case is an unusable system. Signed-off-by: Karol Herbst <kherbst at redhat.com> --- drm/nouveau/nouveau_drm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drm/nouveau/nouveau_drm.c b/drm/nouveau/nouveau_drm.c index 8d4a5be3..02892714 100644 --- a/drm/nouveau/nouveau_drm.c +++ b/drm/nouveau/nouveau_drm.c @@ -871,7 +871,8 @@ nouveau_pmops_runtime_resume(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); - struct nvif_device *device = &nouveau_drm(drm_dev)->client.device; + struct nouveau_drm *drm = nouveau_drm(drm_dev); + struct nvif_device *device = &drm->client.device; int ret; if (!nouveau_pmops_runtime()) { @@ -880,6 +881,11 @@ nouveau_pmops_runtime_resume(struct device *dev) } pci_set_power_state(pdev, PCI_D0); + /* abort if anything went wrong */ + if (pdev->current_state != PCI_D0) { + NV_ERROR(drm, "couldn't wake up GPU!\n"); + return -EBUSY; + } pci_restore_state(pdev); ret = pci_enable_device(pdev); if (ret) -- 2.14.3
Seemingly Similar Threads
- [PATCH v2] drm: don't continue with anything after the GPU couldn't be woken up
- [PATCH v2 1/4] drm: don't set the pci power state if the pci subsystem handles the ACPI bits
- [PATCH 1/5] drm: don't set the pci power state if the pci subsystem handles the ACPI bits
- [PATCH 1/5] drm: don't set the pci power state if the pci subsystem handles the ACPI bits
- [PATCH 1/5] drm: don't set the pci power state if the pci subsystem handles the ACPI bits