From patchwork Mon Dec 28 12:45:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352730 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9844648jai; Mon, 28 Dec 2020 07:50:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxE7mzUfCmMZ/YiAI1WSnIdYRb/Gzg1XqRBhh9m+y5y1YMAfT2SRVsKh9gPnDwO+7KvSyc X-Received: by 2002:a17:906:8594:: with SMTP id v20mr41671133ejx.470.1609170548520; Mon, 28 Dec 2020 07:49:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609170548; cv=none; d=google.com; s=arc-20160816; b=KebqPtViESpjVqQ0ZiYuqNtymlE1IqkCoCjy8eB9cvLMG2e1r7pDRrjWF4810dygTv ouLZMe0ral5A+CS06I8G7P1XK5SBKenQghFyVnaK2uI6OG/jEKGHqAt/ENls1kTEILxT LtXpZjZpCXbLJWNkOT/GfYCdhojzWKPoLL9F3fXW+yOZNsZWhg8KOk0CtiFE/3wdgwTL LhERDhVmHVIx9VDKkuXIr/rtkjh6MjDBAUNMjRLkU3WkiaTgg1aAhzXOxwlovvPMWLmv eaixxzMJb+GUzRHv/nuFod4IkAU1pQ0HCq1ReigfbcVFJEbnN4RVcQ7ilxak8CExesX2 8bGQ== 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=8yVc5/myLbj1sCRYMRRQ1LhlQ3HN8qIlprIuxIWvefI=; b=xSxFbWGUUt9GwkF8I4EEYTaGQIQ9+EMOHhTw73xunrwJE2QjyHdCeBR79GrshE9cKo lJqPJjsZfzG9Hb3KWGmyrAdHgJ1zUqFszkXhe2JhnISPia6fgI7Dh4mJujnOHV9sSh/k /wwZvC+7qQED4Ckg9GaEtKqn0N8Y68e4sc/QwhbAs8MWk1MnOQf/xCvBKUp7p8ynxWm3 2deNkQK+HfnoNEK8HpP9kABhrcv+ynsNe9syfg4zeC69vDTyD+D/+YxrNLQaI0EtXR3F FD0lw5h/Y3Wrf/Bkjq0k/mewtDYMvgE/YLdo8kXiUSO3qV59/qzmwZXdsJseiqeQtB+8 CxNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GLKFNJ1i; 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 y17si21458948edm.386.2020.12.28.07.49.08; Mon, 28 Dec 2020 07:49:08 -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=GLKFNJ1i; 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 S2408259AbgL1Pss (ORCPT + 14 others); Mon, 28 Dec 2020 10:48:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:42456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404110AbgL1Nm0 (ORCPT ); Mon, 28 Dec 2020 08:42:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A0D232072C; Mon, 28 Dec 2020 13:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162931; bh=Be0IGeLwspxQDrgJ54iD7P/S9slPdJBLxD6QQMcabg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GLKFNJ1iLM1/dDhjXeZPy0W4dsIar5+wrX2y3e7HlPWh2DxzDkEXx18p8zwXNcqp+ qNUnriKCdW5WG2uBjVkhJhN0a138PyuWK68RoNAtVm3dxA/7+Y+gY1m/wiyzlN/joV 4QKKDPpL9YsfDVEdqLGV8WCqHllwC0+O9eQJpCMY= 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.4 103/453] drm/msm/dsi_pll_10nm: restore VCO rate during restore_state Date: Mon, 28 Dec 2020 13:45:39 +0100 Message-Id: <20201228124942.175453910@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@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 aa9385d5bfff9..33033b94935ed 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;