On 7/3/25 01:24, dongwon....@intel.com wrote: > +static int virtgpu_freeze(struct virtio_device *vdev) > +{ > + struct drm_device *dev = vdev->priv; > + struct virtio_gpu_device *vgdev = dev->dev_private; > + int error; > + > + error = drm_mode_config_helper_suspend(dev); > + if (error) { > + DRM_ERROR("suspend error %d\n", error); > + return error; > + } > + > + flush_work(&vgdev->obj_free_work); > + flush_work(&vgdev->ctrlq.dequeue_work); > + flush_work(&vgdev->cursorq.dequeue_work); > + flush_work(&vgdev->config_changed_work); > + > + wait_event(vgdev->ctrlq.ack_queue, > + vgdev->ctrlq.vq->num_free == vgdev->ctrlq.vq->num_max); > + > + wait_event(vgdev->cursorq.ack_queue, > + vgdev->cursorq.vq->num_free == vgdev->cursorq.vq->num_max);
Should be more correct to first do a wait_event() and then flush_work() to not race with the work completion. -- Best regards, Dmitry