Hi Dmitry,

> -----Original Message-----
> From: Dmitry Osipenko <[email protected]>
> Sent: Wednesday, November 12, 2025 3:12 AM
> To: Kim, Dongwon <[email protected]>; [email protected]
> Cc: [email protected]; [email protected]; [email protected]
> Subject: Re: [PATCH v6 3/3] drm/virtio: Add PM notifier to restore objects 
> after
> hibernation
> 
> On 11/12/25 14:01, Dmitry Osipenko wrote:
> > On 10/27/25 23:53, [email protected] wrote:
> >> diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c
> >> b/drivers/gpu/drm/virtio/virtgpu_drv.c
> >> index 676893e90a9f..5ff79e3775e8 100644
> >> --- a/drivers/gpu/drm/virtio/virtgpu_drv.c
> >> +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
> >> @@ -207,6 +207,15 @@ static int virtgpu_restore(struct virtio_device
> >> *vdev)
> >>
> >>    virtio_device_ready(vdev);
> >>
> >> +  if (vgdev->hibernation) {
> >> +          vgdev->hibernation = false;
> >> +          error = virtio_gpu_object_restore_all(vgdev);
> >> +          if (error) {
> >> +                  DRM_ERROR("Failed to recover virtio-gpu objects\n");
> >> +                  return error;
> >> +          }
> >> +  }
> >
> > What if hibernation was aborted and didn't happen? In that case
> > restoring of objects will fail. Please investigate how to handle
> > aborted hibernation properly.
> 
> One option could be to explicitly destroy all stored objs upon hibernation, 
> that
> way the restoring will always work.

Yes, we can do it to avoid that corner case. Or maybe we can just let it just 
run.
In this case, virtio_gpu_object_restore_all won't fail as shmem init will still 
work
but QEMU will justsend back errored replies as all of those resources for BOs 
are
still there in QEMU side but I think it won't break anything. Do you see any 
issues in
doing this that I might be missing?? My assumption here is that the QEMU hasn't
done any of virtio-gpu resets here as hibernation failed.

> 
> --
> Best regards,
> Dmitry

Thanks!

Reply via email to