summaryrefslogtreecommitdiff
path: root/drivers/s390/cio/vfio_ccw_private.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2022-09-23 12:26:52 +0300
committerAlex Williamson <alex.williamson@redhat.com>2022-10-04 21:06:58 +0300
commit9c799c224d6ebc5be51065bd3217a2d7eea23b8f (patch)
treed09166f170afc9fc32ecfe8205964a6257b81990 /drivers/s390/cio/vfio_ccw_private.h
parent685a1537f4c603cfcaf4b9be56ff6a571f7ddd08 (diff)
downloadlinux-9c799c224d6ebc5be51065bd3217a2d7eea23b8f.tar.xz
vfio/mdev: add mdev available instance checking to the core
Many of the mdev drivers use a simple counter for keeping track of the available instances. Move this code to the core code and store the counter in the mdev_parent. Implement it using correct locking, fixing mdpy. Drivers just provide the value in the mdev_driver at registration time and the core code takes care of maintaining it and exposing the value in sysfs. [hch: count instances per-parent instead of per-type, use an atomic_t to avoid taking mdev_list_lock in the show method] Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Link: https://lore.kernel.org/r/20220923092652.100656-15-hch@lst.de Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/s390/cio/vfio_ccw_private.h')
-rw-r--r--drivers/s390/cio/vfio_ccw_private.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/s390/cio/vfio_ccw_private.h b/drivers/s390/cio/vfio_ccw_private.h
index 52caa721ec06..bd5fb81456af 100644
--- a/drivers/s390/cio/vfio_ccw_private.h
+++ b/drivers/s390/cio/vfio_ccw_private.h
@@ -73,7 +73,6 @@ struct vfio_ccw_crw {
* @sch: pointer to the subchannel
* @state: internal state of the device
* @completion: synchronization helper of the I/O completion
- * @avail: available for creating a mediated device
* @io_region: MMIO region to input/output I/O arguments/results
* @io_mutex: protect against concurrent update of I/O regions
* @region: additional regions for other subchannel operations
@@ -97,7 +96,6 @@ struct vfio_ccw_private {
struct subchannel *sch;
int state;
struct completion *completion;
- atomic_t avail;
struct ccw_io_region *io_region;
struct mutex io_mutex;
struct vfio_ccw_region *region;