Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp72862lqb; Tue, 16 Apr 2024 09:07:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+djsRT6QRfFWoBZ5ImEuFmZ2OGghWYZ9jjgDMJY9tZlSnweYKeURxI9olo8ykWc/v065Y16NwNtvTNuwK3b2jWzwqqlqU0iJB8RXgTw== X-Google-Smtp-Source: AGHT+IH4NqRpDdlp0Ur5M9FiLHypu80ia1Wwmae1ou+b1ZjN4cBPeFZ2vUl34g8Kiphz685g25dj X-Received: by 2002:a17:907:9301:b0:a52:54ec:33ad with SMTP id bu1-20020a170907930100b00a5254ec33admr5879694ejc.5.1713283640356; Tue, 16 Apr 2024 09:07:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713283640; cv=pass; d=google.com; s=arc-20160816; b=B3U/QsvLHQUpaLKfEMn7eq33lB19GssxqOut98gLMoeEL8XPcNvhvm4NPZMRpag600 CoOU8qy9QnIVmN/W0/JYNSpjRMlA4u5/TW15yXLyQDNWOibScmncu0Ph2s0whJGRJVTK V5Ou2g87x/CmdQIr0AE2jbX4gq0JPmPNPDnJghe/Ax9oJboyIcPFcSITeo2mS7mafK2g ccJgOJLxz432MEkzne4XCG+Wq43sR2x8rC7fHAdCMNs7cYvTyw1QzZTdXIG/fBeWz6gg qCTAg4VvfVqrhDK1VKuE5h9V5pGo06tEjpt+5UhNg2dTZnoPWohmQH4Gx1Au+hn7fkw9 BQBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=hFmw2QUwgoo6nZ5hxL4W4XLY0gvCpX+AxZ6V2ssaQtQ=; fh=+pkq1xVFtC7zfqukENchXq1BwB4FAqJApzjFqHQKrFo=; b=FkL4azck2zCNWNsOY5DixamEV+FhB1UeM2eZMMDwGBlufB37hT5fEJ2N5xTZervfCZ gze1eCKAYRQSOiYz9rAbgAOd6FzoTD+xlrfJo9xXvoTv4YxSYZbF6PAP0dg7oJ0ViK22 Bb8+8d6lq2HNKS5cf5JKKMBT7uoNFJ5s7MGSdfnO2osJ9FznHlo9al88fM8DoL9WRO6Z iZpl98gxtRQXs5vAlGe1sMRTnLuNxXgUW/a1Wa3dk3QFpwB8Sw19jrQDxkNcUy3vcO70 q742CENTgu0JPHg9KFgGSOKj4837XFvYvc1/YjT3Cg6lFehVUAnEIjSROeaDjuTAUyjd JiwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=Kf2lhLU5; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-147177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147177-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fi10-20020a170906da0a00b00a51e45426aasi5784171ejb.515.2024.04.16.09.07.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 09:07:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=Kf2lhLU5; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-147177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147177-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E59F91F25782 for ; Tue, 16 Apr 2024 15:58:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D45481327F9; Tue, 16 Apr 2024 15:53:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="Kf2lhLU5" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 258AC13A3F1 for ; Tue, 16 Apr 2024 15:53:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713282822; cv=none; b=G2YlpSqR8A9LsQaBHwCBU3ogk+FBkw8PaX5mizB2yl7GBMDEUEH9vhhFyTN/z/JTOS84weVDhgffUveYyiai5B5XnJtxhigDWsf9VXCxhzofy+C7/8rviyMdDym4ABMGyltrieU12p7GuyHFbRyY8Lj3Ciaq8UcIr6KzzvZ4AL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713282822; c=relaxed/simple; bh=2MnuLxaHZbaJPVARTKFt1rzwpEZuIuXZwcM1ZfvOkrE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D5cCao87/OgQ5KVawA/zRDC7S/dD4H/qJIYnPUSs6kwSkXiCAY3niFsEdPfqpTuaVRlHQBPV8o6JJI+Whe4llNNl3QQKoeCLOkDy0EfOOvUNlSKlNzQ3qqhuUP5yGhO9tlnaFVzhMZ4GHq88eQ3dHkyy5cewM1Oj0hQR8RJG2gA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=Kf2lhLU5; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a450bedffdfso583334566b.3 for ; Tue, 16 Apr 2024 08:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1713282819; x=1713887619; 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=hFmw2QUwgoo6nZ5hxL4W4XLY0gvCpX+AxZ6V2ssaQtQ=; b=Kf2lhLU5xD9oSq/ArBxuZzrIP1EoqehfOU2kBwmwakbmau2pRBQbQKnikbGZuCnO/J 5IRjJAkIsVxgA4XX8jWdbOizA2WQbC3nADig+umOuUAPQ0SpIWLGk2W6QfJDW8UUj22A peC3Lf5JWItfaOpQvsHF1zz5+AjI3Hl4Jvsk6h1HcVYKkC/WGeXZNvR+/KE7IuF5R1zO 5+8frP8Qcsfc+biJ+MnbHCI6hZcInhJN9Nw54bDSdFpSAioS8Aiz9E6wQnAlNRyoYkkr 7DXF7tyn+mYnqNXzXqDAARz21+Sj8j3kGG9ftAr9Dksfzapp5rOxOlfrf9adz1tYZ3FH e4Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713282819; x=1713887619; 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=hFmw2QUwgoo6nZ5hxL4W4XLY0gvCpX+AxZ6V2ssaQtQ=; b=llOYkvcJMrAiiK1rfS+9XTN1p47HWxLbYpckB5Jn/THxPr66NzLnjaYlx1yz98PVeQ Nz1puUoEcVdgHi5l9lYSPGKZvpQlNmnc/mwNDNKeH69YlKGHu/nmGPenG8qTotpjbEvx TYA8qcPs0Q8+sQVzg/kJpn9xWny6lLhzzHxTiwh65xZf9opyWdU5XpxVqx6cPk8gXVAO InrMIFkEWkDToYP0uPDB5f3q4btJxHmdcL7sTngQoSha6cRiD1DQpLcXRf+Y6azvUBrL cvE581k5w5Y7bJHXXgDks77GQGi0uQcen9DNh6zss1e4Xx+1/1unpk6QzJejnWKGTEeP XK/Q== X-Forwarded-Encrypted: i=1; AJvYcCWQJ1s3a0HrlPsbABcQj0AxakTk08BZmzWmbuWzm1oIjFTO21vHivKgAxl3lEtBe0DnGThvE0//yIbIRD7M+xZ4ADYOmiBPsIO3EadT X-Gm-Message-State: AOJu0Yx84mpaVdst/H+joFi1YbYG1vICgqeRcT+0UKd7LVIJ9nDaWA7F bAYFINPcxvne8bsYRgSKtjL3m2H278U5kqzZsSnYzXXL7ejHNUNx+6Wwe4OqtcE= X-Received: by 2002:a17:906:d10a:b0:a52:71bf:2c4c with SMTP id b10-20020a170906d10a00b00a5271bf2c4cmr3533190ejz.0.1713282819612; Tue, 16 Apr 2024 08:53:39 -0700 (PDT) Received: from [127.0.1.1] ([93.5.22.158]) by smtp.googlemail.com with ESMTPSA id d12-20020a170906174c00b00a52567ca1b6sm4156691eje.94.2024.04.16.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 08:53:39 -0700 (PDT) From: Alexandre Mergnat Date: Tue, 16 Apr 2024 17:53:14 +0200 Subject: [PATCH v2 13/18] drm/mediatek: dsi: Improves the DSI lane setup robustness Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231023-display-support-v2-13-33ce8864b227@baylibre.com> References: <20231023-display-support-v2-0-33ce8864b227@baylibre.com> In-Reply-To: <20231023-display-support-v2-0-33ce8864b227@baylibre.com> To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Jitao Shi , CK Hu , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Michael Turquette , Stephen Boyd , 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, linux-clk@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=2MnuLxaHZbaJPVARTKFt1rzwpEZuIuXZwcM1ZfvOkrE=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBmHp7qd8Sx/coFLTSFkDfsduMzD+AJNcJ4tDhOCv0h 3ncqyFaJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCZh6e6gAKCRArRkmdfjHURdFBEA CJgnEAdPK62hUZxj5SmThZ5GkBCuZIyk3P52tbmYtB+jyZS+Tm9SamHgXoImaoOJxr2c/eLN6dvvPN RXqbf2LoKutEccLUvet1qjcG1VQ3Y97HO+Af0mpbAIXcckeiQWZEQAuASMUTjEOpyc8WYeFadNOFWY xpVRY+nVMyYX5MTFxrqlCzSgB0RGJYQnily350VHOpioNsNSS+M4n23mW4liEOaXow+a08pqBx4hC1 ARNjftB0eGqrwymHP//U+jEA8HFu7aOnmkeqpQf1wv16F4hsqhDAQNxlaAe87s1p1fuk2E3MzMShm3 h5C/GK45SLykya4NZfpzz8sFaln1av/ogexAQ3L64zlC8WrZapNXaf3rbnt5wH41KWvP9jCZGKJ/Eq liW/EqvlQGqHX+OWDejwMbtuxVdsPwBpQ9pVZiyzEjlpLz/aXtSl5NxFI0Tew83KmZbSIwrECeoqyU snhRMJNiEcf1Qx8EWqsQzdpYLd10GadAI6SF8toslrmcGUnlGAnV25AmCD/a48L6hKuAYcw/bO6jaF DfhzlGkbVb1mxLE07cd5xEqQqLpQljHkx4YqwGO5ZhFc/K3ECQ7xPQeeGlB1Z9hz21ZldwS1U/3tr1 sHz2UEwm99UXyQnV+OmKp0j0n4LYTdJazChU72qVtzvtZca+boZXyAULWhyw== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 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 9501f4019199..b3f33d4d3d5c 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -642,6 +642,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); -- 2.25.1