From 79d7d61c29d54403604b860f7ace9a76791ff2bd Mon Sep 17 00:00:00 2001 From: Bharat Bhushan Date: Tue, 7 Mar 2017 12:36:21 +0530 Subject: 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 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); -- cgit v0.10.2