All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfio/pci: Hold igate across releasing eventfd contexts
@ 2020-07-20 21:09 Alex Williamson
  2020-07-23  7:01 ` Cornelia Huck
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Williamson @ 2020-07-20 21:09 UTC (permalink / raw)
  To: alex.williamson; +Cc: linux-kernel, kvm, cohuck, prime.zeng

No need to release and immediately re-acquire igate while clearing
out the eventfd ctxs.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 drivers/vfio/pci/vfio_pci.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index b0258b79bb5b..dabca0450e6d 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -523,14 +523,12 @@ static void vfio_pci_release(void *device_data)
 		vfio_pci_vf_token_user_add(vdev, -1);
 		vfio_spapr_pci_eeh_release(vdev->pdev);
 		vfio_pci_disable(vdev);
+
 		mutex_lock(&vdev->igate);
 		if (vdev->err_trigger) {
 			eventfd_ctx_put(vdev->err_trigger);
 			vdev->err_trigger = NULL;
 		}
-		mutex_unlock(&vdev->igate);
-
-		mutex_lock(&vdev->igate);
 		if (vdev->req_trigger) {
 			eventfd_ctx_put(vdev->req_trigger);
 			vdev->req_trigger = NULL;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vfio/pci: Hold igate across releasing eventfd contexts
  2020-07-20 21:09 [PATCH] vfio/pci: Hold igate across releasing eventfd contexts Alex Williamson
@ 2020-07-23  7:01 ` Cornelia Huck
  0 siblings, 0 replies; 2+ messages in thread
From: Cornelia Huck @ 2020-07-23  7:01 UTC (permalink / raw)
  To: Alex Williamson; +Cc: linux-kernel, kvm, prime.zeng

On Mon, 20 Jul 2020 15:09:27 -0600
Alex Williamson <alex.williamson@redhat.com> wrote:

> No need to release and immediately re-acquire igate while clearing
> out the eventfd ctxs.
> 
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>  drivers/vfio/pci/vfio_pci.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> index b0258b79bb5b..dabca0450e6d 100644
> --- a/drivers/vfio/pci/vfio_pci.c
> +++ b/drivers/vfio/pci/vfio_pci.c
> @@ -523,14 +523,12 @@ static void vfio_pci_release(void *device_data)
>  		vfio_pci_vf_token_user_add(vdev, -1);
>  		vfio_spapr_pci_eeh_release(vdev->pdev);
>  		vfio_pci_disable(vdev);
> +
>  		mutex_lock(&vdev->igate);
>  		if (vdev->err_trigger) {
>  			eventfd_ctx_put(vdev->err_trigger);
>  			vdev->err_trigger = NULL;
>  		}
> -		mutex_unlock(&vdev->igate);
> -
> -		mutex_lock(&vdev->igate);
>  		if (vdev->req_trigger) {
>  			eventfd_ctx_put(vdev->req_trigger);
>  			vdev->req_trigger = NULL;
> 

Reviewed-by: Cornelia Huck <cohuck@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-23  7:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 21:09 [PATCH] vfio/pci: Hold igate across releasing eventfd contexts Alex Williamson
2020-07-23  7:01 ` Cornelia Huck

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.