Commit 30df16b9 authored by Tobias Klausmann's avatar Tobias Klausmann Committed by Ben Skeggs

drm/nouveau/nouveau: forward error generated while resuming objects tree

On a failed resume we may experience unrecoverable errors. Plumb the error code
through to actually let the driver fail. On a reverse-prime setup this helps the
drm subsystem to at least recover the integrated gpu.

This can especially happen with secboot timing out, leaving the hardware in a
non-functioning state.
Signed-off-by: default avatarTobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a2f07d4c
...@@ -802,10 +802,15 @@ nouveau_do_suspend(struct drm_device *dev, bool runtime) ...@@ -802,10 +802,15 @@ nouveau_do_suspend(struct drm_device *dev, bool runtime)
static int static int
nouveau_do_resume(struct drm_device *dev, bool runtime) nouveau_do_resume(struct drm_device *dev, bool runtime)
{ {
int ret = 0;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
NV_DEBUG(drm, "resuming object tree...\n"); NV_DEBUG(drm, "resuming object tree...\n");
nvif_client_resume(&drm->master.base); ret = nvif_client_resume(&drm->master.base);
if (ret) {
NV_ERROR(drm, "Client resume failed with error: %d\n", ret);
return ret;
}
NV_DEBUG(drm, "resuming fence...\n"); NV_DEBUG(drm, "resuming fence...\n");
if (drm->fence && nouveau_fence(drm)->resume) if (drm->fence && nouveau_fence(drm)->resume)
...@@ -925,6 +930,7 @@ nouveau_pmops_runtime_resume(struct device *dev) ...@@ -925,6 +930,7 @@ nouveau_pmops_runtime_resume(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev); struct drm_device *drm_dev = pci_get_drvdata(pdev);
struct nouveau_drm *drm = nouveau_drm(drm_dev);
struct nvif_device *device = &nouveau_drm(drm_dev)->client.device; struct nvif_device *device = &nouveau_drm(drm_dev)->client.device;
int ret; int ret;
...@@ -941,6 +947,10 @@ nouveau_pmops_runtime_resume(struct device *dev) ...@@ -941,6 +947,10 @@ nouveau_pmops_runtime_resume(struct device *dev)
pci_set_master(pdev); pci_set_master(pdev);
ret = nouveau_do_resume(drm_dev, true); ret = nouveau_do_resume(drm_dev, true);
if (ret) {
NV_ERROR(drm, "resume failed with: %d\n", ret);
return ret;
}
/* do magic */ /* do magic */
nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25)); nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment