summaryrefslogtreecommitdiff
path: root/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2021-08-06 04:19:02 +0300
committerAlex Williamson <alex.williamson@redhat.com>2021-08-11 18:50:11 +0300
commitda119f387e94642da959a22ae9c22e09abe34926 (patch)
treece3d941ac612a29a9904e9afa4400a25e46c007b /drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c
parent17a1e4fa3f7f07f541c751745b5aa6f2fcab9a48 (diff)
downloadlinux-da119f387e94642da959a22ae9c22e09abe34926.tar.xz
vfio/fsl: Move to the device set infrastructure
FSL uses the internal reflck to implement the open_device() functionality, conversion to the core code is straightforward. The decision on which set to be part of is trivially based on the is_fsl_mc_bus_dprc() and we use a 'struct device *' pointer as the set_id. The dev_set lock is protecting the interrupts setup. The FSL MC devices are using MSIs and only the DPRC device is allocating the MSIs from the MSI domain. The other devices just take interrupts from a pool. The lock is protecting the access to this pool. Signed-off-by: Yishai Hadas <yishaih@nvidia.com> Tested-by: Diana Craciun OSS <diana.craciun@oss.nxp.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/6-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c')
-rw-r--r--drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c b/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c
index 0d9f3002df7f..77e584093a23 100644
--- a/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c
+++ b/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c
@@ -120,7 +120,7 @@ static int vfio_fsl_mc_set_irq_trigger(struct vfio_fsl_mc_device *vdev,
if (start != 0 || count != 1)
return -EINVAL;
- mutex_lock(&vdev->reflck->lock);
+ mutex_lock(&vdev->vdev.dev_set->lock);
ret = fsl_mc_populate_irq_pool(mc_cont,
FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS);
if (ret)
@@ -129,7 +129,7 @@ static int vfio_fsl_mc_set_irq_trigger(struct vfio_fsl_mc_device *vdev,
ret = vfio_fsl_mc_irqs_allocate(vdev);
if (ret)
goto unlock;
- mutex_unlock(&vdev->reflck->lock);
+ mutex_unlock(&vdev->vdev.dev_set->lock);
if (flags & VFIO_IRQ_SET_DATA_EVENTFD) {
s32 fd = *(s32 *)data;
@@ -154,7 +154,7 @@ static int vfio_fsl_mc_set_irq_trigger(struct vfio_fsl_mc_device *vdev,
return 0;
unlock:
- mutex_unlock(&vdev->reflck->lock);
+ mutex_unlock(&vdev->vdev.dev_set->lock);
return ret;
}