Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9131370pxu; Mon, 28 Dec 2020 07:23:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXCWm0Hu879JHtpUmv/CkX+imc9KWRCoS0bpgh8PNi8eccHZvISIYirmlZsnDGaoD8rHLx X-Received: by 2002:a17:906:c045:: with SMTP id bm5mr35782729ejb.190.1609169010729; Mon, 28 Dec 2020 07:23:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609169010; cv=none; d=google.com; s=arc-20160816; b=Kc6+4Tu2IecvopGwK0yveOFrq83cd4nqOmMBL+bDcy5AG9eoqZaS9PQ8BNt6NzWMsL OpmQwkeMZAIJ2SXSabbpx2WKdwUBBi4UDlZNVmhfX6cGfJm79Ei5vr8x/CwyXhtjyK3P tX2MPm93/dSSAcvttBpEgB5lrfuQ+kWZNXXcXixb0syjBLZ3B/iWnM7RG33h84VdGTby FdxlHEyXYB62yahTA5k8odNqINddnisxbuwtDwMIVW3fJd47bP17rSzAWzqgQFK52gpP vOCyeJ0nxGAwiye6dP4z3F6XwwVcMBUKGB9YdF34w10zVaxO6Fvj19Ww/eja5S9c3X2O lo6Q== 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=wltGakcWPS5JyPiUE56qonbJXcSnqWylsIuyB05Edokp3crw3LfrU5f5E9g0SAmO49 z9OBOMQXcjxyOoCORCvk+9ujLr8bmsq40Cx2aau6vnqKfv20D0pM4ckGt4Y8ZqGxGRQn 3sr/VnRqjIk9xsY2D/h6SvuX3cfW4Q57rKINJPQ1GRds0x4IO6QP4RmDCbesM2nnhBRu RKDElXiiYPT31QEAC3r3cGj1X4KNP6h0G86Qu+vN/s5tnvI14szBTO2GPx4m26QCVXNv 4qBJVYobPrPhsKLVTXRYE49wUBJeY9m4duqd4YBs6yZr80GC9wW+bewGTyGs6Aa/VzI+ 7vBg== 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 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 d16si13944929ejz.96.2020.12.28.07.23.07; Mon, 28 Dec 2020 07:23:30 -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=eQp5QmO+; 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 S2408452AbgL1PTl (ORCPT + 99 others); Mon, 28 Dec 2020 10:19:41 -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 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 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(+) 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; -- 2.27.0