All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zenghui Yu" <zenghui.yu@linux.dev>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	virtualization@lists.linux.dev,
	"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [virtio_pci?] WARNING: possible circular locking dependency detected
Date: Tue, 22 Sep 2026 12:45:23 +0000	[thread overview]
Message-ID: <20260922124523.7E4541F00893@smtp.kernel.org> (raw)
In-Reply-To: <98f2f4f9-a7fe-413e-a366-7bed08290697@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] virtio: missing indentation for if-statement body in vp_setup_vq()
--

commit 109e547b3fda2539201c9831108e08b3f9d3dbe9
Author: Zenghui Yu <zenghui.yu@linux.dev>

WARNING: possible circular locking dependency detected

This commit addresses a circular locking dependency involving cpu_hotplug_lock,
the MSI mutex, and the IOMMU group mutex in virtio_pci. It caches the Linux IRQ
number in virtio_pci_vq_info to avoid calling pci_irq_vector() and taking the
MSI mutex under the cpu_hotplug_lock.

> diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
> index b90c174450b20..df2774fb6d845 100644
> --- a/drivers/virtio/virtio_pci_common.c
> +++ b/drivers/virtio/virtio_pci_common.c

[ ... ]

> @@ -224,6 +224,16 @@ static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned int in
>  		goto out_info;
>  
>  	info->vq = vq;
> +
> +	/*
> +	 * Cache the Linux IRQ number so that later users (e.g.
> +	 * vp_set_vq_affinity() from cpu hotplug locked contexts)
> +	 * don't have to take the MSI mutex via pci_irq_vector().
> +	 */
> +	info->virq = 0;
> +	if (msix_vec != VIRTIO_MSI_NO_VECTOR)
> +	info->virq = pci_irq_vector(vp_dev->pci_dev, msix_vec);

[Severity: Low]
This isn't a bug, but is the body of this if-statement in vp_setup_vq()
missing a tab of indentation?

> +
>  	if (callback) {
>  		spin_lock_irqsave(&vp_dev->lock, flags);
>  		if (!vp_is_slow_path_vector(msix_vec))

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/98f2f4f9-a7fe-413e-a366-7bed08290697@linux.dev?part=1

      parent reply	other threads:[~2026-09-22 12:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 12:37 [virtio_pci?] WARNING: possible circular locking dependency detected Zenghui Yu
2026-09-22 12:42 ` Zenghui Yu
2026-09-22 12:45 ` 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=20260922124523.7E4541F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=virtualization@lists.linux.dev \
    --cc=zenghui.yu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.