diff options
author | Antonios Motakis <a.motakis@virtualopensystems.com> | 2015-03-16 16:08:54 -0400 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2015-03-16 16:08:54 -0400 |
commit | 42ac9bd18d4fc28c36c7927847f0f6e90ecd7710 (patch) | |
tree | 7250c8a8186ac25d171533c71037968077ef1cf1 /drivers/vfio/vfio.c | |
parent | 7e992d692750b2938224eb43fee907181d92a602 (diff) |
vfio: initialize the virqfd workqueue in VFIO generic code
Now we have finally completely decoupled virqfd from VFIO_PCI. We can
initialize it from the VFIO generic code, in order to safely use it from
multiple independent VFIO bus drivers.
Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
Signed-off-by: Baptiste Reynal <b.reynal@virtualopensystems.com>
Reviewed-by: Eric Auger <eric.auger@linaro.org>
Tested-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/vfio.c')
-rw-r--r-- | drivers/vfio/vfio.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 4cde85501444..23ba12afe01f 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c | |||
@@ -1553,6 +1553,11 @@ static int __init vfio_init(void) | |||
1553 | if (ret) | 1553 | if (ret) |
1554 | goto err_cdev_add; | 1554 | goto err_cdev_add; |
1555 | 1555 | ||
1556 | /* Start the virqfd cleanup handler used by some VFIO bus drivers */ | ||
1557 | ret = vfio_virqfd_init(); | ||
1558 | if (ret) | ||
1559 | goto err_virqfd; | ||
1560 | |||
1556 | pr_info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); | 1561 | pr_info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); |
1557 | 1562 | ||
1558 | /* | 1563 | /* |
@@ -1565,6 +1570,8 @@ static int __init vfio_init(void) | |||
1565 | 1570 | ||
1566 | return 0; | 1571 | return 0; |
1567 | 1572 | ||
1573 | err_virqfd: | ||
1574 | cdev_del(&vfio.group_cdev); | ||
1568 | err_cdev_add: | 1575 | err_cdev_add: |
1569 | unregister_chrdev_region(vfio.group_devt, MINORMASK); | 1576 | unregister_chrdev_region(vfio.group_devt, MINORMASK); |
1570 | err_alloc_chrdev: | 1577 | err_alloc_chrdev: |
@@ -1579,6 +1586,7 @@ static void __exit vfio_cleanup(void) | |||
1579 | { | 1586 | { |
1580 | WARN_ON(!list_empty(&vfio.group_list)); | 1587 | WARN_ON(!list_empty(&vfio.group_list)); |
1581 | 1588 | ||
1589 | vfio_virqfd_exit(); | ||
1582 | idr_destroy(&vfio.group_idr); | 1590 | idr_destroy(&vfio.group_idr); |
1583 | cdev_del(&vfio.group_cdev); | 1591 | cdev_del(&vfio.group_cdev); |
1584 | unregister_chrdev_region(vfio.group_devt, MINORMASK); | 1592 | unregister_chrdev_region(vfio.group_devt, MINORMASK); |