diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2022-09-23 11:26:52 +0200 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2022-10-04 20:06:58 +0200 |
commit | 9c799c224d6ebc5be51065bd3217a2d7eea23b8f (patch) | |
tree | d09166f170afc9fc32ecfe8205964a6257b81990 /lib/logic_pio.c | |
parent | vfio/mdev: consolidate all the description sysfs into the core code (diff) | |
download | linux-9c799c224d6ebc5be51065bd3217a2d7eea23b8f.tar.xz linux-9c799c224d6ebc5be51065bd3217a2d7eea23b8f.zip |
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 'lib/logic_pio.c')
0 files changed, 0 insertions, 0 deletions