Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3203294ybc; Thu, 21 Nov 2019 05:02:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwrX6Xuz/xFs7qtTyQAfXytMNck1BrmAXNcypHjhES9v26ndlc5SOpkCd3NClzGbYZKD2S/ X-Received: by 2002:a17:907:447b:: with SMTP id oo19mr13289041ejb.81.1574341220269; Thu, 21 Nov 2019 05:00:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574341220; cv=none; d=google.com; s=arc-20160816; b=d21MxVm3yIeKggb2dX+ZR96o+8pravJ06h8LrsY21Gr4CQsp6qBNbuVfM2lHcRdo1y UZGkrXbjefPyyubPwqS2keU1AWY3VM+XjAJsFRCN91D9O1Kos8Bes2lRgqfx8F8USyyu WkmrFSrV3sTpvJGepOw/n17vMxJKsCvwrLkcI0jzs82c8eLgqM0RCwRONGtMkAZ6QbwD kUFlHoH1snJrQ0RyA/Z4S53smB1gDXG+VtGxxHtMTID+zk979/m+vUIGa35LdkLiSJFV CCREkSUcS3klfMQMFAtRUJO8qekumXjeaC9CM+M+iEdtHOP1+GXs2fGjUdWK6PMAYw+e kBig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature; bh=WVDdCVAVvfXUp96b+K4Bvi3DKiAcKkcFAJ8o78jw2lM=; b=b59lfGqWPYhqDzBAAF/vemwpBQx36H/eUqhR9zHjmWWbNXI8ILL9KlECKLtIamAOLX oRAxeKCguyWf/6noVZKD8TlXQ8cjxLGkCDdLDL5wd2xLoYpZhT7aG+x/RNxf7UDnOsbL oEjHo+/JcfUxG4/Gf+ZPsulMijPPHlpYsFmGBIwibFdLjr8YGlRMb+Gq87ZdRnOHgQtU fk6MQOfdCawF9mkQL/ivmuWrJoQ/cHZG6fr8L83vU4Zuk6MsCbmVQq3OTPvDt/UjVNcv GUWLsVtXRLGYeZ5/lyLYBUgG7wD74UoZEaPb9/mQdSstfa4D9hLD/eRtRhy69y2UmMo4 q3kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ic9y14j/"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g53si2141938edb.313.2019.11.21.04.59.55; Thu, 21 Nov 2019 05:00:20 -0800 (PST) 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=@linaro.org header.s=google header.b="ic9y14j/"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbfKUM6d (ORCPT + 99 others); Thu, 21 Nov 2019 07:58:33 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37398 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfKUM6c (ORCPT ); Thu, 21 Nov 2019 07:58:32 -0500 Received: by mail-wr1-f66.google.com with SMTP id t1so4311876wrv.4 for ; Thu, 21 Nov 2019 04:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WVDdCVAVvfXUp96b+K4Bvi3DKiAcKkcFAJ8o78jw2lM=; b=ic9y14j/LXfCo79jPngoZmQbRUfN0Q3R5fsdc4ajFRalLImGXWYQmf9VN++QZhsaqx qM2/JbjvBQgMiotIcd9ioWZtvcpKjXJZONp9s5TEdxJDvl4dDL5/MeWTRocuL1ON98gF 7GuWIvzHOUwc2FSe+zv7aEEIpEf8lxNcaxsJfsCWb34VlY4xHgOE05SAeE2OePqEDgmS uQvr5t8pf6ORHki3ciSn9WjMwMj249Wn642XWv5FW/O2IF+t+te65gnkyLWcXqOoyS4k 8TvX8CTp2Sx5cbeZNqF0Otat3rjY/uvM6dyXAWQAK5Lf2AtKT28X2z3v8zNhu6yc2SQ9 I5PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WVDdCVAVvfXUp96b+K4Bvi3DKiAcKkcFAJ8o78jw2lM=; b=ZBMCy8tP287WXeef2331YT5ofRbtTnQL4E74Kac6dHLCXBL9CDd2iz/KciKVELWYRq UahF6kXVTtekWc2yY7VuW8EEdOPMCiW29oXIp4GJhSHGu4D9LwgB45SMZOYRVfn0S8Du eEro/+l3cl9IBEmWc/3IfyceJHiT42aJTvSySM2pyG0f8PkhIIloWEf4RAVTGW30vRaW rP5tVtLR/Aq/nFYNfODSCpbDcWifBVQ0M0fXcO3p9nHg+dhzr/pW8riqbIDnZ+ukrGcQ STuDs/e5Kga99eHN+/PXB4AqgGpVN4PdzeN+U7bRkOsq5i0cIVRVWV32Tt4zu9kdqyZq A5DQ== X-Gm-Message-State: APjAAAU2hjwDAg5pm2VAn8jsxsN8IhQn0m3ktZYM9D9ZARXWNAL1o1pF Lui6U2b07kiye35ii9VFrc7pIg== X-Received: by 2002:adf:fecf:: with SMTP id q15mr5143405wrs.75.1574341109518; Thu, 21 Nov 2019 04:58:29 -0800 (PST) Received: from [10.44.66.8] ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id w19sm2746143wmk.36.2019.11.21.04.58.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2019 04:58:28 -0800 (PST) Subject: Re: [PATCH v3 2/2] interconnect: qcom: Add OSM L3 interconnect provider support To: Evan Green , Sibi Sankar Cc: Rob Herring , Bjorn Andersson , Andy Gross , LKML , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-arm-msm , Mark Rutland , David Dai , Saravana Kannan , Viresh Kumar References: <20191118154435.20357-1-sibis@codeaurora.org> <0101016e7f30ad15-18908ef0-a2b9-4a2a-bf32-6cb3aa447b01-000000@us-west-2.amazonses.com> From: Georgi Djakov Openpgp: preference=signencrypt Autocrypt: addr=georgi.djakov@linaro.org; prefer-encrypt=mutual; keydata= mQINBFjTuRcBEACyAOVzghvyN19Sa/Nit4LPBWkICi5W20p6bwiZvdjhtuh50H5q4ktyxJtp 1+s8dMSa/j58hAWhrc2SNL3fttOCo+MM1bQWwe8uMBQJP4swgXf5ZUYkSssQlXxGKqBSbWLB uFHOOBTzaQBaNgsdXo+mQ1h8UCgM0zQOmbs2ort8aHnH2i65oLs5/Xgv/Qivde/FcFtvEFaL 0TZ7odM67u+M32VetH5nBVPESmnEDjRBPw/DOPhFBPXtal53ZFiiRr6Bm1qKVu3dOEYXHHDt nF13gB+vBZ6x5pjl02NUEucSHQiuCc2Aaavo6xnuBc3lnd4z/xk6GLBqFP3P/eJ56eJv4d0B 0LLgQ7c1T3fU4/5NDRRCnyk6HJ5+HSxD4KVuluj0jnXW4CKzFkKaTxOp7jE6ZD/9Sh74DM8v etN8uwDjtYsM07I3Szlh/I+iThxe/4zVtUQsvgXjwuoOOBWWc4m4KKg+W4zm8bSCqrd1DUgL f67WiEZgvN7tPXEzi84zT1PiUOM98dOnmREIamSpKOKFereIrKX2IcnZn8jyycE12zMkk+Sc ASMfXhfywB0tXRNmzsywdxQFcJ6jblPNxscnGM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jnFsPsyFebzcKGbdEr6vySGa3Cof+miX06hQXKe99a5+eHNhtZJcMAIO89wZmj 7ayYJIXFqjl/X0KBcCbiAl4vbdBw1bqFnO4zd1lMXKVoa29UHqby4MPbQhjWNVv9kqp8A39+ E9xw890l1xdERkjVKX6IEJu2hf7X3MMl9tOjBK6MvdOUxvh1bNNmXh7OlBL1MpJYY/ydIm3B KEmKjLDvB0pePJkdTw== Message-ID: <534d80fb-249d-ce18-86c0-1a1bc4f98c03@linaro.org> Date: Thu, 21 Nov 2019 14:58:27 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Evan, On 11/19/19 00:42, Evan Green wrote: > Hi Sibi, > > On Mon, Nov 18, 2019 at 7:45 AM Sibi Sankar wrote: >> >> On some Qualcomm SoCs, Operating State Manager (OSM) controls the >> resources of scaling L3 caches. Add a driver to handle bandwidth >> requests to OSM L3 from CPU/GPU. >> >> Signed-off-by: Sibi Sankar >> --- >> drivers/interconnect/qcom/Kconfig | 7 + >> drivers/interconnect/qcom/Makefile | 2 + >> drivers/interconnect/qcom/osm-l3.c | 284 +++++++++++++++++++++++++++++ >> 3 files changed, 293 insertions(+) >> create mode 100644 drivers/interconnect/qcom/osm-l3.c >> [..] >> +static int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, >> + u32 peak_bw, u32 *agg_avg, u32 *agg_peak) >> +{ >> + *agg_avg += avg_bw; >> + *agg_peak = max_t(u32, *agg_peak, peak_bw); >> + >> + return 0; >> +} > > Georgi, I wonder if it's a good idea to make a small collection of > "std" aggregate functions in the interconnect core that a driver can > just point to if it's doing something super standard like this (ie > driver->aggregate = icc_std_aggregate;). This is probably fine as-is > for now, but if we see a lot more copy/pastes of this function we > should think about it. Sure, thanks for the suggestion! Will submit a patch for this. > >> + >> +static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) >> +{ [..] >> + >> +static int qcom_osm_l3_remove(struct platform_device *pdev) >> +{ >> + struct qcom_osm_l3_icc_provider *qp = platform_get_drvdata(pdev); >> + struct icc_provider *provider = &qp->provider; >> + struct icc_node *n; >> + >> + list_for_each_entry(n, &provider->nodes, node_list) { > > There was a comment on one of the other threads that we've been > copy/pasting this snippet around and it's wrong because it doesn't use > the _safe variant of the macro. So we end up destroying the list we're > iterating over. > > Georgi, did you have a plan to refactor this, or should we just change > this to be the _safe version? I have fixes that convert this to the _safe variant (for stable) and also factor this out into icc_nodes_remove() function. Will post them. Thanks, Georgi > >> + icc_node_del(n); >> + icc_node_destroy(n->id); >> + } >> + >> + return icc_provider_del(provider); >> +}