Re: [PATCH] vp_vdpa: synchronize irq when free irq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 30, 2023 at 10:37 AM Zhu Lingshan <lingshan.zhu@xxxxxxxxx> wrote:
>
> This commits synchronizes irqs when free them

Need to explain why it is needed.

>
> Signed-off-by: Zhu Lingshan <lingshan.zhu@xxxxxxxxx>
> Tested-by: Cindy Lu <lulu@xxxxxxxxxx>
> ---
>  drivers/vdpa/virtio_pci/vp_vdpa.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c
> index 281287fae89f..d8ee3e68cd2d 100644
> --- a/drivers/vdpa/virtio_pci/vp_vdpa.c
> +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c
> @@ -116,6 +116,7 @@ static void vp_vdpa_free_irq(struct vp_vdpa *vp_vdpa)
>         for (i = 0; i < vp_vdpa->queues; i++) {
>                 if (vp_vdpa->vring[i].irq != VIRTIO_MSI_NO_VECTOR) {
>                         vp_modern_queue_vector(mdev, i, VIRTIO_MSI_NO_VECTOR);
> +                       synchronize_irq(vp_vdpa->vring[i].irq);

Interestingly, we don't do this in virtio_pci_common.c and we only
synchronize during reset there.

Any reason makes vp_vdpa different?

Thanks

>                         devm_free_irq(&pdev->dev, vp_vdpa->vring[i].irq,
>                                       &vp_vdpa->vring[i]);
>                         vp_vdpa->vring[i].irq = VIRTIO_MSI_NO_VECTOR;
> @@ -124,6 +125,7 @@ static void vp_vdpa_free_irq(struct vp_vdpa *vp_vdpa)
>
>         if (vp_vdpa->config_irq != VIRTIO_MSI_NO_VECTOR) {
>                 vp_modern_config_vector(mdev, VIRTIO_MSI_NO_VECTOR);
> +               synchronize_irq(vp_vdpa->config_irq);
>                 devm_free_irq(&pdev->dev, vp_vdpa->config_irq, vp_vdpa);
>                 vp_vdpa->config_irq = VIRTIO_MSI_NO_VECTOR;
>         }
> --
> 2.39.3
>

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux