Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9131421pxu; Mon, 28 Dec 2020 07:23:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJx46i17UdLhRHXLM/0YOFTZ4Kg4UeL9IYtAdW2Y1D5LY8wD3nBc8ffdR4bf3cl3yQlfq22r X-Received: by 2002:a50:8163:: with SMTP id 90mr41899335edc.142.1609169015020; Mon, 28 Dec 2020 07:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609169015; cv=none; d=google.com; s=arc-20160816; b=Cvy/vNKK5JUyYGrpeJDEXo7cy6qaP5hxEagc5/taL4m8wlYvC0NMxWCllZMGM1ZNkZ //hn37cPVYkctLNMAx3o2WPFIEzQku9pa6XmYU4piYKK+lBcswN5GjSB6bnPP4Ez2fPy SR8US/9bg3LVmz1MllncLhMSmXWkMdDSpXwbiiOAXCN6iFw/C8aG70KjibkPsXz1pjBi 0A006WPTljf/oUuJVR+g85uBxaV1SlfR2GuBBcn53gdmiKIy3R3z3rq6TWmGPuot2ejA 7KNr3WnAHy3pNeHkW6g1TMRWDgLlLwEqn3OnKSsGfksb6qWauerllnFQxrjsll/10cwS iqog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p/h5T12RRS6FRUaUSYlMsRZyZININV0QUbNeA/b+QV8=; b=XCK2aWyDW+H76jTzMgVsMEV2FKNuN48lkB7MzoEJxLdG/mjAD0nsS7AmXsvB0cDGKH njBRC59vqDDtaLKbnlT6CMTjTpzXNMfPhiHbICWSvswpY8H97Orm7mS06linaRdO3gh5 Ly7QtaPYTamJfgqfgsSN3V2zeUE95zYJCiBHIO2gCzMIVQVqNMqR+NHqTlURjrmEytW3 A3N+vw/jzXdrxn2pJHDStDJQaLc9SKqSgjUFey+SSdv2AtrmDMTJxOOjlaibXUXncAh/ IEuO54ZZiQR95nqY4OGlxOHJJWKZlFMAZebqtVMZfIl8v0faJCCqDaV8lwzZEPA+AYPu noDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=khsvsYjz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si20021144eju.355.2020.12.28.07.23.10; Mon, 28 Dec 2020 07:23:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=khsvsYjz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436969AbgL1PUB (ORCPT + 99 others); Mon, 28 Dec 2020 10:20:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:36256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436944AbgL1OCm (ORCPT ); Mon, 28 Dec 2020 09:02:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3959820715; Mon, 28 Dec 2020 14:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164146; bh=MMljhlXmuvVpOkY7sqG+Lw2bKcNNkqEwxJk6co4Yb/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=khsvsYjzWoQWzhFgyOY2++GuMIpDQfIm1ZzjMWdLVmfxm1OG/AN/mv6XXav05ywV0 odPddoyhYWDaXIrVkPJw8d5ENEUVNnRN65NBIpLZgdz1CQmMt7HYFc8pDiRgsluob/ 0D4nrdSq42KOMvggdRavrApGaYvk0GhE6pWfiHVA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Baryshkov , Rob Clark , Sasha Levin Subject: [PATCH 5.10 047/717] drm/msm/dsi_pll_7nm: restore VCO rate during restore_state Date: Mon, 28 Dec 2020 13:40:45 +0100 Message-Id: <20201228125023.243702226@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Baryshkov [ Upstream commit 5047ab95bb7db0e7b2ecfd5e9bcafc7fd822c652 ] PHY disable/enable resets PLL registers to default values. Thus in addition to restoring several registers we also need to restore VCO rate settings. Signed-off-by: Dmitry Baryshkov Fixes: 1ef7c99d145c ("drm/msm/dsi: add support for 7nm DSI PHY/PLL") Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c index de0dfb8151258..93bf142e4a4e6 100644 --- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c +++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c @@ -585,6 +585,7 @@ static int dsi_pll_7nm_restore_state(struct msm_dsi_pll *pll) struct pll_7nm_cached_state *cached = &pll_7nm->cached_state; void __iomem *phy_base = pll_7nm->phy_cmn_mmio; u32 val; + int ret; val = pll_read(pll_7nm->mmio + REG_DSI_7nm_PHY_PLL_PLL_OUTDIV_RATE); val &= ~0x3; @@ -599,6 +600,13 @@ static int dsi_pll_7nm_restore_state(struct msm_dsi_pll *pll) val |= cached->pll_mux; pll_write(phy_base + REG_DSI_7nm_PHY_CMN_CLK_CFG1, val); + ret = dsi_pll_7nm_vco_set_rate(&pll->clk_hw, pll_7nm->vco_current_rate, pll_7nm->vco_ref_clk_rate); + if (ret) { + DRM_DEV_ERROR(&pll_7nm->pdev->dev, + "restore vco rate failed. ret=%d\n", ret); + return ret; + } + DBG("DSI PLL%d", pll_7nm->id); return 0; -- 2.27.0