Skip to content

Commit

Permalink
vfio: platform: ignore missing reset if disabled at module init
Browse files Browse the repository at this point in the history
If reset requirement was relaxed via module parameter, errors caused by
missing reset should not be propagated down to the vfio core.
Otherwise initialization will fail.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Fixes: 5f6c7e0 ("vfio/platform: Use the new device life cycle helpers")
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20230131083349.2027189-1-tduszynski@marvell.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
  • Loading branch information
Tomasz Duszynski authored and Alex Williamson committed Feb 1, 2023
1 parent f4f0c25 commit 168a9c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/vfio/platform/vfio_platform_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,13 @@ int vfio_platform_init_common(struct vfio_platform_device *vdev)
mutex_init(&vdev->igate);

ret = vfio_platform_get_reset(vdev);
if (ret && vdev->reset_required)
if (ret && vdev->reset_required) {
dev_err(dev, "No reset function found for device %s\n",
vdev->name);
return ret;
return ret;
}

return 0;
}
EXPORT_SYMBOL_GPL(vfio_platform_init_common);

Expand Down

0 comments on commit 168a9c9

Please sign in to comment.