Kevin Tian ebb72b765f vfio/ccw: Use the new device life cycle helpers
ccw is the only exception which cannot use vfio_alloc_device() because
its private device structure is designed to serve both mdev and parent.
Life cycle of the parent is managed by css_driver so vfio_ccw_private
must be allocated/freed in css_driver probe/remove path instead of
conforming to vfio core life cycle for mdev.

Given that use a wait/completion scheme so the mdev remove path waits
after vfio_put_device() until receiving a completion notification from
@release. The completion indicates that all active references on
vfio_device have been released.

After that point although free of vfio_ccw_private is delayed to
css_driver it's at least guaranteed to have no parallel reference on
released vfio device part from other code paths.

memset() in @probe is removed. vfio_device is either already cleared
when probed for the first time or cleared in @release from last probe.

The right fix is to introduce separate structures for mdev and parent,
but this won't happen in short term per prior discussions.

Remove vfio_init/uninit_group_dev() as no user now.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Link: https://lore.kernel.org/r/20220921104401.38898-14-kevin.tian@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2022-09-21 14:15:11 -06:00
..
2022-09-03 13:23:11 -07:00
2022-08-04 12:12:54 -07:00
2022-08-04 19:30:35 -07:00
2022-07-17 17:14:30 -07:00
2022-08-04 19:30:35 -07:00
2022-08-06 16:38:17 -07:00
2022-08-31 09:54:14 -07:00
2022-08-05 10:07:23 -07:00
2022-09-03 13:09:46 -07:00
2022-08-18 17:37:22 +02:00
2022-08-26 11:05:54 -07:00
2022-08-04 19:41:09 -07:00
2022-08-06 10:25:16 -07:00
2022-09-02 15:03:12 -07:00
2022-08-05 14:13:45 -07:00
2022-08-12 09:50:34 -07:00
2022-09-02 16:44:30 -07:00
2022-08-04 12:12:54 -07:00
2022-08-03 17:49:38 +02:00
2022-09-02 10:32:30 -07:00
2022-08-04 19:30:35 -07:00
2022-09-02 10:35:51 -07:00
2022-08-04 12:12:54 -07:00
2022-08-04 12:12:54 -07:00
2022-08-16 11:36:38 -07:00
2022-08-05 10:02:33 -07:00
2022-08-09 00:56:41 +02:00
2022-08-16 11:40:15 -07:00
2022-08-13 13:41:48 -07:00
2022-08-27 15:07:58 +02:00
2022-08-12 09:50:34 -07:00
2022-08-08 15:04:04 -07:00
2022-09-03 13:23:11 -07:00
2022-08-04 12:01:42 -07:00