Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6479216imu; Wed, 30 Jan 2019 15:46:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN5nszFx3mkx+TX1I3gPoafESyiW4RKp405k2cNvIlRNCD2qt+IHce3qcziVQJ25oTy+mwad X-Received: by 2002:a62:4c5:: with SMTP id 188mr32970015pfe.130.1548891994091; Wed, 30 Jan 2019 15:46:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548891994; cv=none; d=google.com; s=arc-20160816; b=eaMR96uiNP7P1dguQbXEtsIuVCkeve1WJ8mShsSmav6Zuc6N7UCAVTSmsgtA51puAq NBy/kLxQDhr9EyIRMFOojC4uZ2l97MiZs6rkYQIRRJ+z+zUbl41Grzji+plbMYtgRJZR sci6xs6gBZlANOmQQF2LtsZ2mVCcHYzJx2UuLGgdChRaCAsAynF6wab5Mp/OVNYfStMs 1GDOeqpRY2rdhRVOHML+qFDh0kpMx5XF4/+K1ps9PIJ2KNo/Xi9fSnZWtuGmICaSz0Va a4aQDTO3E9fy2fxYtsbOd/T1aM5Iy11qSO+Y7BVAZyM8w7YVn7mt+GJyZyI6ws/Qcs5K 8pJQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=pHutBD38scW9rqQSNraL19ZwrJ19kOI7PoSL8xL5Efk=; b=RYJr+4z3zy6ElsK0Q4ujw/v4Km6Wi8qVp50MGREtURdpuFUftsHPsAaFzBPU9Somh0 YpNw40QRdmXl6MQ9erEMOCwrVmd+cMgJF9V5+vCQiJuODTznQ4wA6tlRT3zuaQsoT6l/ qdj5ygbqdDF3SoSIaMZ1NaAjAo3uD81D1LrzMBsK/swdUCIMAVBtDTOSBFx1vAvh4uaO fnVI0SJQSh2j6d2aD+9adTIUPw9HH7PnNDLkf1wnDO6PkAQ1MgwFoyHuZvBJewFE07Z8 L/3jGot4pkMhBLSxN6hypB0Ayv5n5CdHcMX5uEVp3GeNrtHGRcglwHYsXK7sOxFvTS5c WsHg== ARC-Authentication-Results: i=1; mx.google.com; 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 e9si2851046plt.181.2019.01.30.15.46.19; Wed, 30 Jan 2019 15:46:34 -0800 (PST) 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; 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 S1728672AbfA3XoT (ORCPT + 99 others); Wed, 30 Jan 2019 18:44:19 -0500 Received: from www1102.sakura.ne.jp ([219.94.129.142]:55012 "EHLO www1102.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbfA3XoS (ORCPT ); Wed, 30 Jan 2019 18:44:18 -0500 Received: from fsav105.sakura.ne.jp (fsav105.sakura.ne.jp [27.133.134.232]) by www1102.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id x0UNi6Mq059918; Thu, 31 Jan 2019 08:44:06 +0900 (JST) (envelope-from katsuhiro@katsuster.net) Received: from www1102.sakura.ne.jp (219.94.129.142) by fsav105.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp); Thu, 31 Jan 2019 08:44:06 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp) Received: from [192.168.1.2] (119.104.232.153.ap.dti.ne.jp [153.232.104.119]) (authenticated bits=0) by www1102.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id x0UNi57q059914 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Thu, 31 Jan 2019 08:44:06 +0900 (JST) (envelope-from katsuhiro@katsuster.net) Subject: Re: [PATCH] clk: fractional-divider: check parent rate only for general approximation To: Stephen Boyd , Michael Turquette , linux-clk@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20190107132124.27788-1-katsuhiro@katsuster.net> <154879892760.136743.9274469856102314518@swboyd.mtv.corp.google.com> From: Katsuhiro Suzuki Message-ID: Date: Thu, 31 Jan 2019 08:44:05 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <154879892760.136743.9274469856102314518@swboyd.mtv.corp.google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Stephen, Thank you for your comment. I'll add detail description and send it. Best Regards, Katsuhiro Suzuki On 2019/01/30 6:55, Stephen Boyd wrote: > Quoting Katsuhiro Suzuki (2019-01-07 05:21:24) >> Custom approximation of fractional-divider may not need parent clock >> rate checking. For example Rockchip SoCs work fine using grand parent >> clock rate evne if target rate is greater than parent. >> >> This patch removes parent clock rate check from custom approximation. >> >> Signed-off-by: Katsuhiro Suzuki >> --- >> drivers/clk/clk-fractional-divider.c | 10 +++++++--- >> 1 file changed, 7 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c >> index 545dceec0bbf..b0fc5509e0ff 100644 >> --- a/drivers/clk/clk-fractional-divider.c >> +++ b/drivers/clk/clk-fractional-divider.c >> @@ -79,13 +79,17 @@ static long clk_fd_round_rate(struct clk_hw *hw, unsigned long rate, >> unsigned long m, n; >> u64 ret; >> >> - if (!rate || rate >= *parent_rate) >> + if (!rate) > > Is your fraction multiplying the rate up? If it's a divider it shouldn't > be increasing the rate more than whatever the parent is supplying so > this looks odd. How does the grandparent matter here? Maybe you can show > the example in the commit text so we can all understand what's going on > here. > >> return *parent_rate; >> > >