Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3535024pxb; Mon, 1 Mar 2021 12:35:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXT8BVCZZsg5UpvlfgOLtDzfump1TWI4CpohKBchyoOrj5Lce0Ke8JU1PbuXybiZguRpMG X-Received: by 2002:a50:b5e4:: with SMTP id a91mr18264283ede.173.1614630922066; Mon, 01 Mar 2021 12:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614630922; cv=none; d=google.com; s=arc-20160816; b=VFrzRWR2o4aSiwtJFlNCt+hO0OvPNrZuj8qB1KwQSCQ4UxJ8Ezo4LgWKsLJwMFMp/W sLETBnwPlcw4fyIDJ91GjcS/xC332Q26+Nq9ZSPJpTBp85CpImsGPh2zSMrjT6nBO2BG KCNm9J+zTGyaN6Dr/zqjGja3yLTJIMV/LsRjC3x8YcLdPqRVDEHG06j4H9+FgZtl70Ze fRcPK7wVBZR9LpOLgdJrlP4Tsi6pUWNpMZWRwC0DsTLngUgM9JgGdGsypU+x8KOrxBeX 0fuRdsDzjM8gFWChHe3cYDjbExeqvmB6IJUM/eioJ604D59a7pkWtR220dZ4DFnRhSRK MgQQ== 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=tHpsmPXTgqHfIwjAHauw//rMp4nMUciYplfj3WJBgy0=; b=S2M1s6e/OL64rLn0rQN9raKN99cAmKqVrpii1l/oXcMwBROJMi6TDkrLoOmqROMwrj EpAa9gVdimw86nvOezjLElgs0Wq/TbmhU6IWz++8+sPK+CT4cM3t11ySq981cglhy4RF KAjeDfKc97G0JCSU3IJiZnIQqqCENU4P38tmKhlW9xjM+wS3Yf5xRlyWTy9bcrGV+ybI w0UwSmYiM2dJA1YgGbo+KUUNSeuYOmQec8oiB2ALgcQTzikr+ujMR4hvWM10bQHt5vOu ESDSF25uZLhyoTTITc/+vCn2ldkFO82cov3eZt1e+MePPln8DdyJceGkYJyVOR6sC1Gm 0yxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q1fYUtLv; 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 f7si1941713edu.503.2021.03.01.12.34.59; Mon, 01 Mar 2021 12:35:22 -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=q1fYUtLv; 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 S238797AbhCAUcO (ORCPT + 99 others); Mon, 1 Mar 2021 15:32:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:35614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237080AbhCARGv (ORCPT ); Mon, 1 Mar 2021 12:06:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1DA3364D9C; Mon, 1 Mar 2021 16:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616821; bh=PDA0LOONAEIJuZWghHzO25gWwrU8BuQaaSYr6hCSOVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q1fYUtLvMGUqxKjDAhiBl2cu3M5o2WjswyRX9cCqaMkVX6aor3DaWRy6kUahdGVfE Z5cFy36umpo+wMGCAOktzMzKzBpNRnuvelMmMS+dVOVfGjY1c4/yslXtwEDb1qIg/j wuuzVfHHXrTeXDCkitp8fDIYXIDdOoVBVNQdpYm4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Jerome Brunet , Sasha Levin Subject: [PATCH 4.19 108/247] clk: meson: clk-pll: fix initializing the old rate (fallback) for a PLL Date: Mon, 1 Mar 2021 17:12:08 +0100 Message-Id: <20210301161036.960588715@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@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: Martin Blumenstingl [ Upstream commit 2f290b7c67adf6459a17a4c978102af35cd62e4a ] The "rate" parameter in meson_clk_pll_set_rate() contains the new rate. Retrieve the old rate with clk_hw_get_rate() so we don't inifinitely try to switch from the new rate to the same rate again. Fixes: 7a29a869434e8b ("clk: meson: Add support for Meson clock controller") Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20201226121556.975418-2-martin.blumenstingl@googlemail.com Signed-off-by: Sasha Levin --- drivers/clk/meson/clk-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index 3e04617ac47f6..6fdad22a583d9 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -197,7 +197,7 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, if (parent_rate == 0 || rate == 0) return -EINVAL; - old_rate = rate; + old_rate = clk_hw_get_rate(hw); pllt = meson_clk_get_pll_settings(rate, pll); if (!pllt) -- 2.27.0