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=-2.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,FROM_EXCESS_BASE64,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,UNPARSEABLE_RELAY,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 4E69FC43381 for ; Wed, 20 Mar 2019 21:50:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1C050218B0 for ; Wed, 20 Mar 2019 21:50:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ddI9uEqy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C050218B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YRnK2ffO8v0wbYoDz6PmPbyDAxgPwNbgHsYjEQDxWA8=; b=ddI9uEqyDSqE6F OoJ0zztxF8/qSbOrE1zzObpyu0IG1jRyk0FOf20D0WGYuSxTT1kB7IoxVelTiS0sQMsRwEyHJXefi OTgKOR8iHzgAfhbt2yoAwinamZvRjYgnWMGB8Hl3Ighe4NasqkhSnoJuN3RybSSFpN5Sp9ITxoW4c BSoCH3Dlf/ljKRH32A4232KEGQSNmfpsMNXDVwv4FMsx3P7lm5HGtHjryz/rOCuEyaaV6+EQ9TuxQ J6mJnRBctvHpVH+UfsuHD5Ou0f1t87o8370l+AYzrlsuwnXsNHKBlTCnv9Cd19dr0QoFZTSYqBygu gDmb40O+HAqZnpGC6MLw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6j6B-00046V-7N; Wed, 20 Mar 2019 21:50:11 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6j67-0003fj-Ps; Wed, 20 Mar 2019 21:50:08 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gportay) with ESMTPSA id 2DCB72817E9 Date: Wed, 20 Mar 2019 17:50:13 -0400 From: =?utf-8?B?R2HDq2w=?= PORTAY To: Matthias Kaehlcke Subject: Re: [PATCH v2 3/5] devfreq: rk3399_dmc: Pass ODT and auto power down parameters to TF-A. Message-ID: <20190320215013.43zgvyn5frnb3yud@archlinux.localdomain> References: <20190319181323.22804-1-gael.portay@collabora.com> <20190319181323.22804-4-gael.portay@collabora.com> <20190320003352.GN112750@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190320003352.GN112750@google.com> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190320_145008_111332_F8D25D99 X-CRM114-Status: GOOD ( 20.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Derek Basehore , Heiko Stuebner , linux-pm@vger.kernel.org, Brian Norris , Douglas Anderson , linux-kernel@vger.kernel.org, Chanwoo Choi , Kyungmin Park , Rob Herring , Klaus Goger , MyungJoo Ham , Enric Balletbo i Serra , linux-rockchip@lists.infradead.org, Randy Li , kernel@collabora.com, linux-arm-kernel@lists.infradead.org, Lin Huang Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Matthias, On Tue, Mar 19, 2019 at 05:33:52PM -0700, Matthias Kaehlcke wrote: > ... > > @@ -95,6 +103,19 @@ static int rk3399_dmcfreq_target(struct device *dev= , unsigned long *freq, > > = > > mutex_lock(&dmcfreq->lock); > > = > > + if (target_rate >=3D dmcfreq->odt_dis_freq) > > + odt_enable =3D true; > > + > > + /* > > + * This makes a SMC call to the TF-A to set the DDR PD (power-down) > > + * timings and to enable or disable the ODT (on-die termination) > > + * resistors. > > + */ > > + arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, dmcfreq->odt_pd_arg0, > > + dmcfreq->odt_pd_arg1, > > + ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD, > > + odt_enable, 0, 0, 0, &res); > = > Is it necessary/desirable to make this call for every frequency > change? IIUC it should be only needed when odt_enable changes and the > driver could track the state. If the DDR frequency doesn't change too > often and the overhead of the call is small it shouldn't be really > important though. > I will test your solution first to make sure there is no regression to run that call for frequency change only. Also, the call takes around 300us. > > ... > > @@ -334,6 +357,34 @@ static int rk3399_dmcfreq_probe(struct platform_de= vice *pdev) > > return ret; > > } > > = > > + /* Try to find the optional reference to the pmu syscon */ > > + node =3D of_parse_phandle(np, "rockchip,pmu", 0); > > + if (node) { > = > The 'optional' part doesn't seem to be accurate: according to the > binding (https://lore.kernel.org/patchwork/patch/1052322/) the > property is required and the code below assumes that data->regmap_pmu > is set. > Indeed. > > + data->regmap_pmu =3D syscon_node_to_regmap(node); > > + if (IS_ERR(data->regmap_pmu)) > > + return PTR_ERR(data->regmap_pmu); > > + } > > + > > + /* Get DDR type */ > = > nit: the comment doesn't add much value, thanks to good variable > naming this is evident from the code. > = > > + regmap_read(data->regmap_pmu, RK3399_PMUGRF_OS_REG2, &val); > > + ddr_type =3D (val >> RK3399_PMUGRF_DDRTYPE_SHIFT) & > > + RK3399_PMUGRF_DDRTYPE_MASK; > > + > > + /* Get the odt_dis_freq parameter in function of the DDR type */ > = > nit: ditto > = > (if you prefer to keep these comments I'm not opposed to keeping them, > but I don't think they are needed) > I will remove all the comments in the v3. > Cheers > = > Matthias > = > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip Regards, Ga=EBl _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel