dri-devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/exynos: fix .get_modes return value in case of errors
       [not found] <CGME20240423204435eucas1p2c0a9a75f87b31d11faa59fec40878f23@eucas1p2.samsung.com>
@ 2024-04-23 20:44 ` Marek Szyprowski
  2024-04-23 20:52   ` Marek Szyprowski
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Szyprowski @ 2024-04-23 20:44 UTC (permalink / raw
  To: dri-devel, linux-arm-kernel, linux-samsung-soc
  Cc: Marek Szyprowski, Inki Dae, Seung-Woo Kim, Krzysztof Kozlowski,
	stable

Commit 7af03e688792 ("drm/probe-helper: warn about negative
.get_modes()") clarified, that .get_modes callback must not return
negative values on failure, so fix sub-drivers to return 0 in case of
errors. This fixes strange Exynos DRM initialization failure on boot
(timeout waiting for VSYNC) observed on Trats2 board.

Cc: stable@vger.kernel.org
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++--
 drivers/gpu/drm/exynos/exynos_hdmi.c     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index e5662bdcbbde..e3868956eb88 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -315,14 +315,14 @@ static int vidi_get_modes(struct drm_connector *connector)
 	 */
 	if (!ctx->raw_edid) {
 		DRM_DEV_DEBUG_KMS(ctx->dev, "raw_edid is null.\n");
-		return -EFAULT;
+		return 0;
 	}
 
 	edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH;
 	edid = kmemdup(ctx->raw_edid, edid_len, GFP_KERNEL);
 	if (!edid) {
 		DRM_DEV_DEBUG_KMS(ctx->dev, "failed to allocate edid\n");
-		return -ENOMEM;
+		return 0;
 	}
 
 	drm_connector_update_edid_property(connector, edid);
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index c5ba32fca5f3..603d8bb0b03a 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -878,11 +878,11 @@ static int hdmi_get_modes(struct drm_connector *connector)
 	int ret;
 
 	if (!hdata->ddc_adpt)
-		return -ENODEV;
+		return 0;
 
 	edid = drm_get_edid(connector, hdata->ddc_adpt);
 	if (!edid)
-		return -ENODEV;
+		return 0;
 
 	hdata->dvi_mode = !drm_detect_hdmi_monitor(edid);
 	DRM_DEV_DEBUG_KMS(hdata->dev, "%s : width[%d] x height[%d]\n",
-- 
2.34.1


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

* Re: [PATCH] drm/exynos: fix .get_modes return value in case of errors
  2024-04-23 20:44 ` [PATCH] drm/exynos: fix .get_modes return value in case of errors Marek Szyprowski
@ 2024-04-23 20:52   ` Marek Szyprowski
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Szyprowski @ 2024-04-23 20:52 UTC (permalink / raw
  To: dri-devel, linux-arm-kernel, linux-samsung-soc
  Cc: Inki Dae, Seung-Woo Kim, Krzysztof Kozlowski, stable

On 23.04.2024 22:44, Marek Szyprowski wrote:
> Commit 7af03e688792 ("drm/probe-helper: warn about negative
> .get_modes()") clarified, that .get_modes callback must not return
> negative values on failure, so fix sub-drivers to return 0 in case of
> errors. This fixes strange Exynos DRM initialization failure on boot
> (timeout waiting for VSYNC) observed on Trats2 board.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Ah, I've missed that this has been already fixed in -next by the patch 
13d5b040363c ("drm/exynos: do not return negative values from 
.get_modes()"), so ignore this one. I'm sorry for the noise.

> ---
>   drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++--
>   drivers/gpu/drm/exynos/exynos_hdmi.c     | 4 ++--
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> index e5662bdcbbde..e3868956eb88 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> @@ -315,14 +315,14 @@ static int vidi_get_modes(struct drm_connector *connector)
>   	 */
>   	if (!ctx->raw_edid) {
>   		DRM_DEV_DEBUG_KMS(ctx->dev, "raw_edid is null.\n");
> -		return -EFAULT;
> +		return 0;
>   	}
>   
>   	edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH;
>   	edid = kmemdup(ctx->raw_edid, edid_len, GFP_KERNEL);
>   	if (!edid) {
>   		DRM_DEV_DEBUG_KMS(ctx->dev, "failed to allocate edid\n");
> -		return -ENOMEM;
> +		return 0;
>   	}
>   
>   	drm_connector_update_edid_property(connector, edid);
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index c5ba32fca5f3..603d8bb0b03a 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -878,11 +878,11 @@ static int hdmi_get_modes(struct drm_connector *connector)
>   	int ret;
>   
>   	if (!hdata->ddc_adpt)
> -		return -ENODEV;
> +		return 0;
>   
>   	edid = drm_get_edid(connector, hdata->ddc_adpt);
>   	if (!edid)
> -		return -ENODEV;
> +		return 0;
>   
>   	hdata->dvi_mode = !drm_detect_hdmi_monitor(edid);
>   	DRM_DEV_DEBUG_KMS(hdata->dev, "%s : width[%d] x height[%d]\n",

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

end of thread, other threads:[~2024-04-23 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20240423204435eucas1p2c0a9a75f87b31d11faa59fec40878f23@eucas1p2.samsung.com>
2024-04-23 20:44 ` [PATCH] drm/exynos: fix .get_modes return value in case of errors Marek Szyprowski
2024-04-23 20:52   ` Marek Szyprowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).