From patchwork Tue Apr 23 20:44:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 13640630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62A71C4345F for ; Tue, 23 Apr 2024 20:45:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version:Message-Id:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: List-Owner; bh=7CqO8d3LTjMhoO4zJIuAPw95A0xbABz6X/zXZPIhjxA=; b=RJY2ZOlMO4w7lr 1DCWsPCZBNhY2S7znYDtCTfomVxPk4rrTwrt6nvPS2gm+tUpG15aC7kG2kidmi1095TIcmrjSTrCS HKt2UA5PvdC9iBQOraHEUDpy8gux+eShaYMEEH7KaGwOptx9JrMT8JHisf2FSvCou6kIjpkLFo5vp 8F2QpjA4KVhlQp6ItacKYToONJ9AryGtNunNs2ltr8QGyVhQaaXX1YftdYmIYLg5Q4r1QaVh8lgF/ lhtPIqxcQPb8DK9v6VKQ8Gr5GdOw8YoIEVsh/xBfcZcOMRkHJPHIVxX7QU/qFQ9T9NOlNI1Qw05Au S0g4pqbVNUnUIzKax+Yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzN0Z-00000001Rfm-13tt; Tue, 23 Apr 2024 20:44:55 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzN0T-00000001ReG-3sUd for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2024 20:44:53 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240423204436euoutp01cf10cafef4c130bf73d314a780f130b7~JA5YZu_vk3100231002euoutp01P for ; Tue, 23 Apr 2024 20:44:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240423204436euoutp01cf10cafef4c130bf73d314a780f130b7~JA5YZu_vk3100231002euoutp01P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1713905076; bh=h8e/uzOGG9alR5TqJbZSWl8yJHNgm6AunoUkZ/Nzuu0=; h=From:To:Cc:Subject:Date:References:From; b=u4BXH/sYksXWEhePjFRpWaLdoCLyCrf619SXauvKBLUcAuvDYjlK2O8iapqj/Reri CJHb5csnZfyOM8TndRNc38jRQFJNyjERmpbPBec1t504BfciLL1WFK0NAkEzf+KRf4 1V9M2N98muVLRw/ue5GBRsraZD/wYEkbb4Axpb/4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240423204435eucas1p1928c6bb8134fd2ad904072aa6bab0d1f~JA5XvLNvI1155811558eucas1p1Q; Tue, 23 Apr 2024 20:44:35 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 7A.E9.09875.3BD18266; Tue, 23 Apr 2024 21:44:35 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240423204435eucas1p2c0a9a75f87b31d11faa59fec40878f23~JA5XY1WfI2538925389eucas1p2N; Tue, 23 Apr 2024 20:44:35 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240423204435eusmtrp1084d009601a002a5424fd1c0951acf7b~JA5XYTFma1907419074eusmtrp19; Tue, 23 Apr 2024 20:44:35 +0000 (GMT) X-AuditID: cbfec7f4-11bff70000002693-44-66281db3355c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 93.07.08810.3BD18266; Tue, 23 Apr 2024 21:44:35 +0100 (BST) Received: from AMDC4653.digital.local (unknown [106.120.51.32]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240423204434eusmtip179b0bdf8e6cafaadec2530490ede99de~JA5W6SNte0260002600eusmtip1J; Tue, 23 Apr 2024 20:44:34 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH] drm/exynos: fix .get_modes return value in case of errors Date: Tue, 23 Apr 2024 22:44:31 +0200 Message-Id: <20240423204431.3288578-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGKsWRmVeSWpSXmKPExsWy7djPc7qbZTXSDE5OVLK48vU9m8Wk+xNY LM6f38BusenxNVaLGef3MVmsPXKX3WLBxkeMFjMmv2Rz4PDYtKqTzeN+93Emj81L6j36tqxi 9Pi8SS6ANYrLJiU1J7MstUjfLoEr43erXUEPf8WxvoNsDYx3eboYOTkkBEwk9q9vZe9i5OIQ EljBKNF08T+U84VRYunXJkYI5zOjxJ1vm9lhWr7vXsIGkVjOKLH92BKEls41x1hBqtgEDCW6 3naxgdgiAnkSV6e1s4IUMQ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Yx3eboYOTkkBEwkvu9ewtbFyMUhJLCUUWL/pf+MEAkZiZPTGlgh bGGJP9e62EBsIYFPjBInf1mC2GwChhJdbyHiIgIFEn+XHmECGcQssJ9R4ve1m2DNwgJeEjv6 77CD2CwCqhKLH/aydDFycPAK2EvcWGEPMV9eYv/Bs8wgNq+AoMTJmU9YQGxmoHjz1tnMExj5 ZiFJzUKSWsDItIpRJLW0ODc9t9hQrzgxt7g0L10vOT93EyMw0Lcd+7l5B+O8Vx/1DjEycTAe YpTgYFYS4f31RyVNiDclsbIqtSg/vqg0J7X4EKMp0HkTmaVEk/OBsZZXEm9oZmBqaGJmaWBq aWasJM7rWdCRKCSQnliSmp2aWpBaBNPHxMEp1cBUuLs97s2nz+6XZyiLbrd5mvFtg8qTP0c3 dS84UstdOSvq3YPaltB9nRPNdUQ+xl25JcBfLMt77Zoyq2zis/Pym2cmVQd98uY9/v3b1Lep tcUb/K8U6Wyb7HxyQWvs8fhdPWKT9EpUlk/66czF82oxz7+47uW2cmGxftFXn0xf8TAreGlV dWCx072XJ6t5RA/c5W5+xOzYXDz/zNbk1H9zX0dERN/+I6katvINxzu3NcbX3E7WF3I7+s/Z dClWT6aW17rIM3oGy7wgyXCxxrDlTZo7mNmUin+In5q7YfnUdPkNqr5lTLM229/Vv1PsYrbJ 5+yUBy/fdDz7bcTmY+hVU+2/PD/v25IJE5u/JtYrsRRnJBpqMRcVJwIA7MECf/0CAAA= X-CMS-MailID: 20240423204435eucas1p2c0a9a75f87b31d11faa59fec40878f23 X-Msg-Generator: CA X-RootMTR: 20240423204435eucas1p2c0a9a75f87b31d11faa59fec40878f23 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240423204435eucas1p2c0a9a75f87b31d11faa59fec40878f23 References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240423_134451_220471_19A0C9A3 X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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",