summaryrefslogtreecommitdiff
path: root/drivers/vfio
diff options
context:
space:
mode:
authorBharat Bhushan <Bharat.Bhushan@nxp.com>2017-03-07 07:06:21 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-09-25 07:25:34 (GMT)
commit79d7d61c29d54403604b860f7ace9a76791ff2bd (patch)
tree2baebca799e34a555eb7a768d44c8f3dc9a9d2d1 /drivers/vfio
parent0e5a422311485f57d67b038bef77ce0b7ae46cfe (diff)
downloadlinux-79d7d61c29d54403604b860f7ace9a76791ff2bd.tar.xz
vfio fsl-mc: Reset container on _release()
dprc_reset_container() does complete cleanup and thus allows re-run guest/user-space after abrupt guest kill. Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/fsl-mc/vfio_fsl_mc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_fsl_mc.c
index 176d88b..7b0b7dc 100644
--- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c
+++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c
@@ -110,6 +110,7 @@ error_region_init:
static void vfio_fsl_mc_release(void *device_data)
{
struct vfio_fsl_mc_device *vdev = device_data;
+ struct fsl_mc_device *mc_dev = vdev->mc_dev;
mutex_lock(&driver_lock);
@@ -118,6 +119,10 @@ static void vfio_fsl_mc_release(void *device_data)
vfio_fsl_mc_irqs_cleanup(vdev);
}
+ if (strcmp(mc_dev->obj_desc.type, "dprc") == 0)
+ dprc_reset_container(mc_dev->mc_io, 0, mc_dev->mc_handle,
+ mc_dev->obj_desc.id);
+
mutex_unlock(&driver_lock);
module_put(THIS_MODULE);