[PATCH] drm/exynos: fix .get_modes return value in case of errors

Marek Szyprowski m.szyprowski at samsung.com
Tue Apr 23 13:52:37 PDT 2024


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 at vger.kernel.org
> Signed-off-by: Marek Szyprowski <m.szyprowski at 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




More information about the linux-arm-kernel mailing list