Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4578278ybl; Wed, 22 Jan 2020 00:22:30 -0800 (PST) X-Google-Smtp-Source: APXvYqww8uHzVKzEL+tPhbjb93dy7xQ46DAUcTI1DJOwWXCn7CzaPq70nAbZfUS20A3dSStxyWn2 X-Received: by 2002:aca:458:: with SMTP id 85mr6294149oie.56.1579681350236; Wed, 22 Jan 2020 00:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579681350; cv=none; d=google.com; s=arc-20160816; b=e4dkigzwCdMqY7oqeyyJ9YtLxQHcZAc4bL19lKbZUzYMCphUkzomSrX4i4Mgy4CNRM O/Tz/1Z7fEDUxtYtikxlHWfyB5mUG24huY/h7IlUG2Nepjg1cWww+gfNGURVyA8nHZRa p65dE4b+hz2d/4ysb9pNmwg0zMo6agM/tEjDY4rId2c3ShMcY4hHv3/9A69QkZMEhYFS PjrcKcBEovq9+QLslBfhFs9GsjA/KyNZ33jfz3C7aJPZny7Ck22zwLDmKsuQ1wHdBD+H WXBApqVQEf0owBP9AHBr/81V95pLflSaf/0fqWw6B6K4AS2BkgDdQOP9T6kD+1gr+Fon 8zcA== 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=M+iOlDTH3ew9FlBT8LllWQrwpgclA7C5MSbbYFNG6t0=; b=mW14urZafvcpgaC+EnGlIVOBGE8yvHVjL7GnJuKx7Qtoz6Mi5Q1TEmM0KJqtnHIbMW LAaLa1W/6J1Z3lE0bx2mvKF/E8GcfzQTfesnCaEk7HVWbGbYyCisjVOI57uM3n3vq/k3 bDWPR46BU2i/pa5o/vVvxq0qFh37Zbt1xvV8TGaXdXya2YGccrT0N6ZuNnJtkNGmkEu+ XUnGxT+DqxIAjniGpydicolgJRhUoQdRS3tRqKJqrI4urNBcrpPOZjYeS9RkL682ZmyO jxQdfBltZK/TfP4VMyhFk8Swu6GZORXK+B+4W1e2N5uZ0/v+vnno0pFJiriK505vlyaJ dkDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r2bIq1DK; 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 i17si11914456otr.14.2020.01.22.00.22.16; Wed, 22 Jan 2020 00:22:30 -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=r2bIq1DK; 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 S1729140AbgAVIUE (ORCPT + 99 others); Wed, 22 Jan 2020 03:20:04 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36775 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729108AbgAVIUD (ORCPT ); Wed, 22 Jan 2020 03:20:03 -0500 Received: by mail-wm1-f65.google.com with SMTP id p17so6152639wma.1 for ; Wed, 22 Jan 2020 00:20:01 -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=M+iOlDTH3ew9FlBT8LllWQrwpgclA7C5MSbbYFNG6t0=; b=r2bIq1DKmQiUPmT41X6TDYq4i6tmVUjwmxNm0uuwSbeHCz2ACOktDXUiJG2zZYqJ9y 3g3FQRJk8CuD6VceKXeYIavP5D8Wy8NNhuopNYauZsS5DQJ07PMGupr4yuftpf0shcbt RbxhotiKll1zyVtETV4J1ejviHIaLihWA0z0paqojTBy4QnOrskzeSWL4qbT+A+tCcao dS0UK0h2IHji3vkKRQzj1I/QXTfCOTp8pdehCNgmVO1pxWe7vEIYBnhEuiIinqJHMR/a NF137O6cOdxbGKd70wjUBFv3dUvPDyiUvuOq4wOW1UqMIW+Qck2XDr+ZeHeGm6h2BPjl SJfA== 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=M+iOlDTH3ew9FlBT8LllWQrwpgclA7C5MSbbYFNG6t0=; b=fKAO0gwSlmtdfNgJaDdsmKh0ZfG+3V8lk/4C3LhJVWuNH+tCpG8+OxbUzpx2gdit3b YSthaLbsFVZLtLZbg7nCAGSCujwrUjflN5D08L1S2685Qoe8vj6qbFrwSpuhM9cJ3kdM ayZn74UPGHr32VkyyMlis0/UbWeScyw9L//hE6g+eElL/nuEFRssBpdA5pac/7msSE5L qLpSHpiXj4DZ06JCxQWxvgfwHjYPn3gyNu5pjoaHyrt8gLDQf1ITDadO4HzwndQPziVh tn3UjTvJKEdpjHnZr36mu3aF910DvmdsbjEyCWEIkXr0YLPkwNpgVH0H5m+zlY3L4qdz iHUg== X-Gm-Message-State: APjAAAXkbvSo0QOsqORV2g9ntJrj/rRUMVkakYflQSjZOHy2n45A5CPp lWS8LjNhtCcZhUy1jFRTeMNtCQ== X-Received: by 2002:a05:600c:108a:: with SMTP id e10mr1603881wmd.38.1579681201241; Wed, 22 Jan 2020 00:20:01 -0800 (PST) Received: from [10.44.66.8] ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a9sm2739774wmm.15.2020.01.22.00.20.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jan 2020 00:20:00 -0800 (PST) Subject: Re: [PATCH v4 2/4] interconnect: qcom: Add OSM L3 interconnect provider support To: Sibi Sankar , Evan Green 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: <20200109211215.18930-1-sibis@codeaurora.org> <20200109211215.18930-3-sibis@codeaurora.org> 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 ASMfXhfywB0tXRNmzsywdxQFcJ6jblPNxscnGMh2VlY2rezmqJdcK4G4Lprkc0jOHotV/6oJ mj9h95Ouvbq5TDHx+ER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wZmj 7ayYJIXFqjl/X0KBcCbiAl4vbdBw1bqFnO4zd1lMXKVoa29UHqby4MPbQhjWNVv9kqp8A39+ E9xw890l1xdERkjVKX6IEJu2hf7X3MMl9tOjBK6MvdOUxvh1bNNmXh7OlBL1MpJYY/ydIm3B KEmKjLDvB0pePJkdTw== Message-ID: <03f83755-bdcc-dc39-0eae-08414751be57@linaro.org> Date: Wed, 22 Jan 2020 10:19:58 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/20 08:45, Sibi Sankar wrote: > Hey Evan, > > Thanks for the review! > > On 2020-01-22 03:03, Evan Green wrote: >> On Thu, Jan 9, 2020 at 1:12 PM 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 on SDM845 SoCs. >>> >>> Signed-off-by: Sibi Sankar >>> --- >>>  drivers/interconnect/qcom/Kconfig  |   7 + >>>  drivers/interconnect/qcom/Makefile |   2 + >>>  drivers/interconnect/qcom/osm-l3.c | 267 +++++++++++++++++++++++++++++ >>>  3 files changed, 276 insertions(+) >>>  create mode 100644 drivers/interconnect/qcom/osm-l3.c >>> >>> diff --git a/drivers/interconnect/qcom/Kconfig >>> b/drivers/interconnect/qcom/Kconfig >>> index a9bbbdf7400f9..b94d28e7bf700 100644 >>> --- a/drivers/interconnect/qcom/Kconfig >>> +++ b/drivers/interconnect/qcom/Kconfig >>> @@ -14,6 +14,13 @@ config INTERCONNECT_QCOM_MSM8974 >>>          This is a driver for the Qualcomm Network-on-Chip on msm8974-based >>>          platforms. >>> >>> +config INTERCONNECT_QCOM_OSM_L3 >>> +       tristate "Qualcomm OSM L3 interconnect driver" >>> +       depends on INTERCONNECT_QCOM || COMPILE_TEST >>> +       help >>> +         Say y here to support the Operating State Manager (OSM) interconnect >>> +         driver which controls the scaling of L3 caches on Qualcomm SoCs. >>> + >>>  config INTERCONNECT_QCOM_QCS404 >>>         tristate "Qualcomm QCS404 interconnect driver" >>>         depends on INTERCONNECT_QCOM >>> diff --git a/drivers/interconnect/qcom/Makefile >>> b/drivers/interconnect/qcom/Makefile >>> index 55ec3c5c89dbd..89fecbd1257c7 100644 >>> --- a/drivers/interconnect/qcom/Makefile >>> +++ b/drivers/interconnect/qcom/Makefile >>> @@ -1,5 +1,6 @@ >>>  # SPDX-License-Identifier: GPL-2.0 >>> >>> +icc-osm-l3-objs                                := osm-l3.o >>>  qnoc-msm8974-objs                      := msm8974.o >>>  qnoc-qcs404-objs                       := qcs404.o >>>  qnoc-sc7180-objs                       := sc7180.o >>> @@ -12,6 +13,7 @@ icc-smd-rpm-objs                      := smd-rpm.o >>>  obj-$(CONFIG_INTERCONNECT_QCOM_BCM_VOTER) += icc-bcm-voter.o >>>  obj-$(CONFIG_INTERCONNECT_QCOM_MSM8916) += qnoc-msm8916.o >>>  obj-$(CONFIG_INTERCONNECT_QCOM_MSM8974) += qnoc-msm8974.o >>> +obj-$(CONFIG_INTERCONNECT_QCOM_OSM_L3) += icc-osm-l3.o >>>  obj-$(CONFIG_INTERCONNECT_QCOM_QCS404) += qnoc-qcs404.o >>>  obj-$(CONFIG_INTERCONNECT_QCOM_RPMH) += icc-rpmh.o >>>  obj-$(CONFIG_INTERCONNECT_QCOM_SC7180) += qnoc-sc7180.o >>> diff --git a/drivers/interconnect/qcom/osm-l3.c >>> b/drivers/interconnect/qcom/osm-l3.c >>> new file mode 100644 >>> index 0000000000000..7fde53c70081e >>> --- /dev/null >>> +++ b/drivers/interconnect/qcom/osm-l3.c >>> @@ -0,0 +1,267 @@ >>> +// SPDX-License-Identifier: GPL-2.0 >>> +/* >>> + * Copyright (c) 2019, The Linux Foundation. All rights reserved. >>> + * >>> + */ >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#define LUT_MAX_ENTRIES                        40U >>> +#define LUT_SRC                                GENMASK(31, 30) >>> +#define LUT_L_VAL                      GENMASK(7, 0) >>> +#define LUT_ROW_SIZE                   32 >>> +#define CLK_HW_DIV                     2 >>> + >>> +/* Register offsets */ >>> +#define REG_ENABLE                     0x0 >>> +#define REG_FREQ_LUT                   0x110 >>> +#define REG_PERF_STATE                 0x920 >>> + >>> +#define OSM_L3_MAX_LINKS               1 >>> +#define SDM845_MAX_RSC_NODES           130 >> >> I'm nervous this define is going to fall out of date with >> qcom,sdm845.h. I'm worried someone will end up adding a few more nodes >> that were always there but previously hidden from Linux. Can we put >> this define in include/dt-bindings/interconnect/qcom,sdm845.h, so at >> least when that happens they'll come face to face with this define? >> The same comment goes for the SC7180 define in patch 4. > > Yeah both solution require manual > intervention how about we just go > with what I proposed below. > >> >> On second thought, this trick only works once. Are we sure there >> aren't going to be other drivers that might want to tag on >> interconnect nodes as well? How about instead we just add the enum >> values below in qcom,sdm845.h as defines? > > Georgi/Evan, > Since qcom,sdm845.h is specific to > bindings shouldn't I just create a > .h file with all the enums so that > it can used across all icc providers > on SDM845? This sounds good to me, unless Evan has any objections. Thanks, Georgi