Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp463480lqb; Wed, 17 Apr 2024 01:19:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXO/yfvGvJTIvto1LNYbslvLPnd3y9d4USFKWYDCREcEDi4bFR5/E2SQyAVWZQ7ml70GiBJxEBwdA/JvX+2Erzj2e11AJ6IcBmyUhS5Wg== X-Google-Smtp-Source: AGHT+IFOrNb3SgkNhXcYUqYHQUcKX2tKt4piDceUaGyJlU6VgNVbmQ6gKZDMrnnga7f/+GfYHUEt X-Received: by 2002:ac8:57cf:0:b0:432:c448:cf94 with SMTP id w15-20020ac857cf000000b00432c448cf94mr17405944qta.54.1713341970815; Wed, 17 Apr 2024 01:19:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713341970; cv=pass; d=google.com; s=arc-20160816; b=V21g9x2YgflfCOHsdcPOk7Zjo45HsH/UrBiLj/nGO9ps3LFdY/TQ91aYM8L2ODnSGE qXzSAj+F+UB7YXet76Z3L6rxjm7+AoVhepVczcrkqeEUpjKcrVT8MQH8G5ioneHQ6Ik2 Fzp3JzaXmjmeCi6NWLNfDD73rGlf1E2xI/DDSnibDkcdR6MvOVW3Rvu7mh1woCJJmonb UZDQLowRERLZhaSEr13qTuhHBFpdmKR0Vj86wl3JWZPs7YAyck6RTBi/2nxQytb5sdoA 2Z6lolctoCYtJo5yGlK0PU485NO4GF03EnWwZEYNMfTi/pYPkDH9wJ1W9qJx9qp1UQzP YuGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=3LRcCO7G0BAlsPsSHwaDpD7NJg45TvAyn9+yoAIm8Y8=; fh=mD/fivsaDhJQQpFoybq54I/J1EhSoX+nPzH+9L1kARM=; b=L6W5txYACAEKDInNI6PS2mncpzFkZ9la96Me9UCkX825ElqvVSaPCg6LbyAphQDdv3 xebBSo5074fjJhgYC1vGdFg5O68Guw+FOm5NcdiKJAlD7qa+zT4pdTRMfbd6r8zIi0vx qUWTFy63Iwj9eVSqlbt+PGvT424BoRn0DwpzAsh2iMorac85Vvx6Mozx31RueHSlZLNw UUkv6RPmktHrDG0yVMxBJRQuPbgoIQSnkSIAiT8Jm5zP0iAuxv3Wf2FmbYkXxjZrwmhO +EJPZwttm+MoZzQB+iEnXxbjRoLzgLJjI97JSmMivO8ikxaDYUpbC8F3XKl2mgtI6ZsT s2Og==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y1RmVZYp; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-148123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t19-20020ac85893000000b00436520e4acfsi15180817qta.728.2024.04.17.01.19.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 01:19:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148123-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; dkim=pass header.i=@linaro.org header.s=google header.b=y1RmVZYp; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-148123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 7B8651C21E6C for ; Wed, 17 Apr 2024 08:19:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 535B880BF4; Wed, 17 Apr 2024 08:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="y1RmVZYp" Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) (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 A7EC37D3F0 for ; Wed, 17 Apr 2024 08:19:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713341952; cv=none; b=LjfBir4vRV4k9sxwq/yav/lgjLVnDLuV5+61Cq3E0OG0eXSJ6AuNH5V57ho8Y6f04M/THlfqeWFd9MqF9np2HZZDn8w6EM8h+zqZKIMYe2uqPQIoCN6TzK3LepFLCfA2d9sJdJ7nvxv3qx1qqhWHsz04+Ufgde1TCx9SP3gOUbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713341952; c=relaxed/simple; bh=lDaoE5I35Sw8X4gTfjGCdgl4sZqMgly1ov1PL+Jq3Vg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=iTgWUyP/1Ca9u6NJQoGSqNiHLyy2nEGIMkO89UXw15j8OrgcQatIkiNqMpxwDuiXB9/+EdQ0y6SFtk5ttNi8DOj1yjNFAmYMDbuGvCZnPLvGfPCqA6eivid3+r+yT2bImTazyErYA+mThyjYh0dYlsUaumIhS3imC5clFi5vcQ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=y1RmVZYp; arc=none smtp.client-ip=209.85.128.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-6150670d372so48026507b3.1 for ; Wed, 17 Apr 2024 01:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713341950; x=1713946750; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3LRcCO7G0BAlsPsSHwaDpD7NJg45TvAyn9+yoAIm8Y8=; b=y1RmVZYpbukWu0GnYfSD9kz0+CsF1ty3mbs6pqJJpqMqFuQVySjdt9bHm4323SwDm/ uR9NNaLFWYxNuVP+jtgeXt0RR0TIsZIWXPHiTRFilNIcNLtepzFjp1aogA0ifXjwRRtP 6j7PCEnJ7r8tFzRB1h9jbAHCXieJhzfSEvucOOceRGnP9MXcPnP2X6Wbdt710VD4uO7q 7i3lWEUoSNh197YHlzBAfqR8op1ndiUn9a1eiiJzWBX3jebkkWZo35Z0DpzJEywNXueJ RDTK0JzWAPZD8SBMW5lU+qsx+Ar3cpvCvL+wF2G/W+asVraJhcH/hdiNJKPqN4jDDlGt Q0Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713341950; x=1713946750; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3LRcCO7G0BAlsPsSHwaDpD7NJg45TvAyn9+yoAIm8Y8=; b=fivNIvsT/Wnr08O0msMzAHPMWNhzew6wDYjqwOien4WP3aCtdSfTr/ok9gp1o+TnSd 3RThxK5tygewBgRuAtBhSo372x1zSTOJfjlULLlbQSVx3ysFOp1zEYBGs7AtyTfHS4CD S+Hr70bXZwYEVwPA2tDIxCPB6MQKeJNnUwP1fDXAjuTc7hF5l669h4BqIGaaApeuTJIv KC79tVX/iGIWL35es5FrtQUkqIYRoIZKPu5Q/TQrSQ18Ay3ydbQtP4RsMYC9JTF6cgEm BJYcg4BDJc5AT+mDGWIHZMmfxzeu7EVFmmhWXzsJ7f1V4sQR841uPuVaB7GoIDb+LBn5 HdNA== X-Forwarded-Encrypted: i=1; AJvYcCXhlJUyFXxF7xHk+GewfIQORDTEHubwoAK6A2TcrS8hZ741S7+IfZZeD+7P6Hg7QBhVH73QxWvw8KZpdIlYqx+tZBbSKdzgFG7gfKVg X-Gm-Message-State: AOJu0YyVjStego/1/elWiZwoiTno6agEqvtApzEAWRFgGVMWwthatuHT hB7pJS7SEMbr8aS9spZYHkuSte+oXDk73XiC3zAhEbb0Fk6hxBKSXaZJZPuVt6Z2Agd6sruNV4C 1AO9wSxtcHsauh7xW6KEub9Xj1U91RtW5mx6xcg== X-Received: by 2002:a81:430f:0:b0:615:1e99:bd6e with SMTP id q15-20020a81430f000000b006151e99bd6emr14355086ywa.35.1713341949713; Wed, 17 Apr 2024 01:19:09 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org> <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-6-78ae3ee9a697@somainline.org> In-Reply-To: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-6-78ae3ee9a697@somainline.org> From: Dmitry Baryshkov Date: Wed, 17 Apr 2024 11:18:58 +0300 Message-ID: Subject: Re: [PATCH 6/7] drm/msm/dsi: Set PHY usescase before registering DSI host To: Marijn Suijten Cc: Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Archit Taneja , Chandan Uddaraju , Vinod Koul , Sravanthi Kollukuduru , 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 Content-Type: text/plain; charset="UTF-8" On Wed, 17 Apr 2024 at 02:57, Marijn Suijten wrote: > > 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); Please move msm_dsi_host_set_phy_mode() calls too. Also please update the non-bonded case. > } > > -- > 2.44.0 > -- With best wishes Dmitry