diff options
| author | Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> | 2019-03-28 09:17:31 -0400 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2019-04-30 21:08:39 -0400 |
| commit | 30df16b93b25fe345e4c5d4e9c789d3f4f337b72 (patch) | |
| tree | 98c928cef9151847a39bf7783d6338d4026d8a3a | |
| parent | a2f07d4c1e88d4250b5d1d3b54efcdb3d80f11da (diff) | |
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: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 6ab9033f49da..22cd45845e07 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
| @@ -802,10 +802,15 @@ fail_display: | |||
| 802 | static int | 802 | static int |
| 803 | nouveau_do_resume(struct drm_device *dev, bool runtime) | 803 | nouveau_do_resume(struct drm_device *dev, bool runtime) |
| 804 | { | 804 | { |
| 805 | int ret = 0; | ||
| 805 | struct nouveau_drm *drm = nouveau_drm(dev); | 806 | struct nouveau_drm *drm = nouveau_drm(dev); |
| 806 | 807 | ||
| 807 | NV_DEBUG(drm, "resuming object tree...\n"); | 808 | NV_DEBUG(drm, "resuming object tree...\n"); |
| 808 | nvif_client_resume(&drm->master.base); | 809 | ret = nvif_client_resume(&drm->master.base); |
| 810 | if (ret) { | ||
| 811 | NV_ERROR(drm, "Client resume failed with error: %d\n", ret); | ||
| 812 | return ret; | ||
| 813 | } | ||
| 809 | 814 | ||
| 810 | NV_DEBUG(drm, "resuming fence...\n"); | 815 | NV_DEBUG(drm, "resuming fence...\n"); |
| 811 | if (drm->fence && nouveau_fence(drm)->resume) | 816 | if (drm->fence && nouveau_fence(drm)->resume) |
| @@ -925,6 +930,7 @@ nouveau_pmops_runtime_resume(struct device *dev) | |||
| 925 | { | 930 | { |
| 926 | struct pci_dev *pdev = to_pci_dev(dev); | 931 | struct pci_dev *pdev = to_pci_dev(dev); |
| 927 | struct drm_device *drm_dev = pci_get_drvdata(pdev); | 932 | struct drm_device *drm_dev = pci_get_drvdata(pdev); |
| 933 | struct nouveau_drm *drm = nouveau_drm(drm_dev); | ||
| 928 | struct nvif_device *device = &nouveau_drm(drm_dev)->client.device; | 934 | struct nvif_device *device = &nouveau_drm(drm_dev)->client.device; |
| 929 | int ret; | 935 | int ret; |
| 930 | 936 | ||
| @@ -941,6 +947,10 @@ nouveau_pmops_runtime_resume(struct device *dev) | |||
| 941 | pci_set_master(pdev); | 947 | pci_set_master(pdev); |
| 942 | 948 | ||
| 943 | ret = nouveau_do_resume(drm_dev, true); | 949 | ret = nouveau_do_resume(drm_dev, true); |
| 950 | if (ret) { | ||
| 951 | NV_ERROR(drm, "resume failed with: %d\n", ret); | ||
| 952 | return ret; | ||
| 953 | } | ||
| 944 | 954 | ||
| 945 | /* do magic */ | 955 | /* do magic */ |
| 946 | nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25)); | 956 | nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25)); |
