Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp368427imu; Mon, 5 Nov 2018 02:11:49 -0800 (PST) X-Google-Smtp-Source: AJdET5cEJKcyIP/LYEwpJpTHKPYcYl92u7+j9+fr3zHnN6NN2nha/HUmeirLDIeCIzeZxLLiXLJk X-Received: by 2002:a17:902:2ec1:: with SMTP id r59-v6mr21313205plb.243.1541412709233; Mon, 05 Nov 2018 02:11:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541412709; cv=none; d=google.com; s=arc-20160816; b=kpLBVPDGVUCOKMEdZDddHHc27shAkQIitHC6U4PIi3zlrXtu0obI+MRIqDaMj3qZpC qHOHRW8KvkGEl0IjnD2nqNHasi+u0USHPUv0HfCuedMEE7suORdncDvAT7kfsVHMm7+D O+FmGZvlv+DeHYtMGYOS0gX45Jjr3Mtke8eE/pjOiCyHqzfFSpF6L+l8d4Psw1wphl2A nPzQ+xMRJASzaiMUOEmbnzPewdYGihdprZg9Gc5h96EJv3jHuXQEfI1XQj2pkazlvt42 GYzEmw8faUUyKWu3fDu9g5bVIxr5Pn2/xHb6vCGyzmgvWZ6ZInl2vlGzDm6x0bbtik2W vwkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FQskA7a3Jogl8zgKQ4x5DBqzF2ny3AhAdaeEUUqzqAc=; b=nnHXs36pq0+lMFDFCH+EEnx18U1oRgRMvKKkFhVNKe7MPe3hnFvKU+9D5fKnOf18JS G+z1AF6lWfr/hPNh117RzBtcwwCuOOcnRB6X+99iB2KnQ1PMEv3V989cNJI4LzJ8JEw1 RmGTs7CPzGUIfKT0KTbBskamF8bBSw0J1N8UYEpDgHIaekZvm1xpj1aT9ygHHYSK7hNt AoJdNGedc26/1s4s2I2Q0LgRqALHnXOMEdiZL365zvXN/tOby1vnH+5R4S0POYlo2Sbe GVwfz3H2EWwrXeKE9CfylfVqFQrOJiMcxhg9J0CGr1a+ft5Esid5cVGbNr9aCPIaJFAz Io+A== 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 u12-v6si3612226plr.104.2018.11.05.02.11.34; Mon, 05 Nov 2018 02:11:49 -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 S1727820AbeKETaK (ORCPT + 99 others); Mon, 5 Nov 2018 14:30:10 -0500 Received: from mail.bootlin.com ([62.4.15.54]:60203 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbeKETaJ (ORCPT ); Mon, 5 Nov 2018 14:30:09 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id BC027207B0; Mon, 5 Nov 2018 11:11:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (aaubervilliers-681-1-93-44.w90-88.abo.wanadoo.fr [90.88.34.44]) by mail.bootlin.com (Postfix) with ESMTPSA id 88E46206D8; Mon, 5 Nov 2018 11:11:10 +0100 (CET) Date: Mon, 5 Nov 2018 11:11:10 +0100 From: Maxime Ripard To: Jagan Teki Cc: Jagan Teki , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel , Michael Turquette , Stephen Boyd , linux-clk , Michael Trimarchi , linux-arm-kernel , devicetree , linux-kernel , linux-sunxi@googlegroups.com Subject: Re: [linux-sunxi] Re: [PATCH v2 02/15] clk: sunxi-ng: Add check for minimal rate to NKM PLLs Message-ID: <20181105101110.agfik3oppd6ck25c@flea> References: <20181023155035.9101-1-jagan@amarulasolutions.com> <20181023155035.9101-3-jagan@amarulasolutions.com> <20181024180436.5n3i3z6h2yezc4cv@flea> <20181029085843.3bslqwktxbp2ywk2@flea> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="24qnld42rl357a2y" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --24qnld42rl357a2y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 29, 2018 at 06:10:47PM +0530, Jagan Teki wrote: > On 29/10/18 2:28 PM, Maxime Ripard wrote: > > On Thu, Oct 25, 2018 at 04:25:59PM +0530, Jagan Teki wrote: > > > On Wed, Oct 24, 2018 at 11:34 PM Maxime Ripard > > > wrote: > > > >=20 > > > > On Tue, Oct 23, 2018 at 09:20:22PM +0530, Jagan Teki wrote: > > > > > Some NKM PLLs doesn't work well when their output clock rate is s= et below > > > > > certain rate. > > > > >=20 > > > > > So, add support for minimal rate for relevant PLLs. > > > > >=20 > > > > > Signed-off-by: Jagan Teki > > > > > --- > > > > > Changes for v2: > > > > > - new patch > > > > >=20 > > > > > drivers/clk/sunxi-ng/ccu_nkm.c | 7 +++++++ > > > > > drivers/clk/sunxi-ng/ccu_nkm.h | 1 + > > > > > 2 files changed, 8 insertions(+) > > > > >=20 > > > > > diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-n= g/ccu_nkm.c > > > > > index 841840e35e61..d17539dc88dd 100644 > > > > > --- a/drivers/clk/sunxi-ng/ccu_nkm.c > > > > > +++ b/drivers/clk/sunxi-ng/ccu_nkm.c > > > > > @@ -125,6 +125,13 @@ static unsigned long ccu_nkm_round_rate(stru= ct ccu_mux_internal *mux, > > > > > if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) > > > > > rate *=3D nkm->fixed_post_div; > > > > >=20 > > > > > + if (rate < nkm->min_rate) { > > > > > + rate =3D nkm->min_rate; > > > > > + if (nkm->common.features & CCU_FEATURE_FIXED_POSTDI= V) > > > > > + rate /=3D nkm->fixed_post_div; > > > >=20 > > > > I'm not sure this is right. Is the post divider taken into account = to > > > > calculate the minimum, or is the minimum on the rate before the fix= ed > > > > post divider. > > >=20 > > > Since we are returning from here, we need to take care post div which > > > is actually doing at the end of round_rate. > >=20 > > That's not my point though. Does the rate needs to be superior to min > > / post_div, or min? >=20 > ie what I'm trying to say, since it's common code min or max should / > post_div and PLL_MIPI doesn't use any post_div. >=20 > We need to take care post_div though the current test (PLL_MIPI) in not u= sed > since it's common code. just like nkmp, nm etc. >=20 > >=20 > > > >=20 > > > > How did you test this? > > >=20 > > > I've not used this on PLL_MIPI atleast, so I didn't test this. > >=20 > > If you've never tested this, why are you adding that code? >=20 > Like above, it's common code. otherwise might effect. Adding untested, unverified and unneeded code is just bloat, nothing else. Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --24qnld42rl357a2y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCW+AXPgAKCRDj7w1vZxhR xZGZAP9paH3R1hjXBV/78pQJPBNmhdWRfP1ia9/7402ZarjPbgEAhMrhFLZ5XMu9 d1StSmseaJ/1DULVvnx5QFCiTcr5QQ8= =540+ -----END PGP SIGNATURE----- --24qnld42rl357a2y--