All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Wu Zongyong <wuzongyong@linux.alibaba.com>
Cc: wei.yang1@linux.alibaba.com, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] vhost-vdpa: clean irqs before reseting vdpa device
Date: Mon, 15 Nov 2021 05:56:17 -0500	[thread overview]
Message-ID: <20211115055336-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <a2cb60cf73be9da5c4e6399242117d8818f975ae.1636946171.git.wuzongyong@linux.alibaba.com>

On Mon, Nov 15, 2021 at 11:16:42AM +0800, Wu Zongyong wrote:
> Vdpa devices should be reset after unseting irqs of virtqueues, or we
> will get errors when killing qemu process:
> 
> >> pi_update_irte: failed to update PI IRTE
> >> irq bypass consumer (token 0000000065102a43) unregistration fails: -22
> 
> Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com>


A Fixes flag might be appropriate here.  2cf1ba9a4d15c ?

Also, remind me of commit 97f854be203883b61d24f230445bd533bbdf770c
vhost_vdpa: unset vq irq before freeing irq - what's the difference
in scenarios?


> ---
>  drivers/vhost/vdpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index 01c59ce7e250..29cced1cd277 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -1014,12 +1014,12 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
>  
>  	mutex_lock(&d->mutex);
>  	filep->private_data = NULL;
> +	vhost_vdpa_clean_irq(v);
>  	vhost_vdpa_reset(v);
>  	vhost_dev_stop(&v->vdev);
>  	vhost_vdpa_iotlb_free(v);
>  	vhost_vdpa_free_domain(v);
>  	vhost_vdpa_config_put(v);
> -	vhost_vdpa_clean_irq(v);
>  	vhost_dev_cleanup(&v->vdev);
>  	kfree(v->vdev.vqs);
>  	mutex_unlock(&d->mutex);
> -- 
> 2.31.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Wu Zongyong <wuzongyong@linux.alibaba.com>
Cc: jasowang@redhat.com, virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, wei.yang1@linux.alibaba.com
Subject: Re: [PATCH] vhost-vdpa: clean irqs before reseting vdpa device
Date: Mon, 15 Nov 2021 05:56:17 -0500	[thread overview]
Message-ID: <20211115055336-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <a2cb60cf73be9da5c4e6399242117d8818f975ae.1636946171.git.wuzongyong@linux.alibaba.com>

On Mon, Nov 15, 2021 at 11:16:42AM +0800, Wu Zongyong wrote:
> Vdpa devices should be reset after unseting irqs of virtqueues, or we
> will get errors when killing qemu process:
> 
> >> pi_update_irte: failed to update PI IRTE
> >> irq bypass consumer (token 0000000065102a43) unregistration fails: -22
> 
> Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com>


A Fixes flag might be appropriate here.  2cf1ba9a4d15c ?

Also, remind me of commit 97f854be203883b61d24f230445bd533bbdf770c
vhost_vdpa: unset vq irq before freeing irq - what's the difference
in scenarios?


> ---
>  drivers/vhost/vdpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index 01c59ce7e250..29cced1cd277 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -1014,12 +1014,12 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
>  
>  	mutex_lock(&d->mutex);
>  	filep->private_data = NULL;
> +	vhost_vdpa_clean_irq(v);
>  	vhost_vdpa_reset(v);
>  	vhost_dev_stop(&v->vdev);
>  	vhost_vdpa_iotlb_free(v);
>  	vhost_vdpa_free_domain(v);
>  	vhost_vdpa_config_put(v);
> -	vhost_vdpa_clean_irq(v);
>  	vhost_dev_cleanup(&v->vdev);
>  	kfree(v->vdev.vqs);
>  	mutex_unlock(&d->mutex);
> -- 
> 2.31.1


  parent reply	other threads:[~2021-11-15 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  3:16 [PATCH] vhost-vdpa: clean irqs before reseting vdpa device Wu Zongyong
2021-11-15  4:08 ` Jason Wang
2021-11-15  4:08   ` Jason Wang
2021-11-15 10:56 ` Michael S. Tsirkin [this message]
2021-11-15 10:56   ` Michael S. Tsirkin
2021-11-16 13:29   ` Wu Zongyong

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=20211115055336-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wei.yang1@linux.alibaba.com \
    --cc=wuzongyong@linux.alibaba.com \
    /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.