public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Cc: Brett Creeley <brett.creeley@amd.com>,
	"yishaih@nvidia.com" <yishaih@nvidia.com>,
	liulongfang <liulongfang@huawei.com>,
	"kevin.tian@intel.com" <kevin.tian@intel.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"shannon.nelson@amd.com" <shannon.nelson@amd.com>
Subject: Re: [PATCH vfio 1/2] hisi_acc_vfio_pci: Change reset_lock to mutex_lock
Date: Mon, 27 Nov 2023 20:46:12 -0400	[thread overview]
Message-ID: <20231128004612.GE432016@ziepe.ca> (raw)
In-Reply-To: <eb2172d1e24044059e65d15b10391f65@huawei.com>

On Fri, Nov 24, 2023 at 08:46:58AM +0000, Shameerali Kolothum Thodi wrote:
> > diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> > b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> > index b2f9778c8366..2c049b8de4b4 100644
> > --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> > +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> > @@ -638,17 +638,17 @@ static void
> >  hisi_acc_vf_state_mutex_unlock(struct hisi_acc_vf_core_device
> > *hisi_acc_vdev)
> >  {
> >  again:
> > -	spin_lock(&hisi_acc_vdev->reset_lock);
> > +	mutex_lock(&hisi_acc_vdev->reset_mutex);
> >  	if (hisi_acc_vdev->deferred_reset) {
> >  		hisi_acc_vdev->deferred_reset = false;
> > -		spin_unlock(&hisi_acc_vdev->reset_lock);
> > +		mutex_unlock(&hisi_acc_vdev->reset_mutex);
> 
> Don't think we have that sleeping while atomic case for this here.
> Same for mlx5 as well. But if the idea is to have a common locking
> across vendor drivers, it is fine.

Yeah, I'm not sure about changing spinlocks to mutex's for no reason..
If we don't sleep and don't hold it for very long then the spinlock is
appropriate

Jason

  reply	other threads:[~2023-11-28  0:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 19:36 [PATCH vfio 0/2] hisi_acc_vfio_pci: locking updates Brett Creeley
2023-11-22 19:36 ` [PATCH vfio 1/2] hisi_acc_vfio_pci: Change reset_lock to mutex_lock Brett Creeley
2023-11-24  8:46   ` Shameerali Kolothum Thodi
2023-11-28  0:46     ` Jason Gunthorpe [this message]
2023-11-28  8:05       ` Tian, Kevin
2023-11-22 19:36 ` [PATCH vfio 2/2] hisi_acc_vfio_pci: Destroy the [state|reset]_mutex on release Brett Creeley
2023-11-24  8:51   ` Shameerali Kolothum Thodi

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=20231128004612.GE432016@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=alex.williamson@redhat.com \
    --cc=brett.creeley@amd.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liulongfang@huawei.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=shannon.nelson@amd.com \
    --cc=yishaih@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox