From patchwork Thu May 23 12:49:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13671785 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 6F07DC25B7C for ; Thu, 23 May 2024 12:52:28 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5gSOA0rNwUSR43eA63Wqt7Er5TF9FTVAQlBdUpZqHoc=; b=w68/crPRmoPEG8 0kl2YBA/48kCDReuBGNwNccvj59N5gwsnsCDFWwEONpapkN0R2itUCJRVu1mOBABdKt5Dj06wob6u lG/B91x2S8XYw8288/mxr7FVEObY2xzM/hWa3rIuo6Lz39gUP4TX6bkbAMoywdbUYYqS1RcZSvOjN RFCiWwYSJV4n9nbij2+vRTvvZ1kEgbFqaoe/uRtl7olRGPX8TChoZ3aXtFlxc2aNa90qp5ShfyMjM rx4S4KAg9LIikzfTce9990kphxlrHtwImGpkxDa+RYvV4bQOGbqHQgoNLWxBvhi3vcLwogaG+Sfe5 Lt5hzo+0AvmPfWJkIR1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sA7vc-00000006GjU-2bNh; Thu, 23 May 2024 12:52:16 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sA7t8-00000006F3V-49Tc for linux-arm-kernel@lists.infradead.org; Thu, 23 May 2024 12:49:45 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-351da5838fcso5857533f8f.1 for ; Thu, 23 May 2024 05:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1716468581; x=1717073381; darn=lists.infradead.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=28zbSoB8+Zxd+IxXtMzgHHKE2gbwNBphtmm6Xt7tCzg=; b=gmyPLb4EN8g06nQB59qgZBx8pYf/fybsLpZhfXkuLDuqD0J1+zRDYYQvbg2PHtnZ6i bymGdsJ3OlmO8l2XfJKXy15wCAPAn6D4emfos0YAAQLjL6Z1pyr9r8IVDUdB4XZ82f8h F/Y14p0R3Oi5pKC0BN6LbPUdPdMjArpo54HAPrmuWbO7iQSJb/Boktnngye18mWdV416 qwB0gX/XY1mRIVu2zz3mw1OUo6DMGoRh2puh1KpkSQdV3N6bfipgpvn51S1wbtBwAbGH aUYmRN043whSqYSD7KlHGtlqXtAZK+LrkkhfTpzt2JnME/5bsQ48OnvMAci1n/ZqEO1R J9aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716468581; x=1717073381; 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=28zbSoB8+Zxd+IxXtMzgHHKE2gbwNBphtmm6Xt7tCzg=; b=uNlVYLPj1d2pkqTO8rYzjYLfcLglEKJ+ZziaBXxYoVmKgwVmtvpO4n5CJ5iUtGtO6p IAWJvno6nrFF/JzcFwFW1U4jOu0IIsV4Smhdn8CESfx+ezG1Z3ibDT8oTTYSpulsvQok PzzFAu0fi0G5dyaboRXruw0h8rwrP2qathLWjDdX9DqbbMVrsbfLympuKYNCqUTvSPZO PnW/t2gNwrVrPKhk8dxH36SVzoO/G60+mHrLZXr6FvvfUtjT39gf5joF+M6s5Yexx5+y 9/k8s8MlN6OBDfwrAmDcD6w9gDmdWXUKsIiMAT183hfBW1NidNi3R7UVfgzvbZuqb8q3 TEeg== X-Forwarded-Encrypted: i=1; AJvYcCW/F5AhEmXnEGJ/xLBMaBsfmbOpMpzesdQukB4ze+aWgpyoHdtImdf/sr+mGSh2Rqt7lsYZLItRTvQV5qrm/DE76SLwa5ScU9vCQpuuN3cFgBXjkcc= X-Gm-Message-State: AOJu0YwSTZ+e5PznSvcs0EGfVvt/z1pNIL5pZKP2ZFU0y2Vex+0UXt12 NCuMaQHmI+xJflsaLNqn/s/i5wJmOIDqp8LH80L54J3pGvDGlL924Wd6nrHQmUY= X-Google-Smtp-Source: AGHT+IH9I1yKELxeEkwniF+9niwDJ4iWhtTnG+NlRhabW9VWGojLsvUwjFjxu/LmyLyU3/BR1jPY+g== X-Received: by 2002:adf:e586:0:b0:34d:963a:12cc with SMTP id ffacd0b85a97d-354d8dbc8bfmr3661763f8f.53.1716468581288; Thu, 23 May 2024 05:49:41 -0700 (PDT) Received: from [127.0.1.1] ([93.5.22.158]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-354faf3fa68sm1259611f8f.116.2024.05.23.05.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 05:49:40 -0700 (PDT) From: Alexandre Mergnat Date: Thu, 23 May 2024 14:49:24 +0200 Subject: [PATCH v4 11/15] drm/mediatek: dsi: Improves the DSI lane setup robustness MIME-Version: 1.0 Message-Id: <20231023-display-support-v4-11-ed82eb168fb1@baylibre.com> References: <20231023-display-support-v4-0-ed82eb168fb1@baylibre.com> In-Reply-To: <20231023-display-support-v4-0-ed82eb168fb1@baylibre.com> To: Chun-Kuang Hu , Philipp Zabel , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Jitao Shi , CK Hu , 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, 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=/0McRX6GoM2+nGIkWn2jaKs7S924L4q446vEYfmzgP4=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBmTztTlpUBxrslkpM9KkVJFXYtjbSrCv5t3TWgUxI5 XUvLM5WJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCZk87UwAKCRArRkmdfjHURWb4D/ 9wTBNeGwtAKm9fDQEgY3KlVoq3aw7N/I6ggPNiqm7lu48cT3alLmUEiAEH9cxr+ooYaOeF6xddtH9N Avqu+Na9+0o38iHIVyjOU/IB4Nrily2yDRjDJA1hvhAiygXW4A1rr7erHlTrJKuA6b2//3of5lwcpU C2WinPN+uvFvTf8s76ZBBRDLcMwz1YlFJDVcMZtHf9E+dCO1TDJ/LJ2LpyUQzYxDFC7dL9ClMU7bDh aRUcvXBSGYj02LWSk2KUBxbt8uL0pLsU5egoPTh0lwNl9Q/okAbJ31MY9AXCM02DXK/fha8WOx3xTw JhcIVPZo1pHFDMBCXeO00MmXu5eMyLfszMWYIpgAVBUZN7zkaJTlpoGza91wmPCNW7lZPpZLunm67n EjdgwfwctDV8gmmcaZagkU1NzGw/gQPe1/Nq6L/Xvp0LLsWKkYd7IlR/WS8XGhf3akmBJ+njq09a50 DygPcXf13zXLX9yQoQPT499tok9k750eiHUe7iwpZRUlxp//nSGY7rK7GyWBCNjVD488SyNYYHpOxd 3ZvRpJi4DnKnKauaFbFvyIFAJZDd7xzJn7haovlEAzvWt1bhVWvKVhImKpOcepGVrhBx73DT2+2SkV LVMKKq0yd/o08BjawyKMV9I+MVYefWOReRhG1sp/k3yb1r9aGKSO7tNJcPQQ== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240523_054943_318846_1D5D4DCF X-CRM114-Status: GOOD ( 13.46 ) 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 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 e036d9394c23..cb546a9e9419 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -643,6 +643,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);