Re: [PATCH v2 7/7] vfio: Remove calls to vfio_group_add_container_user()

2022-05-02 Thread Jason Gunthorpe
On Fri, Apr 29, 2022 at 02:28:20PM -0600, Alex Williamson wrote: > On Thu, 21 Apr 2022 13:28:38 -0300 > Jason Gunthorpe wrote: > > > 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

Re: [PATCH v2 7/7] vfio: Remove calls to vfio_group_add_container_user()

2022-04-29 Thread Alex Williamson
On Thu, 21 Apr 2022 13:28:38 -0300 Jason Gunthorpe wrote: > 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

Re: [PATCH v2 7/7] vfio: Remove calls to vfio_group_add_container_user()

2022-04-22 Thread Jason Gunthorpe
On Fri, Apr 22, 2022 at 02:11:27AM +, Tian, Kevin wrote: > > mutex_lock(>dev_set->lock); > > - if (!--device->open_count && device->ops->close_device) > > + vfio_assert_device_open(device); > > + if (device->open_count == 1 && device->ops->close_device) > >

RE: [PATCH v2 7/7] vfio: Remove calls to vfio_group_add_container_user()

2022-04-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, April 22, 2022 12:29 AM > > 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

[PATCH v2 7/7] vfio: Remove calls to vfio_group_add_container_user()

2022-04-21 Thread Jason Gunthorpe
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