[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210517093428.670-6-xieyongji@bytedance.com>
Date: Mon, 17 May 2021 17:34:18 +0800
From: Xie Yongji <xieyongji@...edance.com>
To: mst@...hat.com, jasowang@...hat.com, stefanha@...hat.com
Cc: amit@...nel.org, arei.gonglei@...wei.com, airlied@...ux.ie,
kraxel@...hat.com, jean-philippe@...aro.org, ohad@...ery.com,
bjorn.andersson@...aro.org, david@...hat.com, vgoyal@...hat.com,
miklos@...redi.hu, lucho@...kov.net, asmadeus@...ewreck.org,
virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH 05/15] drm/virtio: Handle virtio_device_ready() failure
Now virtio_device_ready() will return error if we get
invalid status. Let's handle this case on probe.
Signed-off-by: Xie Yongji <xieyongji@...edance.com>
---
drivers/gpu/drm/virtio/virtgpu_kms.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index f3379059f324..eedbb4684db5 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -217,7 +217,11 @@ int virtio_gpu_init(struct drm_device *dev)
goto err_scanouts;
}
- virtio_device_ready(vgdev->vdev);
+ ret = virtio_device_ready(vgdev->vdev);
+ if (ret) {
+ DRM_ERROR("failed to enable virtio device\n");
+ goto err_device_ready;
+ }
if (num_capsets)
virtio_gpu_get_capsets(vgdev, num_capsets);
@@ -229,6 +233,8 @@ int virtio_gpu_init(struct drm_device *dev)
5 * HZ);
return 0;
+err_device_ready:
+ virtio_gpu_modeset_fini(vgdev);
err_scanouts:
virtio_gpu_free_vbufs(vgdev);
err_vbufs:
--
2.11.0
Powered by blists - more mailing lists