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.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 92A7AC32771 for ; Thu, 9 Jan 2020 04:41:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63A7F2072E for ; Thu, 9 Jan 2020 04:41:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="muJ29tPv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727943AbgAIEl5 (ORCPT ); Wed, 8 Jan 2020 23:41:57 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34279 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbgAIEl5 (ORCPT ); Wed, 8 Jan 2020 23:41:57 -0500 Received: by mail-pl1-f196.google.com with SMTP id x17so2038169pln.1 for ; Wed, 08 Jan 2020 20:41:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TRjoVo3zj4W4LfAs9dMN4fOiIUDjAiTixS2yPeXgoDQ=; b=muJ29tPvUK4BsxxgLvfXC/FDpAogqeNb4Yj0qnWwm3nQ5iHzd0PKghtKldnrwY4Asu R9cMGIY1nMK4gqmHJRBCFzunPvtZ1aCuNfMKGuPpOcAJkWUl9LINrRQtCqLLE47NCqjg sYTgbvZESm5lF9IUwWFAr7O8lCrPd1Lvwn2UrddOtwnUXLbvU/PgEFVxlc6kjaMFmZ/n y8OoG+fKyEX9Su9Fl54aMGkD1yPcJBC8lYi0/74jl7qyf6RBghWfE0RXNJH2nTcFpbms 2U69QHRHaTBnPbhn1LpD82CuTXJ08AQ+fG4uK+J4boK3G2+CdK1sxstEeD2h7iq0TFPX jNJA== 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:in-reply-to:user-agent; bh=TRjoVo3zj4W4LfAs9dMN4fOiIUDjAiTixS2yPeXgoDQ=; b=AlE3+VGxZ0UAsBZtQJSL6J9UU3DBlni1maroX+NvAIjtyl4nYoN+UiUaXo2FSEbW19 o2mB88OptSJRy+lWCjbZAdtOh1KYXrQbXArt+r4DRIX2dPtA22BOtEBs1IfhNfxuCdYg 88VU/+EqNOXJhS2LPHbBn6ZV8sp3zY4vZri2CmyUihEUGtWxjQsL6IRpSs0FNPoyGRLY KViJ9zOKqL3CAgq6KJL0rLJTnjzbj5De+OJY610paGIDsC5Xmz0gG31OFkxCDia/ka0v +VMTA9pCVxf8EshtN1F2MTxQwmrY/zjwSzmWuRtO3P/iWxRB4iKhvwiY6Ix9tBwirCGe HLmQ== X-Gm-Message-State: APjAAAWzTYSmvsw8oSqOMQv+xcANxHff9fKBwfF2uLzzlSdTT3v+ep/u Q6mSNEMTNv8SjPQFr+LRLAj9RA== X-Google-Smtp-Source: APXvYqxjIkobJfEbVA0G149IgU2oFp/wmK3lj3C8cMWvXPKRJq96IVC+8GTQRvil/pY8LRz/7BA/FQ== X-Received: by 2002:a17:90a:d804:: with SMTP id a4mr2930341pjv.11.1578544916616; Wed, 08 Jan 2020 20:41:56 -0800 (PST) Received: from localhost ([122.172.140.51]) by smtp.gmail.com with ESMTPSA id r7sm5584790pfg.34.2020.01.08.20.41.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2020 20:41:55 -0800 (PST) Date: Thu, 9 Jan 2020 10:11:54 +0530 From: Viresh Kumar To: Saravana Kannan Cc: Rob Herring , Mark Rutland , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Georgi Djakov , Vincent Guittot , "Sweeney, Sean" , David Dai , adharmap@codeaurora.org, Rajendra Nayak , Sibi Sankar , Bjorn Andersson , Evan Green , Android Kernel Team , Linux PM , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML Subject: Re: [PATCH v6 3/3] OPP: Add helper function for bandwidth OPP tables Message-ID: <20200109044154.u3ypodoulygemaa6@vireshk-i7> References: <20191207002424.201796-1-saravanak@google.com> <20191207002424.201796-4-saravanak@google.com> <20200108111947.q5aafrlz26tnk3nq@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 08-01-20, 19:36, Saravana Kannan wrote: > On Wed, Jan 8, 2020 at 4:58 PM Saravana Kannan wrote: > > > > On Wed, Jan 8, 2020 at 3:19 AM Viresh Kumar wrote: > > > > > > On 06-12-19, 16:24, Saravana Kannan wrote: > > > > The frequency OPP tables have helper functions to search for entries in the > > > > table based on frequency and get the frequency values for a given (or > > > > suspend) OPP entry. > > > > > > > > Add similar helper functions for bandwidth OPP tables to search for entries > > > > in the table based on peak bandwidth and to get the peak and average > > > > bandwidth for a given (or suspend) OPP entry. > > > > > > > > Signed-off-by: Saravana Kannan > > > > --- > > > > drivers/opp/core.c | 301 +++++++++++++++++++++++++++++++++++------ > > > > include/linux/pm_opp.h | 43 ++++++ > > > > 2 files changed, 305 insertions(+), 39 deletions(-) > > > > > > > > diff --git a/drivers/opp/core.c b/drivers/opp/core.c > > > > index c79bbfac7289..3ff33a08198e 100644 > > > > --- a/drivers/opp/core.c > > > > +++ b/drivers/opp/core.c > > > > @@ -127,6 +127,29 @@ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) > > > > } > > > > EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq); > > > > > > > > +/** > > > > + * dev_pm_opp_get_bw() - Gets the bandwidth corresponding to an available opp > > > > + * @opp: opp for which peak bandwidth has to be returned for > > > > > > s/peak // > > > > Ack > > Actually, isn't this correct as is? peak bandwidth is "returned". > Average bandwidth is updated through the pointer. I think we return two values here, peak and avg bw. Just that we can't return two values from a routine, and so one is returned using a pointer. And so I though writing just bw may be better. -- viresh