Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3124777imd; Mon, 29 Oct 2018 01:59:45 -0700 (PDT) X-Google-Smtp-Source: AJdET5c08GgFxBNV1QIuaYaDIpAdpDZfK52NWhVwJgqjueRbtO/qzQqHsSTiLYtuPqFGax1Vnr7e X-Received: by 2002:a65:5647:: with SMTP id m7-v6mr5695957pgs.168.1540803585386; Mon, 29 Oct 2018 01:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540803585; cv=none; d=google.com; s=arc-20160816; b=t0NMOuELLQdps4O3FSWXcAcDN7AQhcT8+o9Tt5GGOEOT20uONO9xQMx0jBUX97OGhi oYeCqGkU5Z2OxO5IDv7Jt0sNhOcsZV7j8tS3tyXKiJnplArRhkU2vlyJtVpIZdNrIUcQ 5rV/z79Xb5pXmmZqC1ZGuiUPRFbsllpIhor2sLHIX0AXhUmBdyp92qK2Mb8Kc/Jbkw8i Dzv2rU/W8nLaULRKYo3K3smDS6BPpdi6+0YHz+xttaMV4qs9w07he/imOkJQ4mJqcVc+ myy3uerj7sgvYafxN/7T9LTlyG9msEVtTXFEHYVKvAazhLNrY2Cjrpb3pInUOnHt1c/B JDlQ== 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=/HnMUgC5qHELmdZ2YdtXOD3IWbEXn4dD4DF/bzA8Hro=; b=GG17W9Mf2fKA6AUhp/Aj7Iw8mw9fig9S08gAWVEpfJcX2KQ1owuavYVahzgPIPzwxE 6bhp2FtNg9157xbg7WTcZFboSdiKiG1YpwnZbPwW9w08oIfu8Xv7jPn6KF57El+G5HbT SAzTL0lKNTLgVGyl3tRYdIbN64JTvgnlctWi9H2J6GgrW7neoSDAM0IRJaRiIFqsS/bJ 4JMQy5W9Tm55mSggetWRuPfcez8GWT2fEQK+Udr4cqddoQGw1/paDugWyybo7r2DpQNa +WjQ4QbipUXKA0fVteQqwvQMYZWzR9729uVL1KWEcCZArKaCUgipYmaD7RDWu5LYF6B8 l22w== 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 i35-v6si7458813plg.252.2018.10.29.01.59.30; Mon, 29 Oct 2018 01:59:45 -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; 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 S1729501AbeJ2Rqi (ORCPT + 99 others); Mon, 29 Oct 2018 13:46:38 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54061 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729300AbeJ2Rqi (ORCPT ); Mon, 29 Oct 2018 13:46:38 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 8D5A3207D4; Mon, 29 Oct 2018 09:58:53 +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-12-210.w90-88.abo.wanadoo.fr [90.88.133.210]) by mail.bootlin.com (Postfix) with ESMTPSA id 4DA6720970; Mon, 29 Oct 2018 09:58:43 +0100 (CET) Date: Mon, 29 Oct 2018 09:58:43 +0100 From: Maxime Ripard To: Jagan Teki Cc: 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: [PATCH v2 02/15] clk: sunxi-ng: Add check for minimal rate to NKM PLLs Message-ID: <20181029085843.3bslqwktxbp2ywk2@flea> References: <20181023155035.9101-1-jagan@amarulasolutions.com> <20181023155035.9101-3-jagan@amarulasolutions.com> <20181024180436.5n3i3z6h2yezc4cv@flea> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5lt5pgqwghypjetl" 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 --5lt5pgqwghypjetl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: > > > > 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 set b= elow > > > certain rate. > > > > > > So, add support for minimal rate for relevant PLLs. > > > > > > Signed-off-by: Jagan Teki > > > --- > > > Changes for v2: > > > - new patch > > > > > > drivers/clk/sunxi-ng/ccu_nkm.c | 7 +++++++ > > > drivers/clk/sunxi-ng/ccu_nkm.h | 1 + > > > 2 files changed, 8 insertions(+) > > > > > > diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/cc= u_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(struct c= cu_mux_internal *mux, > > > if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) > > > rate *=3D nkm->fixed_post_div; > > > > > > + if (rate < nkm->min_rate) { > > > + rate =3D nkm->min_rate; > > > + if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) > > > + rate /=3D nkm->fixed_post_div; > > > > 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 fixed > > 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. That's not my point though. Does the rate needs to be superior to min / post_div, or min? > > > > How did you test this? >=20 > I've not used this on PLL_MIPI atleast, so I didn't test this. If you've never tested this, why are you adding that code? Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --5lt5pgqwghypjetl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCW9bLwwAKCRDj7w1vZxhR xbT0AP0fPto4coEig8ZR39G7ONTVrOWBcxXknPHHF4gUjPDIbAEA0V0BEp+iz73p SAD23hiIL4S+7qCvlNFZYYpGN5WsxAw= =XwoR -----END PGP SIGNATURE----- --5lt5pgqwghypjetl--