Hi Dmitry, > Subject: Re: [RFC PATCH v2 0/2] Virtio-GPU suspend and resume > > Hi, > > On 5/24/25 01:00, dongwon....@intel.com wrote: > > From: Dongwon Kim <dongwon....@intel.com> > > > > This patch series introduces a freeze and restore mechanism for the > > virtio-gpu driver: > > > > First patch adds `virtgpu_freeze` and `virtgpu_restore` functions. > > These functions handle the deletion of virtio queues before suspension > > and their recreation during the restoration process. > > > > Second patch implements a mechanism for restoring `virtio_gpu_object` > instances. > > This is necessary because the host (QEMU) deletes all associated > > resources during the virtio-gpu reset, which occurs as part of the > restoration process. > > > > These changes ensure that the virtio-gpu driver can properly handle > > suspend and resume scenarios without resource loss. > > > > Dongwon Kim (2): > > drm/virtio: Freeze and restore hooks to support suspend and resume > > drm/virtio: Implement save and restore for virtio_gpu_objects > > > > drivers/gpu/drm/virtio/virtgpu_drv.c | 65 +++++++++++++++++++++- > > drivers/gpu/drm/virtio/virtgpu_drv.h | 11 ++++ > > drivers/gpu/drm/virtio/virtgpu_kms.c | 24 ++++++--- > > drivers/gpu/drm/virtio/virtgpu_object.c | 72 > > +++++++++++++++++++++++++ > > 4 files changed, 165 insertions(+), 7 deletions(-) > > Tested the patches, applied to v6.15.2. Suspend-resume works with v2, > display works on resume. > > Have you figured out why 10ms workaround is needed?
[Kim, Dongwon] Unfortunately, I don't know why it fails without the delay. I wanted to narrow down further so enabled printk during suspend and resume but hang didn't occur with the timing changes caused by printks. I've also tried more deterministic methods that make it wait based on some kinds of "status" but none of them have worked so far. If you have any suggestions on possible condition we can check instead of just sleeping, please let me know. 10ms seems to be close to minimum to make it work 100% for several days (rtcwake sleep and wake up every 5 sec). > > -- > Best regards, > Dmitry