Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755011AbbBTTNW (ORCPT ); Fri, 20 Feb 2015 14:13:22 -0500 Received: from mail-ie0-f180.google.com ([209.85.223.180]:41703 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752281AbbBTTNU convert rfc822-to-8bit (ORCPT ); Fri, 20 Feb 2015 14:13:20 -0500 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Russell King - ARM Linux , "Sascha Hauer" From: Mike Turquette In-Reply-To: <20150216112724.GN8656@n2100.arm.linux.org.uk> Cc: "Tomi Valkeinen" , stefan.wahren@i2se.com, devicetree@vger.kernel.org, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, a.hajda@samsung.com, kernel@pengutronix.de, andy.yan@rock-chips.com, "Liu Ying" , linux-arm-kernel@lists.infradead.org References: <1423720903-24806-1-git-send-email-Ying.Liu@freescale.com> <1423720903-24806-2-git-send-email-Ying.Liu@freescale.com> <20150212093356.GR12209@pengutronix.de> <20150212103944.GA1290@victor> <20150212122405.GW12209@pengutronix.de> <20150212125646.GT8656@n2100.arm.linux.org.uk> <20150212134131.GX12209@pengutronix.de> <54DE0BB8.7070004@ti.com> <20150213185713.GA12209@pengutronix.de> <20150216112724.GN8656@n2100.arm.linux.org.uk> Message-ID: <20150220191306.421.58746@quantum> User-Agent: alot/0.3.5 Subject: Re: [PATCH RFC v9 01/20] clk: divider: Correct parent clk round rate if no bestdiv is normally found Date: Fri, 20 Feb 2015 11:13:06 -0800 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1347 Lines: 32 Quoting Russell King - ARM Linux (2015-02-16 03:27:24) > On Fri, Feb 13, 2015 at 07:57:13PM +0100, Sascha Hauer wrote: > > I agree that it's a bit odd, but I think it has to be like this. > > Consider that you request a rate of 100Hz, but the clock can only > > produce 99.5Hz, so due to rounding clk_round_rate() returns 99Hz. > > Now when you request 99Hz from clk_set_rate() the 99.5Hz value > > can't be used because it's too high. > > Math rounding rules normally state that anything of .5 and greater > should be rounded up, not rounded down. So, for 99.5Hz, you really > ought to be returning 100Hz, not 99Hz. > > However, you do have a point for 99.4Hz, which would be returned as > 99Hz, and when set, it would result in something which isn't 99.4Hz. More practically, this again raises the issue of whether or not unsigned long rate should be in millihertz or something other than hertz. And then that question again raises the issue of making rate 64-bit... Regards, Mike > > -- > FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up > according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/