From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Yuho Choi <oss.patchbox@gmail.com>,
David Airlie <airlied@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Dongwon Kim <dongwon.kim@intel.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>,
Chia-I Wu <olvaffe@gmail.com>,
dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v1] drm/virtio: Reset device before deleting virtqueues on freeze
Date: Wed, 14 Oct 2026 01:56:19 +0300 [thread overview]
Message-ID: <05f4612c-a034-4e77-9a00-9cadd9f7e2c9@collabora.com> (raw)
In-Reply-To: <20260926202040.1313385-1-oss.patchbox@gmail.com>
On 9/26/26 23:20, Yuho Choi wrote:
> virtgpu_freeze() waits for the control and cursor queues to drain and
> then deletes the virtqueues, but nothing tells the device to stop first.
> del_vqs() frees the vring backing, but does not provide a generic device
> quiesce operation. In particular, modern virtio-pci keeps enabled queues
> active until the device is reset, so the device is left DRIVER_OK with
> its queues pointing at memory that has been freed and may be reused while
> the guest is suspended. virtio_device_restore() only resets the device
> later, on resume.
>
> Reset the device before deleting the virtqueues, the way
> virtio_gpu_deinit() already does on removal.
>
> Fixes: cad6a879a7fb ("drm/virtio: Freeze and restore hooks to support suspend and resume")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
> ---
> drivers/gpu/drm/virtio/virtgpu_drv.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
> index 2aaa7cb08085..52c174f9bff7 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drv.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
> @@ -225,6 +225,7 @@ static int virtgpu_freeze(struct virtio_device *vdev)
> goto err_resume;
> }
>
> + virtio_reset_device(vdev);
> vdev->config->del_vqs(vdev);
>
> return 0;
Applied to misc-fixes, thanks!
--
Best regards,
Dmitry
prev parent reply other threads:[~2026-10-13 22:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-26 20:20 Yuho Choi
2026-10-13 22:56 ` Dmitry Osipenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=05f4612c-a034-4e77-9a00-9cadd9f7e2c9@collabora.com \
--to=dmitry.osipenko@collabora.com \
--cc=airlied@redhat.com \
--cc=dongwon.kim@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gurchetansingh@chromium.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olvaffe@gmail.com \
--cc=oss.patchbox@gmail.com \
--cc=stable@vger.kernel.org \
--cc=virtualization@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®