From patchwork Mon Dec 28 12:47:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 352740 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9857968jai; Mon, 28 Dec 2020 08:09:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0xYyzR+DrQqoFYmGrgRfxSGr9G4CORSQ9uzRUYrnm7UzuxByNTA12iRaQpQvWNrdQmv22 X-Received: by 2002:a17:906:60c3:: with SMTP id f3mr41912259ejk.65.1609171777881; Mon, 28 Dec 2020 08:09:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609171777; cv=none; d=google.com; s=arc-20160816; b=aNMYM37ndN2Gqrja0YZ0uEtDu5xLMzYm8mJrONmPWrCg7mN/cpoOo3jEZVbs+a4bDF TQAWimpsA1oaKCx2uU8fmh6n88IJXSrKNjQ0mgXWaG/kq5b2mU0XfGqkBy62EAtMO9jK z8HvxcYRHcimDBvLhBFgbP3ItpT3OhE73WlAGK9L8mndPE8BBeR805Vqj9LpH8WKx4p1 jfxX0SaSGwyoLGefDSIu3NgKxQToY2Z7D0NA7ND+gPyr2cE9KcYVDxNThhvhqcl9A9Sc aEHSxoCEUJKugDHaZyHqpXt06g7+dBlrvDZBXBg9XCgV7MV9HC+iNXuQROUc2Opoa9mh B9Tg== 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=WtYKfW1QiJxOTqoCRFQVeFTaj1KT/xPxuDqtnFHeQDRzpz9Nxx8i+3p/42m7b0bUVK spnjtZpPYgnxoH/EiPyetAARnOVusPHMkB6VOCC+YEN7b32NqF5B6GhPsje2RmO2D281 O6lHMedDPFugLAADkezPu/ha5xipgbWGnpPw2JfUe8cHHVE7FIH4vSAvwUSXXmJK1zBU RegPd2984Jnn/+EBOslKCB5qacYJfGVVF0ZfSMLv+8iEP85Xm9HAbYErCj+75gOtuO2g FX04Hl1ZMC4Yd8IhzB+/gkKGDR9LbwhU16LieRnlMbxzcG2I0ZyxDVwbXkk7CNysRKaZ 4+bw== 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 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 cb24si19732983edb.552.2020.12.28.08.09.37; Mon, 28 Dec 2020 08:09:37 -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=sqvH4KDS; 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 S2389642AbgL1N1h (ORCPT + 14 others); Mon, 28 Dec 2020 08:27:37 -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 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 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;