Re: [PATCH v3 01/15] vfio: Add helpers for unifying vfio_device life cycle

2022-09-11 Thread Ethan Zhao
Hi, Kevin, 在 2022/9/9 18:22, Kevin Tian 写道: The idea is to let vfio core manage the vfio_device life cycle instead of duplicating the logic cross drivers. This is also a preparatory step for adding struct device into vfio_device. New pair of helpers together with a kref in vfio_device: -

Re: [PATCH v3 01/15] vfio: Add helpers for unifying vfio_device life cycle

2022-09-09 Thread Jason Gunthorpe
On Fri, Sep 09, 2022 at 08:42:25AM +, Tian, Kevin wrote: > I think it's quite common to have an alloc() helper initialize refcount, e.g. > vfio_group_alloc() both initialize its user refcount and also call > device_initialize() to gets kref initialized. Similar example in >

RE: [PATCH v3 01/15] vfio: Add helpers for unifying vfio_device life cycle

2022-09-09 Thread Tian, Kevin
> From: Ethan Zhao > Sent: Friday, September 9, 2022 4:24 PM > > Hi, Kevin, > > 在 2022/9/9 18:22, Kevin Tian 写道: > > The idea is to let vfio core manage the vfio_device life cycle instead > > of duplicating the logic cross drivers. This is also a preparatory > > step for adding struct device

[PATCH v3 01/15] vfio: Add helpers for unifying vfio_device life cycle

2022-09-08 Thread Kevin Tian
The idea is to let vfio core manage the vfio_device life cycle instead of duplicating the logic cross drivers. This is also a preparatory step for adding struct device into vfio_device. New pair of helpers together with a kref in vfio_device: - vfio_alloc_device() - vfio_put_device() Drivers