dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yuho Choi" <oss.patchbox@gmail.com>
Cc: dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH] drm/virtio: Reset device before deleting virtqueues on init failure
Date: Thu, 03 Dec 2026 21:39:49 +0000	[thread overview]
Message-ID: <sashiko-outbox-248706@kernel.org> (raw)
In-Reply-To: <20261203212127.2147347-2-oss.patchbox@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/virtio: redundant double virtio_reset_device() in
  virtio_gpu_init()
--

commit 4d07ab1dc65a97542b38fd22d37c228f75391c94
Author: Yuho Choi <oss.patchbox@gmail.com>

drm/virtio: Reset device before deleting virtqueues on init failure

This commit adds a virtio_reset_device() call in the err_vbufs error path
of virtio_gpu_init() so the device is reset before deleting virtqueues when
virtio_gpu_alloc_vbufs() or virtio_gpu_modeset_init() fails.

> diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
> index 1d4d3bf46a202..c729545e41f52 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_kms.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
> @@ -326,6 +326,7 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
>  err_scanouts:
>  	virtio_gpu_free_vbufs(vgdev);
>  err_vbufs:
> +	virtio_reset_device(vgdev->vdev);
>  	vgdev->vdev->config->del_vqs(vgdev->vdev);
>  err_vqs:
>  	dev->dev_private = NULL;

[Severity: Low]
Does the err_reset_device unwind path now call virtio_reset_device() twice?

When waiting for display info times out, virtio_gpu_init() jumps to
err_reset_device, calls virtio_reset_device(), and falls through into
err_vbufs to reset the device again before del_vqs().  The second call
repeats the transport reset and virtio_synchronize_cbs() unnecessarily.

Skipping the second virtio_reset_device() on the err_reset_device path by
jumping directly to del_vqs() after virtio_gpu_free_vbufs() would avoid
the redundant reset.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203212127.2147347-2-oss.patchbox@gmail.com?part=1

      reply	other threads:[~2026-12-03 21:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 21:21 [PATCH] drm/virtio: Reset device before deleting virtqueues on init failure Yuho Choi
2026-12-03 21:39 ` sashiko-bot [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=sashiko-outbox-248706@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=oss.patchbox@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --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