diff options
author | Jason Gunthorpe <[email protected]> | 2022-05-11 13:13:00 -0600 |
---|---|---|
committer | Alex Williamson <[email protected]> | 2022-05-11 13:13:00 -0600 |
commit | eadd86f835c63769febbd056dfcb70dafef0d4b3 (patch) | |
tree | 40a4e2e36aaf2a4e15e5130bae1703124dad0243 /drivers/fpga/fpga-bridge.c | |
parent | 231657b345046552b35670b45b892cfce2610e12 (diff) |
vfio: Remove calls to vfio_group_add_container_user()
When the open_device() op is called the container_users is incremented and
held incremented until close_device(). Thus, so long as drivers call
functions within their open_device()/close_device() region they do not
need to worry about the container_users.
These functions can all only be called between open_device() and
close_device():
vfio_pin_pages()
vfio_unpin_pages()
vfio_dma_rw()
vfio_register_notifier()
vfio_unregister_notifier()
Eliminate the calls to vfio_group_add_container_user() and add
vfio_assert_device_open() to detect driver mis-use. This causes the
close_device() op to check device->open_count so always leave it elevated
while calling the op.
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-bridge.c')
0 files changed, 0 insertions, 0 deletions