All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] vfio: platform: ignore missing reset if disabled at module init
@ 2023-01-31  8:33 Tomasz Duszynski
  2023-01-31  9:49 ` Eric Auger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tomasz Duszynski @ 2023-01-31  8:33 UTC (permalink / raw)
  To: Eric Auger, Alex Williamson, Cornelia Huck, Kevin Tian,
	Jason Gunthorpe, open list:VFIO PLATFORM DRIVER, open list
  Cc: jerinj, 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 <tduszynski@marvell.com>
Fixes: 5f6c7e0831a1 ("vfio/platform: Use the new device life cycle helpers")
---
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(-)

diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
index 1a0a238ffa35..7325ff463cf0 100644
--- a/drivers/vfio/platform/vfio_platform_common.c
+++ b/drivers/vfio/platform/vfio_platform_common.c
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] vfio: platform: ignore missing reset if disabled at module init
  2023-01-31  8:33 [PATCH v2] vfio: platform: ignore missing reset if disabled at module init Tomasz Duszynski
@ 2023-01-31  9:49 ` Eric Auger
  2023-02-01  2:48 ` Tian, Kevin
  2023-02-01 19:47 ` Alex Williamson
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Auger @ 2023-01-31  9:49 UTC (permalink / raw)
  To: Tomasz Duszynski, Alex Williamson, Cornelia Huck, Kevin Tian,
	Jason Gunthorpe, open list:VFIO PLATFORM DRIVER, open list
  Cc: jerinj

Hi Tomasz,

On 1/31/23 09:33, Tomasz Duszynski wrote:
> 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: 5f6c7e0831a1 ("vfio/platform: Use the new device life cycle helpers")
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Thanks

Eric
> ---
> 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(-)
>
> diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
> index 1a0a238ffa35..7325ff463cf0 100644
> --- a/drivers/vfio/platform/vfio_platform_common.c
> +++ b/drivers/vfio/platform/vfio_platform_common.c
> @@ -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
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] vfio: platform: ignore missing reset if disabled at module init
  2023-01-31  8:33 [PATCH v2] vfio: platform: ignore missing reset if disabled at module init Tomasz Duszynski
  2023-01-31  9:49 ` Eric Auger
@ 2023-02-01  2:48 ` Tian, Kevin
  2023-02-01 19:47 ` Alex Williamson
  2 siblings, 0 replies; 4+ messages in thread
From: Tian, Kevin @ 2023-02-01  2:48 UTC (permalink / raw)
  To: Tomasz Duszynski, Eric Auger, Alex Williamson, Cornelia Huck,
	Jason Gunthorpe, open list:VFIO PLATFORM DRIVER, open list
  Cc: jerinj

> From: Tomasz Duszynski <tduszynski@marvell.com>
> Sent: Tuesday, January 31, 2023 4:34 PM
> 
> 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: 5f6c7e0831a1 ("vfio/platform: Use the new device life cycle helpers")

Reviewed-by: Kevin Tian <kevin.tian@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] vfio: platform: ignore missing reset if disabled at module init
  2023-01-31  8:33 [PATCH v2] vfio: platform: ignore missing reset if disabled at module init Tomasz Duszynski
  2023-01-31  9:49 ` Eric Auger
  2023-02-01  2:48 ` Tian, Kevin
@ 2023-02-01 19:47 ` Alex Williamson
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Williamson @ 2023-02-01 19:47 UTC (permalink / raw)
  To: Tomasz Duszynski
  Cc: Eric Auger, Cornelia Huck, Kevin Tian, Jason Gunthorpe,
	open list:VFIO PLATFORM DRIVER, open list, jerinj

On Tue, 31 Jan 2023 09:33:49 +0100
Tomasz Duszynski <tduszynski@marvell.com> wrote:

> 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: 5f6c7e0831a1 ("vfio/platform: Use the new device life cycle helpers")
> ---
> 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(-)
> 
> diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
> index 1a0a238ffa35..7325ff463cf0 100644
> --- a/drivers/vfio/platform/vfio_platform_common.c
> +++ b/drivers/vfio/platform/vfio_platform_common.c
> @@ -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);

Applied to vfio next branch for v6.3.  Thanks,

Alex


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-01 19:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-31  8:33 [PATCH v2] vfio: platform: ignore missing reset if disabled at module init Tomasz Duszynski
2023-01-31  9:49 ` Eric Auger
2023-02-01  2:48 ` Tian, Kevin
2023-02-01 19:47 ` Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.