Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp467883ybi; Fri, 26 Jul 2019 12:55:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyixlSYN2sYQ1EJRAhaI82RYSy7uEJOPu1vb45PSMrp9JsooYuypXGd7nCgw/+h08ZpmTRb X-Received: by 2002:a17:902:7687:: with SMTP id m7mr44271893pll.310.1564170907985; Fri, 26 Jul 2019 12:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564170907; cv=none; d=google.com; s=arc-20160816; b=uN5IQPHKSvBaTGEDIkP7pSP6n7CTJotZUvlBYBAOh/lg4GsUM5Rfnu5myg3C2iV8Oa bQzhPLRDr+4EzwK1yKotLh2SoHVFU6owthFTB7PxlA+Xt9ZmBncqtOvNGiokNuGsj1aI 6vdeZKcMjgqYO3Ux47+6aVj+VKquB5vewK0rzGw14YgNP+NkWzSu8JB8sB68KsCCFIQ9 yv6Un2nrdAgDoCZugYtmNq0T6BiyfWYVqMnpBdMxqwtC4poIcyHjUQBFsQsWDlEYZ1Hk jZotdHyqkynEXcfirVrdQ019YPKbd86LVw7+e2lfZ8eeLinGfgmbOP6pQ+T9CKebT4JH +E+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Qv/TYWK6NOYekEaLft+v7J5eS4Mf0pr3nYuBj6c8hlQ=; b=ysfSCdPa11CxP13x3aA/bXpWEZ44SdPyUEHlHkiP+g440IaX79NjNEaXQhr4Jzr6qm bSdVI6bOtbPKJWQ8Kd/xgTsfuboOygmoUhImkv0EuBeEG0eqZoW0Qu8nw1Bup5rFxH4q 7ybaBBwU4wzFdKYNPShPKXj3zV+sSZuZgR2o1cJdPP7LUxTzPlaRBpueineTYvnSwb5O 9ihD2v5uAQRfChVL2FL6zIV0EJkllptDb382XgrJQ9nAIidF79v2ugDEKiPc99iJLPpt EXp1ToSskyczka7tbdURstcm3O2fWhY5xVmijDUpoiaT9ZSPKSEhaVrI1OHisY5o05Jy lCQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qa7vSe1R; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si21135166pfi.264.2019.07.26.12.54.52; Fri, 26 Jul 2019 12:55:07 -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=@google.com header.s=20161025 header.b=Qa7vSe1R; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388416AbfGZTIv (ORCPT + 99 others); Fri, 26 Jul 2019 15:08:51 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:39873 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387570AbfGZTIv (ORCPT ); Fri, 26 Jul 2019 15:08:51 -0400 Received: by mail-ot1-f67.google.com with SMTP id r21so50349441otq.6 for ; Fri, 26 Jul 2019 12:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qv/TYWK6NOYekEaLft+v7J5eS4Mf0pr3nYuBj6c8hlQ=; b=Qa7vSe1RB8VnZOGBb0s+Kj+fpIDyeE6S/eOwpwfNE4z9MOYNwqpVwrdVgJH3WTo6R2 DUvJoADoLeswvTnOfIkZz29zTpMtaOUHAJbEC6boa+hc8cCAFuK7jnCqjmRsKuVsayJv XGc/OTQyUT8FIl/T4thWlWIb0cB6Vpsy+3ZNoggtUSk7qWfPNebILKpjDLxrq9RvGxTt qvCTlRo6Ods1D0ImSaDz5TGTQlNtzPORLqOTfxes56X7+qgfUM43q2cZkEAvoGWM5ykh UajSesiCEwB4DHkJy2IPmVd48UJbLbwKJiDD8AItzwacWT5OYOLRvykef0EgO4Sb7jkV Ny+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qv/TYWK6NOYekEaLft+v7J5eS4Mf0pr3nYuBj6c8hlQ=; b=pjK47ZFxfLO5+/ipHUIL2wzrKYFEpMLfBJEjjsgAZiHU7+tO1qgg9bZOP/SsMQjsWN /sdU+uz/fusdl+q7NRBEt3BPs/NGg7bsPLRWJLjKLNiOqI5glJZdp/aZ7/+hdDaKI6J1 cu2l8Dtl3YYFGJdKGQisxnbiDBAHer5+JdLbP6cQMS15EDt6qD0RCG/WyAmDMz32vVW9 XgudQgkActzVKII2M6dmYAeDw65g68Az3tVXxn3PuXa9gyJcrS0dUo0UaR82sQOokYXJ EsS6YOmqwsFwCHY5WTSl7NjGvxJQfGj/jq6r/YIPeN43kYOx0i/A0hUAwEtvu5X+taNr CLVg== X-Gm-Message-State: APjAAAUJG1D7SOG+0nu8CjU17Ef45iKdF/3FOqn+IgrOixARvxXJRkXk aehbswNT/C80T2lq5mjyLJCueXJyGlihecmOqlf1JQ== X-Received: by 2002:a9d:6201:: with SMTP id g1mr72758418otj.195.1564168129789; Fri, 26 Jul 2019 12:08:49 -0700 (PDT) MIME-Version: 1.0 References: <20190703011020.151615-1-saravanak@google.com> <20190703011020.151615-7-saravanak@google.com> In-Reply-To: From: Saravana Kannan Date: Fri, 26 Jul 2019 12:08:13 -0700 Message-ID: Subject: Re: [PATCH v3 6/6] interconnect: Add OPP table support for interconnects To: Georgi Djakov Cc: Rob Herring , Mark Rutland , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Vincent Guittot , "Sweeney, Sean" , David Dai , Rajendra Nayak , Sibi Sankar , Bjorn Andersson , Evan Green , Android Kernel Team , Linux PM , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 26, 2019 at 9:25 AM Georgi Djakov wrote: > > Hi Saravana, > > On 7/3/19 04:10, Saravana Kannan wrote: > > Interconnect paths can have different performance points. Now that OPP > > framework supports bandwidth OPP tables, add OPP table support for > > interconnects. > > > > Devices can use the interconnect-opp-table DT property to specify OPP > > tables for interconnect paths. And the driver can obtain the OPP table for > > an interconnect path by calling icc_get_opp_table(). > > > > Signed-off-by: Saravana Kannan > > --- > > drivers/interconnect/core.c | 27 ++++++++++++++++++++++++++- > > include/linux/interconnect.h | 7 +++++++ > > 2 files changed, 33 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c > > index 871eb4bc4efc..881bac80bc1e 100644 > > --- a/drivers/interconnect/core.c > > +++ b/drivers/interconnect/core.c > > @@ -47,6 +47,7 @@ struct icc_req { > > */ > > struct icc_path { > > size_t num_nodes; > > + struct opp_table *opp_table; > > I am a bit worried that these tables might be abused and size of the DT will > grow with many OPP tables of all existing paths. A ton of stuff can be abused in downstream code. We can't do anything about that. We just need to keep an eye on OPP table abuse in upstream (whether it frequency or bw OPP). > > struct icc_req reqs[]; > > }; > > > > @@ -313,7 +314,7 @@ struct icc_path *of_icc_get(struct device *dev, const char *name) > > { > > struct icc_path *path = ERR_PTR(-EPROBE_DEFER); > > struct icc_node *src_node, *dst_node; > > - struct device_node *np = NULL; > > + struct device_node *np = NULL, *opp_node; > > struct of_phandle_args src_args, dst_args; > > int idx = 0; > > int ret; > > @@ -381,10 +382,34 @@ struct icc_path *of_icc_get(struct device *dev, const char *name) > > dev_err(dev, "%s: invalid path=%ld\n", __func__, PTR_ERR(path)); > > mutex_unlock(&icc_lock); > > > > + opp_node = of_parse_phandle(np, "interconnect-opp-table", idx); > > Can't we figure out if the device OPP table contains bandwidth even without this > property? > Rob pointed out that the property isn't necessary because the device binding should document which OPP table is used for what. That takes care of my main concern of how do we know which OPP table is for what path. So I'm dropping this patch. -Saravana