Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp973448lqp; Thu, 23 May 2024 05:53:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqpdxS+1akqwB8i/Siwcsl98ImNI94yBppdVMrlHXKwLvJYpZ3Ujvn8QJr8+lhBV6qZ3yeCK0Riqe3e56wS1KPM9KmNxuXn/pbiqpW5g== X-Google-Smtp-Source: AGHT+IFe9WjX3fPcbgC9IAf4MH/9zoh0S7O7+RxL3tGQkG8Zq4v6eZE62o1kkKnMQPXK8g8g10xe X-Received: by 2002:a05:6a21:99a7:b0:1ad:878:5006 with SMTP id adf61e73a8af0-1b1f879c813mr5764218637.14.1716468807270; Thu, 23 May 2024 05:53:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716468807; cv=pass; d=google.com; s=arc-20160816; b=dYjyyrujq1aid6WRsyNeb/UfDxAsRWgktpR95clP1PZ4ooTWbqIgvPrsa6b1CTqgNy zzocQBluWxnyBuUPxllN3yZXMlLt7uA5CrRqbgISpFbYhFnh5BE27ZyR5umZFHyEN2mb 3bUqCF1ZGTyWHt4SVpahICV1L86vahDfZ9Sh400hVLDD/A8DDP1weevp0M5u6jaZFYCk N3R1RS8ZviDa6Oc9/4eewWSJaFsM0+druHXC9nwHXA4P4gJ7Xr3UsG3C2HgTjSiagapu AdcL1whXmlnMoSCfvr2zrfPFQYpT6tVKPcq3ne86ivs49uxDeFxl44/C2I5YJhsvRwDs juvg== 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=28zbSoB8+Zxd+IxXtMzgHHKE2gbwNBphtmm6Xt7tCzg=; fh=egPjQvoS9++MFia7qYqBiet3fxrNlY93XzN9q0cLucU=; b=xtS42cR05WLbBAc2z1c/gJFc9hPibRxQL2hIuZIDfTdeFKMzBmE9LwBJUgmIGGfUhq q4rKGYgTz+EuJjBsoMzQ9AhCSPKdk5OVsE4yhj5SyUN8Jfygy5gO5VDW8n8SGlU90HnN 3p7yvzfRhA3jCPfrf8dkfgcTDSQ9XBjG2FjeHm6BB70Zk6M22MB8nAJRGAzAHZ4Xw6Y1 tKg/3IpmDTsj4fOCabNu7E99t8eaBkIKLtBBrcNvMzpQf4tecNWBwef5xEVW2suBLGij FK3p6ZXvHb7WTS7c9rS/xOqIJu0VGtv2HNIfY9PGFFI0YjbxHKCQmIABe05EfbijFDdi I1vg==; 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=YEppVM4v; 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-187511-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187511-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-659bd0bb59bsi8763119a12.477.2024.05.23.05.53.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 05:53:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187511-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=YEppVM4v; 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-187511-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187511-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EF1B4284BD8 for ; Thu, 23 May 2024 12:52:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4724B14F9FF; Thu, 23 May 2024 12:49:45 +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="YEppVM4v" Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 A9C1414F136 for ; Thu, 23 May 2024 12:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716468584; cv=none; b=A/9VI7eZq05MMWp+URXEq3EaZ8ElAw/wqDVgjMOPVV3jtSYkuJ1N5Q6yqLQrwo2rgFdGLIdKv3HPuY0GyfuTrDgXNmDoUd9pLwSjeyM+n7KhN4W4FBkunBMHriVpuw8L+JNe6ZbleoVnQXYkutUbS2lvGIEm+oEK8GTemWtFRMU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716468584; c=relaxed/simple; bh=/0McRX6GoM2+nGIkWn2jaKs7S924L4q446vEYfmzgP4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=snPXm4b3p6Tzf6Hhh8uZfI0LE2/P+GGL9pBIe1ypZTCu2tR+osfBiYIiyR89p7lQAV4cL66F8u/LwezGmdFqTfVZnS4+bCXV7RHgGASWsKPa5MgoDPRLTAcHTgdyKllUJohqTeWfjfIMYEEh7I/2nBxz5GKNOyQTwOwngVzF2WE= 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=YEppVM4v; arc=none smtp.client-ip=209.85.221.45 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-wr1-f45.google.com with SMTP id ffacd0b85a97d-354dfe54738so1384338f8f.3 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=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=28zbSoB8+Zxd+IxXtMzgHHKE2gbwNBphtmm6Xt7tCzg=; b=YEppVM4v+NgHGBpi/QcQPRfZhw7NHTJFguLXdr+fm7OSjJEeJqAJPtOJByCUBwRpV2 bchQhC+4w1Cdsgob4F6SF46M9ipDYXxXVLRoB227EmHQd9p7uhpfnIpRm3ABCCQVgYib STUg5wbCQEMsdquS/uaTslrwdLjPg8V8RyxxPe4N/Trc8sSM4TOCP2AOHg/QxspT+QCl raUTPN8KMVd7VfHOSdqIL/CJouvSEJmKMP6TvGdt+T+7avrOkYtvn7HnPNwNltPT0Nkg 9EMIC+KYEzi6OzkwU3FlIDn3XJDIPRe1+/5Ex/kiEQ0V6+gQgTPHi2FcgZ/fFsAf79qF iogQ== 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=CcCINNBlW5be6qslStlwHrfW3u4LJDUa7sQj9tbw7VeAbYyYVDvAFbvuVH9DgOyGre PQx8pa8QwlBspkzl5sgNl8+hGTFzosKxn8/pungEjufjhi2myrfp8KST85azZet8ezr3 fP2SYQJdeEswv32TOKaPpKoswqlALhjm8tKkE3JVOlFG1tloOUGoOTn/zARhu4Tsj9Di HOI7qNABCSW26tovnCzzuqeftt3k+YwOesVmxGXoSs3Ols6y1IMUUeRziUoVO5gsFu5r MojmlpRTlIw7bIfoSuD3T57A9tRs+hxbegnyLa4pSWYj7MyBDc7IY4Mk/DMM5tIAt7ET cr0Q== X-Forwarded-Encrypted: i=1; AJvYcCUFx1wZQ85ujp+qqHSgm/ywnYIi1LaL13TtObdN/6+LB8TEBpVuFzhWN4LeNyVSZFpM6d+QqErqRLFPKdAxwFBGyY1sxOIvRXL6M4CT X-Gm-Message-State: AOJu0Yxv6G/nfcwFM5BJxlXXe2o6uE++1esmxd21/o3BibMeGlERFHcl +rwzf+ik6rcyx+qWkpMZZ9TOcuHnOwEDVKUuMzxneS09BrfPViogDsPpvOGPk5u4Fb0i6TecuKZ /DuE= 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 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-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 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); -- 2.25.1