summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
diff options
context:
space:
mode:
authorDiana Craciun <diana.craciun@oss.nxp.com>2020-10-05 20:36:50 +0300
committerAlex Williamson <alex.williamson@redhat.com>2020-10-12 11:32:49 -0600
commitf2ba7e8c947bf38fec799fdf9122e05a6a3e8382 (patch)
treeccd68168aeff634b5cc6ce5a7f6060ba36d48976 /drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
parent67247289688d49a610a956c23c4ff032f0281845 (diff)
downloadlinux-stable-f2ba7e8c947bf38fec799fdf9122e05a6a3e8382.tar.gz
linux-stable-f2ba7e8c947bf38fec799fdf9122e05a6a3e8382.tar.bz2
linux-stable-f2ba7e8c947bf38fec799fdf9122e05a6a3e8382.zip
vfio/fsl-mc: Added lock support in preparation for interrupt handling
Only the DPRC object allocates interrupts from the MSI interrupt domain. The interrupts are managed by the DPRC in a pool of interrupts. The access to this pool of interrupts has to be protected with a lock. This patch extends the current lock implementation to have a lock per DPRC. Signed-off-by: Diana Craciun <diana.craciun@oss.nxp.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/fsl-mc/vfio_fsl_mc_private.h')
-rw-r--r--drivers/vfio/fsl-mc/vfio_fsl_mc_private.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h b/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
index be60f41af30f..d47ef6215429 100644
--- a/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
+++ b/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
@@ -15,6 +15,11 @@
#define VFIO_FSL_MC_INDEX_TO_OFFSET(index) \
((u64)(index) << VFIO_FSL_MC_OFFSET_SHIFT)
+struct vfio_fsl_mc_reflck {
+ struct kref kref;
+ struct mutex lock;
+};
+
struct vfio_fsl_mc_region {
u32 flags;
u32 type;
@@ -27,7 +32,7 @@ struct vfio_fsl_mc_device {
struct notifier_block nb;
int refcnt;
struct vfio_fsl_mc_region *regions;
- struct mutex driver_lock;
+ struct vfio_fsl_mc_reflck *reflck;
};
#endif /* VFIO_FSL_MC_PRIVATE_H */