Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1020882yba; Thu, 4 Apr 2019 02:35:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFnF3QRiOevfrJBIyh7eXMXWlj0ny0GLTq32VxVkq2pRSvS2nfQKVcDlHv/JLnurjSnQRd X-Received: by 2002:a65:538b:: with SMTP id x11mr4858150pgq.35.1554370555351; Thu, 04 Apr 2019 02:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370555; cv=none; d=google.com; s=arc-20160816; b=hcCCeJ6vrbCkQTg+wHWL9XH0izGPA7sQvoibYrZ/NM2V6nHWeTeOpe87O7IGkeIloW uvwspVXJ7JBMcXEtzMJHKFLZXChM0Nr2/uQ7NYWf/hlGStEdVMvK9OAnMO/DkGecJHeH qo1HAgXrEa8lpGKoaAka+LarncGtiyR2i4fjtF7/HQL4Px3SyV+0rk6lgciE9uXG9/5z 0LD3uH91AHzj4ULxlpxzGkf5HlOp1mmzU54jttsuenygs1Oe2J8umFHmR3UX6c1aQaI5 ms6lBCkAICxuRWDpnUI2pRsVkzYd98Yf57UY1Djj9OOceMHYy0FfqrAPj3hDHhHqqhDS 7++w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z9H26WmCQib422zTgZXXN4wEgWHNV/D1QJl7DoHGruI=; b=nAUDqr3SJZmssTXhxWMub4TVP8PvSafeX7q1BFrLMrMxDnSeDNLVhqMHfZ+RsA3d37 pxcPOt0eMhXy/OzXcexPbHcMey9oVTidjeI/WC+NDaubEQ8bJ/SlRRW4qicSztsHZY5H qqEGobrXL0rIjx2cTFD/JwRP7uza/HO1ZUizPisI8NZxIQKGFXLuCOR/5+mRf7iROL1t LkrHHC1h13VvG6y3YagMvs+96a7LMijTBNGkWcPjpHEoxHNtTk7jPenFeIw1QYNGdNVE eqxX5zH1urc/dbRmh5O1vILNV1Y/uzsiroIxwFj9fnAiUgyZJeWtAEnNHu5Bu5LzyAnq s9pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t+6IIW67; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si5780117pgl.348.2019.04.04.02.35.40; Thu, 04 Apr 2019 02:35:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t+6IIW67; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732488AbfDDJHV (ORCPT + 99 others); Thu, 4 Apr 2019 05:07:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:46070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732479AbfDDJHR (ORCPT ); Thu, 4 Apr 2019 05:07:17 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 43EDC21741; Thu, 4 Apr 2019 09:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368836; bh=TiIAm3q74voao95GL6gFmcsVFOXdP83S7xJ2nCwcdbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t+6IIW670CTWkg8DfnqrJHtLBsF55osRsciGzC/iqSytv48cAKaWUMEKlgBEi51CS 9iVAqpSLNbY9Bn2sKfOQ2KCvDRYSXNXEvYaWxpt9rGJRELJWZX28KayPqEpx+4UEdG BqnJlkheUFNYn5SWYxNrlv5ZvtHP2MahrGfmNQGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Katsuhiro Suzuki , Elaine Zhang , Heiko Stuebner , Sasha Levin Subject: [PATCH 4.19 180/187] clk: rockchip: fix frac settings of GPLL clock for rk3328 Date: Thu, 4 Apr 2019 10:48:37 +0200 Message-Id: <20190404084611.605818325@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a0e447b0c50240a90ab84b7126b3c06b0bab4adc ] This patch fixes settings of GPLL frequency in fractional mode for rk3328. In this mode, FOUTVCO is calcurated by following formula: FOUTVCO = FREF * FBDIV / REFDIV + ((FREF * FRAC / REFDIV) >> 24) The problem is in FREF * FRAC >> 24 term. This result always lacks one from target value is specified by rate member. For example first itme of rk3328_pll_frac_rate originally has - rate : 1016064000 - refdiv: 3 - fbdiv : 127 - frac : 134217 - FREF * FBDIV / REFDIV = 1016000000 - (FREF * FRAC / REFDIV) >> 24 = 63999 Thus calculated rate is 1016063999. It seems wrong. If frac has 134218 (it is increased 1 from original value), second term is 64000. All other items have same situation. So this patch adds 1 to frac member in all items of rk3328_pll_frac_rate. Signed-off-by: Katsuhiro Suzuki Acked-by: Elaine Zhang Signed-off-by: Heiko Stuebner Signed-off-by: Sasha Levin --- drivers/clk/rockchip/clk-rk3328.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/rockchip/clk-rk3328.c b/drivers/clk/rockchip/clk-rk3328.c index 2c5426607790..e431661fe874 100644 --- a/drivers/clk/rockchip/clk-rk3328.c +++ b/drivers/clk/rockchip/clk-rk3328.c @@ -78,17 +78,17 @@ static struct rockchip_pll_rate_table rk3328_pll_rates[] = { static struct rockchip_pll_rate_table rk3328_pll_frac_rates[] = { /* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */ - RK3036_PLL_RATE(1016064000, 3, 127, 1, 1, 0, 134217), + RK3036_PLL_RATE(1016064000, 3, 127, 1, 1, 0, 134218), /* vco = 1016064000 */ - RK3036_PLL_RATE(983040000, 24, 983, 1, 1, 0, 671088), + RK3036_PLL_RATE(983040000, 24, 983, 1, 1, 0, 671089), /* vco = 983040000 */ - RK3036_PLL_RATE(491520000, 24, 983, 2, 1, 0, 671088), + RK3036_PLL_RATE(491520000, 24, 983, 2, 1, 0, 671089), /* vco = 983040000 */ - RK3036_PLL_RATE(61440000, 6, 215, 7, 2, 0, 671088), + RK3036_PLL_RATE(61440000, 6, 215, 7, 2, 0, 671089), /* vco = 860156000 */ - RK3036_PLL_RATE(56448000, 12, 451, 4, 4, 0, 9797894), + RK3036_PLL_RATE(56448000, 12, 451, 4, 4, 0, 9797895), /* vco = 903168000 */ - RK3036_PLL_RATE(40960000, 12, 409, 4, 5, 0, 10066329), + RK3036_PLL_RATE(40960000, 12, 409, 4, 5, 0, 10066330), /* vco = 819200000 */ { /* sentinel */ }, }; -- 2.19.1