Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9244410pxu; Mon, 28 Dec 2020 10:16:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJztmJu2le6t+tt+yY1EXyvx1k8z+11oW7/y1lDSdAonp0Sqe6xlFCwhntsC5OHy5v2ZQxXr X-Received: by 2002:a05:6402:513:: with SMTP id m19mr43330430edv.244.1609179396852; Mon, 28 Dec 2020 10:16:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609179396; cv=none; d=google.com; s=arc-20160816; b=E7NGNOEVle7/I4T0qYepXbqzow7QMoltg1JS4rGHg8Iqu2tT3RT5WqLF4cetxsaIDo bGDp8bQOA1YJom9mVACxw/STZD7aFA9In+HG6mwnLZN7cmJ15kPkpqu9vrB7rmHaWLNE e5U1Ol5nJmKC+4qAGw3bEIQA4T64s9AqKlmHPfCuxL0lXM/ABVjsNgb4JSKrvKq0GNmY pGYbNAFXTt/0dR6cemcu3NsACLA+NGHFD+WM/Ix8jKeMM/6nXVrauiGHrmrHKUNVQdVd 0T9g0+cX7v11cHlIrvOTiQ7vqwG9K2S+tkQnk3IKXaTBdpZiVGXSX4m900TYVWwLcsQB ti8A== 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=p1nexNT/aBwYmUfYD4ctCNll2o4QNEe4ALUcJ+YZ8pQ=; b=1FRVCz3wIrubuvBFBN5zJsEccn0Jkqu08ro27deBVPcnddF50fM0thZ7WWxTQ+VUwq IiZsSvU/FS6i7CLU0aHCUypmQdpkw9bgCxgpI8hEWH9r5avucREjozMi1D+WuI1EBm8q tnXVl9yR/YabuN60gyVXjUfYxBJaTklrvp8WuezQzKD3MeL3R49Dea6uvO/PPeyiv/Pc AaP14T7Pbvg9QUGsCkEr1C7zNVuLnoilqMq9hlI4syuBBfsK3Vf8yRGUAJYrrmVN3Ieu IFHIrzxY11mFb3sss6eEeGUlhBs2WrKkVsV5khYDIlK1FDvNUcxpgX46vJde5J8kJJX3 rsAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sqvH4KDS; 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 hq14si19214891ejc.99.2020.12.28.10.16.14; Mon, 28 Dec 2020 10:16:36 -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=sqvH4KDS; 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 S2389775AbgL1N1z (ORCPT + 99 others); Mon, 28 Dec 2020 08:27:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:56314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389200AbgL1N1d (ORCPT ); Mon, 28 Dec 2020 08:27:33 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8DB54207CF; Mon, 28 Dec 2020 13:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162012; bh=InYEAi5x9ssMkOFcR2sFRHZZKhTE2Ms5ZxN+puv4VaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sqvH4KDSVpx0Lq13b4bSxNnml/2XsgCnaw1l5D1osOeYforQ6DjrQPsjaewchSgBD uhHZHLmlEuDxkrnYbX6zfqm8qLUl3+WbKbDWSusY5UY2Qp2HnPzDq/0Aqm0Mzq3m5Y uuflAHWGxDELXXsq59NlrQ+I9kzvfVMdJFGPxfbM= 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 4.19 118/346] drm/msm/dsi_pll_10nm: restore VCO rate during restore_state Date: Mon, 28 Dec 2020 13:47:17 +0100 Message-Id: <20201228124925.498438496@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124919.745526410@linuxfoundation.org> References: <20201228124919.745526410@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 21a69b046625a..d15511b521cb7 100644 --- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c +++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c @@ -554,6 +554,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; @@ -568,6 +569,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