From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754906AbbIXMRr (ORCPT ); Thu, 24 Sep 2015 08:17:47 -0400 Received: from mail.kernel.org ([198.145.29.136]:58800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754440AbbIXMRp (ORCPT ); Thu, 24 Sep 2015 08:17:45 -0400 Date: Thu, 24 Sep 2015 05:17:38 -0700 From: Shawn Guo To: Stefan Wahren Cc: Victorien Vedrine , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, sboyd@codeaurora.org, mturquette@baylibre.com, shawn.guo@linaro.org, "Fabio.Estevam@freescale.com" , Marek Vasut , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2] clk:mxs: Fix bug on frequency divider Message-ID: <20150924121738.GP3529@tiger> References: <55BBB1AC.6070102@codeaurora.org> <1441010707-17178-1-git-send-email-victorien.vedrine@ophrys.net> <55FBBB6D.4010805@i2se.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55FBBB6D.4010805@i2se.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 18, 2015 at 09:21:17AM +0200, Stefan Wahren wrote: > +Shawn's new address > +linux-arm-kernel > > > On drivers/clk/mxs/clk-frac.c, the function clk_frac_round_rate returned a bad > > result. The division before multiplication computes a wrong value ; the > > calculation is inverted to fix the problem. The second issue is that the exact > > rate have decimals and they are truncate. The consequence is that the function > > clk_frac_set_rate (which use the result of clk_frac_round_rate) computes a > > wrong value for the register (the rate generated can be closer to the desired > > rate). The correction is : if there is decimal to the result, it is rounded to > > the next larger integer. > > On drivers/clk/mxs/clk-frac.c, the function clk_frac_recalc_rate returned > > a bad result. The multiplication is made before the division to compute a > > correct value. > > > > Signed-off-by: Victorien Vedrine Acked-by: Shawn Guo