Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp98161img; Wed, 20 Mar 2019 15:04:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIrSttBg1aTxZBnp5kIpJ1URBkRsKbwlMEJcm1DqIX1EVcYGHHL7klzSJw34Y5XYu7Z1Tv X-Received: by 2002:a17:902:123:: with SMTP id 32mr42236plb.187.1553119483433; Wed, 20 Mar 2019 15:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553119483; cv=none; d=google.com; s=arc-20160816; b=06OxX+vHjv737w/LyS6ntbbsISfnri5OjQsS8xk+lKeCArNsU3r6rZcI4HAvgPTEkA 0mqNPv5RbumJ0sI0bZDDsuYLZB4Ic3d1NFZgWi7l9NugZ+kXnC+5BJ44a6tXWlmcKRaJ /spr2s3MYrtpRvicpVhb4pCdQ/aNUwtqiA0F3GHICXsTfP58w1aiCVwlxxcyr1Cgt1b6 rJvsZPzFugpLS3nizTMumsT1qPBrT796DhdkGxpBd6E6xUqJJSr2ass9u74CpODUv5Vu KtAcf4xpcWTXkgoKTnADIiHm9lUS5Xazi7xxiCh6mchOR1PdnmqG9IKE42E/M3rIyqgJ Unrw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sye9pmN9RqCau99uQ30RiaNU06AjrsbWR99rGw3iM0U=; b=HAKOanK+Dx+3xU8a4DIjABofbkdrqZOtxIypfNG5x/xrgVgGgj0WbZ5x5JpPv3INkE WnhxVWscCf40kiHYY1m+kTVlxF+VuhVVaCqCD+pLBis4+oSEWeNmknUwFVW3oe3fZgWi 0HhHdxOIm0PQueE9CyIRVUbCfb96vNFVntDMHOjb+dX/gcjUmsxxJio3LMgBX4J8L9Vy l+PrkwPDctAx4DQfJzSHgytnJkXkDCbo+GjA9YbUqUi8U7oIYpSnKRDQvzZhv2EWmyx1 +p4rA2Qux0EKCPFucd8H28KUzl1gf/Pxaa/UFecCOg7WeufXofJxoncNSZDGyqWxm1Bs HpiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Hv8nPb6q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si2551536pgj.195.2019.03.20.15.04.27; Wed, 20 Mar 2019 15:04:43 -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; dkim=pass header.i=@chromium.org header.s=google header.b=Hv8nPb6q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727635AbfCTWC0 (ORCPT + 99 others); Wed, 20 Mar 2019 18:02:26 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41815 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727476AbfCTWCZ (ORCPT ); Wed, 20 Mar 2019 18:02:25 -0400 Received: by mail-pg1-f194.google.com with SMTP id k11so2758456pgb.8 for ; Wed, 20 Mar 2019 15:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sye9pmN9RqCau99uQ30RiaNU06AjrsbWR99rGw3iM0U=; b=Hv8nPb6qiPj03VRQpx7ORJNed3nv6xCW9jbA4Jn8OQOroy/FPaQY3YymqC9up2Z5xm ruS+fp7Afl2nYATgOPT/h+Spw3/m6RbUSDIv1LLXHYU6w5yhdcZAq3UlRFx5BFT0dWt7 SWYAr3BIXFnjJm0+2QlpDedEVmXLJeCVjbGJk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=sye9pmN9RqCau99uQ30RiaNU06AjrsbWR99rGw3iM0U=; b=g/rOQ+VL7jEGK8rkmzRBNchjPeciLDcRzz/XClNzkYD5XjhaCbSvbT5DQ2PZs/AiSw IgBRWQ0ZAoKFsXzOf/vs/o3zLHSHD/aulFW4IH0xk8o3UFHHfttRXe3vTh87+iphPktx 5FkfvBjmnA8zed5wsUrC1btC9iOxq3UH2f+LMLQpE60ULiyWKAtTLA0nCmGuhIVauPXZ ZHSchJ3hovgn/ys7nqLMZo6ivi3luFal/MJ/lk5PDtfE09zjkZZ8IqiY6CylNN/uX3GJ wR8sZz2vlTmy05T963lVbBiJzeEG+qCkxckWsy2pyNZDU1Hm/BCBrFTqSFXYdigitYaK ATsQ== X-Gm-Message-State: APjAAAVfhZIhqQ+kBoItVO47/2fqMa248PjTApI9iwdo9ou4kLUaXKtu OjkLDRmFDr/NWNnqVGxkCvihvg== X-Received: by 2002:a63:5c66:: with SMTP id n38mr221110pgm.15.1553119344714; Wed, 20 Mar 2019 15:02:24 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id f15sm3222477pgd.74.2019.03.20.15.02.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 15:02:24 -0700 (PDT) Date: Wed, 20 Mar 2019 15:02:23 -0700 From: Matthias Kaehlcke To: =?utf-8?B?R2HDq2w=?= PORTAY Cc: Mark Rutland , devicetree@vger.kernel.org, Derek Basehore , Heiko Stuebner , linux-pm@vger.kernel.org, Brian Norris , Douglas Anderson , Rob Herring , linux-kernel@vger.kernel.org, Chanwoo Choi , Kyungmin Park , MyungJoo Ham , Klaus Goger , Enric Balletbo i Serra , linux-rockchip@lists.infradead.org, Randy Li , kernel@collabora.com, linux-arm-kernel@lists.infradead.org, Lin Huang Subject: Re: [PATCH v2 3/5] devfreq: rk3399_dmc: Pass ODT and auto power down parameters to TF-A. Message-ID: <20190320220223.GP112750@google.com> References: <20190319181323.22804-1-gael.portay@collabora.com> <20190319181323.22804-4-gael.portay@collabora.com> <20190320003352.GN112750@google.com> <20190320215013.43zgvyn5frnb3yud@archlinux.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190320215013.43zgvyn5frnb3yud@archlinux.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Gaël, On Wed, Mar 20, 2019 at 05:50:13PM -0400, Gaël PORTAY wrote: > 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 >= dmcfreq->odt_dis_freq) > > > + odt_enable = 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. If there is no frequency change the function returns at the beginning. My suggestion was to only do the call when 'odt_enable' changes, i.e. when a change (up or down) passes the 'odt_dis_freq' threshold. > Also, the call takes around 300us. Thanks for the info! Matthias