From patchwork Mon Dec 28 12:40:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352711 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9826054jai; Mon, 28 Dec 2020 07:22:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxC5AdTslZeQvtVhYfURJYQHNqfd2WYcva6v5zht7gsnLB63gSnErwjfHejz4f+tg/ssCon X-Received: by 2002:a17:906:a192:: with SMTP id s18mr40240021ejy.249.1609168944785; Mon, 28 Dec 2020 07:22:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168944; cv=none; d=google.com; s=arc-20160816; b=J5brVU4idCiAPBaMVwcsWsAP+ZvQC3wVUXUPAFFjULtr5GEwUXi00qb2bmdaatQ/+U 4vICoEupQUuc5X42YhV5w7eytkCJKRgY+1CpqmqslwullAGRkhhQJpNttKYcK3eB6GuA A3F/22Mkij4ZGmF2x0GodyXyIlxKKGeJONR1unBQcHoqeJIneUpFinyrRABZUevgVpT1 s7za5M1Wa9g82L66E6Bxm+mP6Bcj5ps0xe24s94nnSZ5avlPbbmzwq8frjDGEWZkEsra dEwV0addrDqCBiIeOiVtvV3ssHLeracK2LsdxrXmv57vRb8t2JUD5hiG1STZtTeL/sWp P8fA== 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=omCY95xjblbvAMNp3ci9fNwSNXtkw4oa/oIYDQTaW88=; b=RZJREYEkBWY43DL23vPGBaeZxcy3iNJP/mFB28FFyPOQVeKbA7dG8DUQa1/MIzHiAP 7GRNcljGiMw/SW72dEvF+U6bgg6ekNPiX12O3IRefHilVP4gCtxD6qPUFClkWyrrtkMc fxxaugevnzE7TlOiwaLmVPLQeSV/80HROPnWyPy1VcBz6rS5Htu2ZhptFGmBdU11crwz PBnh8aLEp/jQW733WpfzT+sep6J6gIUyE3ojF+/11v3AOYRo/Ss/2pCdriPvDs0SWYLc seUISeWvE9OtdIt5rRU/CNcoomLT5ujY3M6oQ/1M0aqcCLbqK+hJtk1gFc2O9AntiPgK VxTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eQp5QmO+; 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.24; Mon, 28 Dec 2020 07:22:24 -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=eQp5QmO+; 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 S2408428AbgL1PTj (ORCPT + 14 others); Mon, 28 Dec 2020 10:19:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:35988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436969AbgL1OCp (ORCPT ); Mon, 28 Dec 2020 09:02:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 05F5E208B3; Mon, 28 Dec 2020 14:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164149; bh=NMq65m3O4RH8XPEsZ7VXQymMd2yHgMB6CzqTJ+0nq0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQp5QmO+1XPDVQAVcJACYSFXok4TugeVlbE2DZ9OuOIosyuui8OgDziL03jO8vafT tBWmcGf2oapkuOel9+Oyx60UYbFoVJkiCrBBvN0scn3egJJIcuoCQPo/Uj1cAgvFdH ak61r9nBOZG4xUeuoVFl2X31J+qrqAEV1BhosfzI= 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 048/717] drm/msm/dsi_pll_10nm: restore VCO rate during restore_state Date: Mon, 28 Dec 2020 13:40:46 +0100 Message-Id: <20201228125023.292549141@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 a4ccc37693a271330a46208afbeaed939d54fdbb ] 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: c6659785dfb3 ("drm/msm/dsi/pll: call vco set rate explicitly") Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.27.0 diff --git a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c index 6ac04fc303f56..e4e9bf04b7368 100644 --- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c +++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c @@ -559,6 +559,7 @@ static int dsi_pll_10nm_restore_state(struct msm_dsi_pll *pll) struct pll_10nm_cached_state *cached = &pll_10nm->cached_state; void __iomem *phy_base = pll_10nm->phy_cmn_mmio; u32 val; + int ret; val = pll_read(pll_10nm->mmio + REG_DSI_10nm_PHY_PLL_PLL_OUTDIV_RATE); val &= ~0x3; @@ -573,6 +574,13 @@ static int dsi_pll_10nm_restore_state(struct msm_dsi_pll *pll) val |= cached->pll_mux; pll_write(phy_base + REG_DSI_10nm_PHY_CMN_CLK_CFG1, val); + ret = dsi_pll_10nm_vco_set_rate(&pll->clk_hw, pll_10nm->vco_current_rate, pll_10nm->vco_ref_clk_rate); + if (ret) { + DRM_DEV_ERROR(&pll_10nm->pdev->dev, + "restore vco rate failed. ret=%d\n", ret); + return ret; + } + DBG("DSI PLL%d", pll_10nm->id); return 0;