From patchwork Mon Dec 28 12:40:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352712 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9826069jai; Mon, 28 Dec 2020 07:22:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD07m/bmhp6L52SHYA/rpZHZurkIqxWiBSwvHrmqZ1ygmkhZvsysZV2UHf+s9gUEPSu3I8 X-Received: by 2002:a17:906:4d52:: with SMTP id b18mr40234624ejv.405.1609168945642; Mon, 28 Dec 2020 07:22:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168945; cv=none; d=google.com; s=arc-20160816; b=k1WP/Lyar/ObjbnKX3cMVkrazjGf1nZiTzAdmAU0N15TZak93OBZbe5n9w4FUngujo CxZb6+8zCl++bqSwqANpCrJ5PZtSqVr9Z6g/ccDflPLVZo9WHsI2IZ/hXMMs17cKCDok X15cH0a7vS6SHieknBS9UNFjF0M5wxVWQMx8n8yOLHFeyFtMs5phiNH4kFOBBfLLuWgd 25pf0CLftk7Nka9A/S+6Xw/F5j9HtAFdJSeaBafxzX6fwpXNYyHrGyVCYnQgZ+wVD3Hn gnhIkrETL730dh2JWB+lZfRQMy6x3LIXg0aWCN6ZhJ9lnP4ez5Y/Dw7Te5tXd3hbiebr YDyw== 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=MYtXDgY+mHYacyhe+Op625Ags8jtt0JodLiqEuCvi6qbSR3h2exMksWXhhUc4EbKqR 12q86vP5Xp6hwKEDW450V4DkDosPqcSL4QdiTuDv1mRO7KqmR9JTVb1b50rcOG2NqXDX na031Us9P2E9zwQi+6H5DxKDZgJpSPWnOiW9sGMZJ/5HVxnB+SyPQfzFrjgnESTbIjkE pmuQlxDwDXfQVX+hud43hk6deYSj+QPXVviUC0IFhXlYpol5Tpyp7HYxzn9V1MqHVzbv FCr2nLATuCEYjh8DFE/gaAwjXkXxYRURVU4kfUG0nKRH2ffwlOC+OPLTihIKcqaX98Vc YpTA== 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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 gy15si18300609ejb.752.2020.12.28.07.22.25; Mon, 28 Dec 2020 07:22:25 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2436962AbgL1PUA (ORCPT + 14 others); Mon, 28 Dec 2020 10:20:00 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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(+) -- 2.27.0 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;