From patchwork Mon Oct 23 14:40:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 156916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1343956vqx; Mon, 23 Oct 2023 07:42:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTOZkcBqA11FKIhbYw+YylAOh7ZXJQhZvR23SpwVdh6bRL7mt2UP52yD4YHXk5DDp5IXjM X-Received: by 2002:a17:903:110c:b0:1c6:a0b:7b9a with SMTP id n12-20020a170903110c00b001c60a0b7b9amr10793020plh.3.1698072144560; Mon, 23 Oct 2023 07:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698072144; cv=none; d=google.com; s=arc-20160816; b=c6TzTn9HzX85XLfxA3yQg91aoT6X+pCuImslfmtlUEmEDzyaM1AfWIEALN2GalD272 JpBzy1I74NwSZIo5nwzC5XJVcF3DfSLJ7itWbobbkxj3cWF+1Qx5DZ/yOS7DtRym0c1/ AnNy7vb7zmFzDo0Au3KUUH3qkaFNUltNupvt4sfuO4/uHxLaG4sz4oLlvwLgJgScIt6g cyMBDxzCjNzNSb/6jcpvPIWI+ItGmp030v1h2VbzRDKzQkZO9AEP+J/rAaB0SkIl5EB+ cOf9UaZWDun6DnLSVR7SjSfSl13r5sYr+ySs7gny23df4LXdc/9ujEw+YrNqLPqx4rpy tkuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=pH3GFq5D69xS1Tzi4QqCw1RIdz10bV1qyKuEWVVtejs=; fh=CvG8/UK3FLNvCIA0fkg4/uAmTCU/S+E1ea33XkR1q4Y=; b=kNjcf5lD9qtiruWG3rXonOrAvlj/BD5GsRyIiokoZIy4/TCp4L9RsmpudTOZIoyjN9 hPc+V9f56bCkpY18elrDcBBSt/+rpjwhlCczF4TwscVPPA7Fl1KG7Ll6UZQtOrI8HEJU 6RiSSJ8vyePaqEliqhNX4uDl0i3AGnzP5v8jV0Kce+1CoGHDS82/tEEIx3P2XWja6yZr dR0S14rDyC8OkU7ty+z4IFn5WcVxLli/3+LvNZboUrO62lPak18m0MRNgkCay1RXRNvg DvL9giJ+Y7j037wf+6adM1LttZUy3TvMaOsYBODTKDDNbmAv/4O/RTsEq8DnoBTpyQ/A h4OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=prKJdHAH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id z14-20020a170903018e00b001ca344f46efsi7003564plg.330.2023.10.23.07.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 07:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=prKJdHAH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C9B348061375; Mon, 23 Oct 2023 07:42:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233737AbjJWOmM (ORCPT + 27 others); Mon, 23 Oct 2023 10:42:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233761AbjJWOl3 (ORCPT ); Mon, 23 Oct 2023 10:41:29 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 916A61BDC for ; Mon, 23 Oct 2023 07:41:04 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6ce2ea3a944so2387036a34.1 for ; Mon, 23 Oct 2023 07:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1698072064; x=1698676864; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pH3GFq5D69xS1Tzi4QqCw1RIdz10bV1qyKuEWVVtejs=; b=prKJdHAHeZeCr6EWLPyJroloWdSm/JdWcrytG1aMhJ+2Uqj/qfwoPBijKk0D9BVB8u t+Nb8eio69BRQekkfb4aEo3HeQ60M2OvO07zqQDwJqoApQzTW0rZbNPkIKPPrxAzRBi7 Xtq+bjYCisGp6/ujm6YT1oREiB8yjdA9Ft1LpQvgfw94A3/q6qjCzZ7ZAIqfPeC48NLZ L+jPgOMvcxEnAfypmw4ThWiZAXpZRJ8HAT1UCSycflIRvjb3WgMwxWJumkN67j//Y7NY X1UrLE2eu9dwZhzOf1/4gVCXYOB9MwPFAfVLvttd6nKfzF78dEDKvEIaA52tuPIBo3KI o+DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698072064; x=1698676864; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pH3GFq5D69xS1Tzi4QqCw1RIdz10bV1qyKuEWVVtejs=; b=lSIj6IOYEctadjZ/Gxeb3vA5ib6919zV5VjatbHdr+Pd7kVZxgQI9WK2L7vhIm3AF6 ZY6SVLvN2rRJ9PlEjSOQVqjGZUyltOkhmd/83JSDy6z2j2VPYEevP7ytBiOc2Rp2eeGv yGrmdWlmmV8fTBEoXS9GQYm+bKahUnXgkvJ13kC5BgN7vKNCYnbiwDILQxLgFBdjuGF+ fGEpboahaDUr0oFmIrcx/bkf3hNlj+3lzyXgJcNJGtBnyu2uPRG0HMaxBNuhH67hA5mk ElCKlRUmWfywVBnSyPvzhzF9jeBqN/wEs/X0KTpIvtD6bQU/eMr59OY0N87ysuFVbBtB LbMQ== X-Gm-Message-State: AOJu0YzC7w/UNQocmzhxqcx86RaJsjRqYiKG8zGRd28URN+tbilLCYhZ ZGITQzQkciJf5KUVagI4JIwxOA== X-Received: by 2002:a9d:6188:0:b0:6bd:c8c2:b70f with SMTP id g8-20020a9d6188000000b006bdc8c2b70fmr9880668otk.34.1698072063987; Mon, 23 Oct 2023 07:41:03 -0700 (PDT) Received: from [127.0.1.1] ([93.5.22.158]) by smtp.googlemail.com with ESMTPSA id f1-20020a05620a408100b007789a3499casm2725020qko.115.2023.10.23.07.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 07:41:03 -0700 (PDT) From: Alexandre Mergnat Date: Mon, 23 Oct 2023 16:40:13 +0200 Subject: [PATCH 13/18] drm/mediatek: dsi: Improves the DSI lane setup robustness MIME-Version: 1.0 Message-Id: <20231023-display-support-v1-13-5c860ed5c33b@baylibre.com> References: <20231023-display-support-v1-0-5c860ed5c33b@baylibre.com> In-Reply-To: <20231023-display-support-v1-0-5c860ed5c33b@baylibre.com> To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Jitao Shi , Xinlei Lee , CK Hu , Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Catalin Marinas , Will Deacon Cc: dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, Alexandre Mergnat X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1234; i=amergnat@baylibre.com; h=from:subject:message-id; bh=M0lgMNEWbaoZ4qkfmFQ2d2c6SqYe0EzRwVFM4lhot+4=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBlNoXP9F3RAu1ZKmUXEIyW8a/kP5CK+Jb3tGF7IdoH 1RqcA3mJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCZTaFzwAKCRArRkmdfjHURTPOD/ 9t+6pSLsY0qJ4yNYIAy8Yj64n+qV7yRH4vlC9ppkx91ePv2Sf/rsw1+QRG5hlj0j3d5dWf0ZGe/qPt DjapblIQRzzn7BcMUQD/gavAeQ+YuLMd4IOyVk4uXEBjys9STpAuYQuKC03y3NcyjL6JWTj2fmFXTq FSDDYsV/wNBpk5ALR2J7sE92+GGZXhthAmqro6CeVxpKs8z4H+c8lJOUUGaohZDWJkzoPl3QJssrhq XljafCvUMlRJYbGBRWHusF+de6q6F9tY7mJoX2udGUIrH/cZR16ydBWCpSVaFEKmGEioAQXsFQ1JpS 3/FHHTBX2h2nfGJQ2eT5muUbMii7hB7u5QWiVCF3BFBfzU4ketZCF3bj5Dk9xLBskq1ddV951Z1VJq aWbuUgtjoALtwalhNzN12FffvNPsJIBz4z1TjRHf/cK4a6jaXgVBorbrdg3g+HRu0BH+uAGnC6c1j1 BZhh5BAQvMKdxFZnbk/zwmdsmAwXbfIPVcs2R2rk5mriJ4BOy13/lj/L2c/671sxkorHAFPtQUsi9I 4XIePB314S80C1hBbP4Le8sz3x/gPiLeaQOFxu1Y38FmqYPDFc9iZvDBov3qmHwo1awkx6YyeMuOrY kr/y4GCxn8tSG8oU6g3QQsh+p+1wUWzZ6V47BRTgBHkVb5pT5lxJo6zeFjNg== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 07:42:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780557697049341913 X-GMAIL-MSGID: 1780557697049341913 Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered before mtk_dsi_poweron. lanes_ready flag toggle to true during mtk_dsi_lane_ready function, and the DSI module is set up during mtk_dsi_poweron. Later, during panel driver init, mtk_dsi_lane_ready is triggered but does nothing because lanes are considered ready. Unfortunately, when the panel driver try to communicate, the DSI returns a timeout. The solution found here is to put lanes_ready flag to false after the DSI module setup into mtk_dsi_poweron to init the DSI lanes after the power / setup of the DSI module. Signed-off-by: Alexandre Mergnat --- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index d8bfc2cce54d..81cf0ddcc399 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -668,6 +668,8 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi) mtk_dsi_config_vdo_timing(dsi); mtk_dsi_set_interrupt_enable(dsi); + dsi->lanes_ready = false; + return 0; err_disable_engine_clk: clk_disable_unprepare(dsi->engine_clk);