Commit 528d92bf authored by Ying Gao's avatar Ying Gao Committed by Michael S. Tsirkin
Browse files

virtio_input: Improve freeze handling



When executing suspend to ram, if lacking the operations
to reset device and free unused buffers before deleting
a vq, resource leaks and inconsistent device status will
appear.

According to chapter "3.3.1 Driver Requirements: Device Cleanup:"
of virtio-specification:
  Driver MUST ensure a virtqueue isn’t live
  (by device reset) before removing exposed
  buffers.

Therefore, modify the virtinput_freeze function to reset the
device and delete the unused buffers before deleting the
virtqueue, just like virtinput_remove does.

Co-developed-by: default avatarYing Xu <ying123.xu@samsung.com>
Signed-off-by: default avatarYing Xu <ying123.xu@samsung.com>
Co-developed-by: default avatarJunnan Wu <junnan01.wu@samsung.com>
Signed-off-by: default avatarJunnan Wu <junnan01.wu@samsung.com>
Signed-off-by: default avatarYing Gao <ying01.gao@samsung.com>
Message-Id: <20250812095118.3622717-1-ying01.gao@samsung.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 24fc6315
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment