From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26F85C2BC61 for ; Mon, 29 Oct 2018 08:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB4532084A for ; Mon, 29 Oct 2018 08:58:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB4532084A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-clk-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729447AbeJ2Rqi (ORCPT ); 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) 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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@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--