Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp305785lqb; Tue, 16 Apr 2024 17:09:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWcvYuL0awlp3QwnnB6aHEipbX0NkOX9hXkslikigKhvTY627/A6D7LMQ+aBXWkPS4QBwCAC5JU86sj4akjOjq2ve+s8ExAgRCDMQRzA== X-Google-Smtp-Source: AGHT+IET3wH7+AxIYznMs7tq+IratD/x3tmHfKzk4rDx1IG+JhBYtpy2q4Sm1kt2yI6WmbpNOj08 X-Received: by 2002:a05:6358:8395:b0:186:1ea9:3072 with SMTP id c21-20020a056358839500b001861ea93072mr15929869rwk.15.1713312543680; Tue, 16 Apr 2024 17:09:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713312543; cv=pass; d=google.com; s=arc-20160816; b=lvTlisjXPvx7PGRD/6tZ2ivLnFg3/b8lW86ZOr0hPWnPc+YwWEp3WrsiRSD6qfjUxr tzxf/eNHq00quQJSvAHiN3SX9k0HD6dtPrVt5c6RbP+A0bfJQVg4NZemUXgUPjgB9avN ialtEkEBjW9RmcHbdmjWe4LWQUpfYksg2XdKhOdaPOkPEanDjdBUYyjtFDaGvwtbJuI4 6iX9WYhL4r6MdF794lL6mQE+cUtpTVmsVpX2R7cDK6vJoCi+wKxiBDpUFtlQ8GAJ8BUe G2kw6lSyLIWTmP6Rt3bE5y9DdVDDAPgi60HPHHqcy1sxljeRtu75MegQB15vY7qojHJD z0MA== 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; bh=K7MwrNgiQSgOu2Xg6QnrGyglRW/2R7vw7wGtVLqRnWw=; fh=EaVNV8gKHS73tSa0PfwfCJhAdPfizlMjT2zacFzFq/Y=; b=eDltQkwtCob7i71NSBq0KUgbv7gItuQIMt9D+ir3pDLitfgk1lcYigah0rPG5Yuh9M gXc1TO1JM2if5aXSw22nMTqylaXSo+3qqjC/z/UlV+wqJ0KpzMIeiTLIVa9wcDaEJRSg Bd8DbxKK/PWPdF9+feofpusf5VVsYgI4QwV3/a9SJINVk4/wMRN3IwK0U9DQPhwN1UDJ v4jAfaHcZlXgCLxWZRS57Hv2VQJZisTmuV5tOe4Opd/Eq4azkY8w+eh4YXNeR4N3p7QC 3knZjj8cmKPr3wGqbNjlY/akIfTBO9hPB7R65926K0RHc4Z6tpme4eRfiOaLrE3LdNw3 5COw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-147784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147784-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y17-20020a05622a005100b00434c73e7e41si14016085qtw.6.2024.04.16.17.09.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 17:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-147784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147784-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6600A1C22413 for ; Wed, 17 Apr 2024 00:09:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AAB91FA3; Wed, 17 Apr 2024 00:08:34 +0000 (UTC) Received: from relay06.th.seeweb.it (relay06.th.seeweb.it [5.144.164.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 744D917F7 for ; Wed, 17 Apr 2024 00:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.167 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713312514; cv=none; b=buGHoBIzKvnmAe4Rc5OVd7b1O3WJ+SeOt4HQuT8Ro0A0OZsB0XTqXlaskr2fF4Al5dD6ut4HALtNU1igG1QmJb5MNJQ0TkRjRKRLCHwWsYDL6C8p3Q+/hNoTC/emHjc5kofixR2bUAX0zWsBX6Ee6EoBcbsa9GkLVqnBL+eJ4fQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713312514; c=relaxed/simple; bh=yLdn0fJr0B1Y4lEC7tQYmAV4Y01+r9iOQvrUcRadDc4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RbmBF2u3fUNVOSZDTNTCQGDooQcVuoU6EuRIHcnRx+CRH3ZnA1IDVlhNYmo5vWbJpqgcxc5MZHai9290mNBmCG1YaQwPCDHZzDl7Q/9enXTpMxeQqkGyKgigiZzH/nXqBB3jdnpoxsJeg33/lCETWXGF+n4Kk5cfQGefQ3Pyjrw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.167 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.localdomain (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id E36273F040; Wed, 17 Apr 2024 01:57:49 +0200 (CEST) From: Marijn Suijten Date: Wed, 17 Apr 2024 01:57:46 +0200 Subject: [PATCH 6/7] drm/msm/dsi: Set PHY usescase before registering DSI host 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: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-6-78ae3ee9a697@somainline.org> References: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org> In-Reply-To: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Archit Taneja , Chandan Uddaraju , Vinod Koul , Sravanthi Kollukuduru Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jordan Crouse , Rajesh Yadav , Jeykumar Sankaran , ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten X-Mailer: b4 0.13.0 Ordering issues here cause an uninitalized (default STANDALONE) usecase to be programmed (which appears to be a MUX) in some cases when msm_dsi_host_register() is called, leading to the slave PLL in bonded-DSI mode to source from a clock parent (dsi1vco) that is off. This should seemingly not be a problem as the actual dispcc clocks from DSI1 that are muxed in the clock tree of DSI0 are way further down, this bit still seems to have an effect on them somehow and causes the right side of the panel controlled by DSI1 to not function. In an ideal world this code is refactored to no longer have such error-prone calls "across subsystems", and instead model the "PLL src" register field as a regular mux so that changing the clock parents programmatically or in DTS via `assigned-clock-parents` has the desired effect. But for the avid reader, the clocks that we *are* muxing into DSI0's tree are way further down, so if this bit turns out to be a simple mux between dsiXvco and out_div, that shouldn't have any effect as this whole tree is off anyway. Signed-off-by: Marijn Suijten --- drivers/gpu/drm/msm/dsi/dsi_manager.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index af2a287cb3bd..17f43b3c0494 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -85,6 +85,17 @@ static int dsi_mgr_setup_components(int id) msm_dsi : other_dsi; struct msm_dsi *slave_link_dsi = IS_MASTER_DSI_LINK(id) ? other_dsi : msm_dsi; + + /* PLL0 is to drive both 2 DSI link clocks in bonded DSI mode. + * + * Set the usecase before calling msm_dsi_host_register() to prevent it from + * enabling and configuring the usecase (which is just a mux bit) first. + */ + msm_dsi_phy_set_usecase(clk_master_dsi->phy, + MSM_DSI_PHY_MASTER); + msm_dsi_phy_set_usecase(clk_slave_dsi->phy, + MSM_DSI_PHY_SLAVE); + /* Register slave host first, so that slave DSI device * has a chance to probe, and do not block the master * DSI device's probe. @@ -100,10 +111,6 @@ static int dsi_mgr_setup_components(int id) return ret; /* PLL0 is to drive both 2 DSI link clocks in bonded DSI mode. */ - msm_dsi_phy_set_usecase(clk_master_dsi->phy, - MSM_DSI_PHY_MASTER); - msm_dsi_phy_set_usecase(clk_slave_dsi->phy, - MSM_DSI_PHY_SLAVE); msm_dsi_host_set_phy_mode(msm_dsi->host, msm_dsi->phy); msm_dsi_host_set_phy_mode(other_dsi->host, other_dsi->phy); } -- 2.44.0