All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5] drm/bridge: anx7625: Return -EPROBE_DEFER if the dsi host was not found
@ 2022-01-17 10:09 ` owen
  0 siblings, 0 replies; 4+ messages in thread
From: owen @ 2022-01-17 10:09 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Xin Ji, Sam Ravnborg, Pi-Hsun Shih, Tzung-Bi Shih, Hsin-Yi Wang
  Cc: Maxime Ripard, dri-devel, linux-kernel, owen

From: owen <qwt9588@gmail.com>

It will connect to the mipi dsi host and find the corresponding 
mipi dsi host node, but the node registered by the mipi dsi host 
has not been loaded yet. of_find_mipi_dsi_host_by_node() returns -EINVAL 
which causes the calling driver to fail.

If the anx7625 driver is loaded afterwards the driver requesting 
the mipi dsi host will not notice this.

Better approach is to return -EPROBE_DEFER in such case. 
Then when the anx7625 driver appears the driver requesting 
the mipi dsi host will be probed again.

Signed-off-by: owen <qwt9588@gmail.com>
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 2346dbcc505f..297bbeb5aae0 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1660,7 +1660,7 @@ static int anx7625_attach_dsi(struct anx7625_data *ctx)
 	host = of_find_mipi_dsi_host_by_node(ctx->pdata.mipi_host_node);
 	if (!host) {
 		DRM_DEV_ERROR(dev, "fail to find dsi host.\n");
-		return -EINVAL;
+		return -EPROBE_DEFER;
 	}
 
 	dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
-- 
2.31.0


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

* [PATCH v5] drm/bridge: anx7625: Return -EPROBE_DEFER if the dsi host was not found
@ 2022-01-17 10:09 ` owen
  0 siblings, 0 replies; 4+ messages in thread
From: owen @ 2022-01-17 10:09 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Xin Ji, Sam Ravnborg, Pi-Hsun Shih, Tzung-Bi Shih, Hsin-Yi Wang
  Cc: owen, Maxime Ripard, dri-devel, linux-kernel

From: owen <qwt9588@gmail.com>

It will connect to the mipi dsi host and find the corresponding 
mipi dsi host node, but the node registered by the mipi dsi host 
has not been loaded yet. of_find_mipi_dsi_host_by_node() returns -EINVAL 
which causes the calling driver to fail.

If the anx7625 driver is loaded afterwards the driver requesting 
the mipi dsi host will not notice this.

Better approach is to return -EPROBE_DEFER in such case. 
Then when the anx7625 driver appears the driver requesting 
the mipi dsi host will be probed again.

Signed-off-by: owen <qwt9588@gmail.com>
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 2346dbcc505f..297bbeb5aae0 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1660,7 +1660,7 @@ static int anx7625_attach_dsi(struct anx7625_data *ctx)
 	host = of_find_mipi_dsi_host_by_node(ctx->pdata.mipi_host_node);
 	if (!host) {
 		DRM_DEV_ERROR(dev, "fail to find dsi host.\n");
-		return -EINVAL;
+		return -EPROBE_DEFER;
 	}
 
 	dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
-- 
2.31.0


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

* Re: [PATCH v5] drm/bridge: anx7625: Return -EPROBE_DEFER if the dsi host was not found
  2022-01-17 10:09 ` owen
@ 2022-01-17 15:42   ` Robert Foss
  -1 siblings, 0 replies; 4+ messages in thread
From: Robert Foss @ 2022-01-17 15:42 UTC (permalink / raw)
  To: owen
  Cc: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, David Airlie, Daniel Vetter, Xin Ji,
	Sam Ravnborg, Pi-Hsun Shih, Tzung-Bi Shih, Hsin-Yi Wang,
	Maxime Ripard, dri-devel, linux-kernel

Hi Owen

On Mon, 17 Jan 2022 at 11:10, owen <qwt9588@gmail.com> wrote:
>
> From: owen <qwt9588@gmail.com>
>
> It will connect to the mipi dsi host and find the corresponding
> mipi dsi host node, but the node registered by the mipi dsi host
> has not been loaded yet. of_find_mipi_dsi_host_by_node() returns -EINVAL
> which causes the calling driver to fail.
>
> If the anx7625 driver is loaded afterwards the driver requesting
> the mipi dsi host will not notice this.
>
> Better approach is to return -EPROBE_DEFER in such case.
> Then when the anx7625 driver appears the driver requesting
> the mipi dsi host will be probed again.
>
> Signed-off-by: owen <qwt9588@gmail.com>
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 2346dbcc505f..297bbeb5aae0 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -1660,7 +1660,7 @@ static int anx7625_attach_dsi(struct anx7625_data *ctx)
>         host = of_find_mipi_dsi_host_by_node(ctx->pdata.mipi_host_node);
>         if (!host) {
>                 DRM_DEV_ERROR(dev, "fail to find dsi host.\n");
> -               return -EINVAL;
> +               return -EPROBE_DEFER;
>         }
>
>         dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
> --
> 2.31.0
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>

Applied to drm-misc-next.

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

* Re: [PATCH v5] drm/bridge: anx7625: Return -EPROBE_DEFER if the dsi host was not found
@ 2022-01-17 15:42   ` Robert Foss
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Foss @ 2022-01-17 15:42 UTC (permalink / raw)
  To: owen
  Cc: Jonas Karlman, David Airlie, dri-devel, Neil Armstrong,
	linux-kernel, Jernej Skrabec, Tzung-Bi Shih, Pi-Hsun Shih,
	Laurent Pinchart, Andrzej Hajda, Hsin-Yi Wang, Sam Ravnborg,
	Xin Ji, Maxime Ripard

Hi Owen

On Mon, 17 Jan 2022 at 11:10, owen <qwt9588@gmail.com> wrote:
>
> From: owen <qwt9588@gmail.com>
>
> It will connect to the mipi dsi host and find the corresponding
> mipi dsi host node, but the node registered by the mipi dsi host
> has not been loaded yet. of_find_mipi_dsi_host_by_node() returns -EINVAL
> which causes the calling driver to fail.
>
> If the anx7625 driver is loaded afterwards the driver requesting
> the mipi dsi host will not notice this.
>
> Better approach is to return -EPROBE_DEFER in such case.
> Then when the anx7625 driver appears the driver requesting
> the mipi dsi host will be probed again.
>
> Signed-off-by: owen <qwt9588@gmail.com>
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 2346dbcc505f..297bbeb5aae0 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -1660,7 +1660,7 @@ static int anx7625_attach_dsi(struct anx7625_data *ctx)
>         host = of_find_mipi_dsi_host_by_node(ctx->pdata.mipi_host_node);
>         if (!host) {
>                 DRM_DEV_ERROR(dev, "fail to find dsi host.\n");
> -               return -EINVAL;
> +               return -EPROBE_DEFER;
>         }
>
>         dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
> --
> 2.31.0
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>

Applied to drm-misc-next.

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

end of thread, other threads:[~2022-01-17 22:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 10:09 [PATCH v5] drm/bridge: anx7625: Return -EPROBE_DEFER if the dsi host was not found owen
2022-01-17 10:09 ` owen
2022-01-17 15:42 ` Robert Foss
2022-01-17 15:42   ` Robert Foss

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.