summaryrefslogtreecommitdiff
path: root/drivers/vfio/platform/vfio_platform_common.c
diff options
context:
space:
mode:
authorEric Auger <eric.auger@linaro.org>2015-11-03 18:12:18 (GMT)
committerAlex Williamson <alex.williamson@redhat.com>2015-11-03 19:55:05 (GMT)
commit705e60bae3e09bedba0b2ec936bce3f799f46426 (patch)
treeab602112e5d9ae894bdbd7bf7963250541e2a24c /drivers/vfio/platform/vfio_platform_common.c
parente9e0506ee60dd79714c59457f4301c602786defc (diff)
downloadlinux-705e60bae3e09bedba0b2ec936bce3f799f46426.tar.xz
vfio: platform: add dev_info on device reset
It might be helpful for the end-user to check the device reset function was found by the vfio platform reset framework. Lets store a pointer to the struct device in vfio_platform_device and trace when the reset function is called or not found. Signed-off-by: Eric Auger <eric.auger@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/platform/vfio_platform_common.c')
-rw-r--r--drivers/vfio/platform/vfio_platform_common.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
index ac02296..a1c50d6 100644
--- a/drivers/vfio/platform/vfio_platform_common.c
+++ b/drivers/vfio/platform/vfio_platform_common.c
@@ -144,8 +144,12 @@ static void vfio_platform_release(void *device_data)
mutex_lock(&driver_lock);
if (!(--vdev->refcnt)) {
- if (vdev->reset)
+ if (vdev->reset) {
+ dev_info(vdev->device, "reset\n");
vdev->reset(vdev);
+ } else {
+ dev_warn(vdev->device, "no reset function found!\n");
+ }
vfio_platform_regions_cleanup(vdev);
vfio_platform_irq_cleanup(vdev);
}
@@ -174,8 +178,12 @@ static int vfio_platform_open(void *device_data)
if (ret)
goto err_irq;
- if (vdev->reset)
+ if (vdev->reset) {
+ dev_info(vdev->device, "reset\n");
vdev->reset(vdev);
+ } else {
+ dev_warn(vdev->device, "no reset function found!\n");
+ }
}
vdev->refcnt++;
@@ -551,6 +559,8 @@ int vfio_platform_probe_common(struct vfio_platform_device *vdev,
return -EINVAL;
}
+ vdev->device = dev;
+
group = iommu_group_get(dev);
if (!group) {
pr_err("VFIO: No IOMMU group for device %s\n", vdev->name);