vfio: platform: ignore missing reset if disabled at module init
Subsystems (3)
PATCH v2 1/1 vfio: platform: ignore missing reset if disabled at module init
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.
---
v2:
- return directly instead of using ternary to do that
drivers/vfio/platform/vfio_platform_common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/vfio/platform/vfio_platform_common.c +5 -2
@@ -650,10 +650,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);
--
2.34.1
Hi Tomasz,
Quoted 6 lines · Tomasz Duszynski
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 <[email protected]>Fixes 5f6c7e0831a1 ("vfio/platform: Use the new device life cycle helpers")
Thanks
Eric
Quoted 30 lines
---
v2:
- return directly instead of using ternary to do thatdrivers/vfio/platform/vfio_platform_common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/vfio/platform/vfio_platform_common.c +5
-3@@ -650,10 +650,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); --2.34.1
Quoted 9 lines
From: Tomasz Duszynski <[email protected]>
Sent: Tuesday, January 31, 2023 4:34 PMIf 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 <[email protected]>Fixes 5f6c7e0831a1 ("vfio/platform: Use the new device life cycle helpers")
Alex Williamson
AppliedQuoted 22 lines · On Tue, 31 Jan 2023 09:33:49 +0100 Tomasz Duszynski <[email protected]>…
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 <[email protected]>Fixes 5f6c7e0831a1 ("vfio/platform: Use the new device life cycle helpers")---
v2:
- return directly instead of using ternary to do thatdrivers/vfio/platform/vfio_platform_common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/vfio/platform/vfio_platform_common.c +0
-1@@ -650,10 +650,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)
drivers/vfio/platform/vfio_platform_common.c int vfio_platform_init_common(struct vfio_platform_device *vdev) · line 661
Quoted 10 lines
drivers/vfio/platform/vfio_platform_common.c +5
-1+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);
Applied to vfio next branch for v6.3. Thanks,
Alex