Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1134933yba; Thu, 18 Apr 2019 16:05:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5Sq468jgpEH9eYpRRfOfm9S08QNFD3ogZHqGHgUjgJyE7CkQQbbSZA9kXWMAkscpTcqYM X-Received: by 2002:a63:7d03:: with SMTP id y3mr599791pgc.8.1555628731673; Thu, 18 Apr 2019 16:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555628731; cv=none; d=google.com; s=arc-20160816; b=IHxY82HpnHHqhuVJZs5gT+DS5ORm91o/U6la0Vr+SNe3MArW+k8GECzPcljFYUeXG+ ApllLG18gpaZ1VqPWNbdkTNnXGEWVTJ72HKLSro5i7gKd6uF0hqQxwPi2Mrzl4Q2yUeR lbQ4CY5YGpg3PjOX0RccY3o2CPDT7XaUZE2Vrb7Z/Tg66AazRQ9D1Dr8S3VfeLXnRibL yvGc4gdqs1xs4cJAwhoiFxYQb9pl56hcIWLi0VjwU91piKaXGNIFeOT2HZKC3oAXqOCB ZMBDx0F+mrf8TZH7wUa7VP1BVmOIAiKMBHgbKgiaQE0dQiITOlkOwjMowB659+yqoF5o 6oVQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bIwZNepkZcafS+Ng1sIJ4koMH/C8FpxZ1rR7ZlajLIo=; b=EJmiGHXbWUFPsQczpoE2WKjnZpAL53HRWd95bj1rO3RlHNMQAXObTsYRGfH7Fv2LhB kuP0yfZ/TCybxHIibcx+fTcvU4GTh7IGrRo3ZG2VvRg9pEZXbSWf6O+t+urZptpEi9qT +G2FICWJ3FNOJcXdd5ZkdjuPsvkkcQ7szucDPhrWfoZoHxEjIhrKGn2udLOH8nN9qHf+ mEC5G93PZHP4+P68IJkbbga5DgzKYaiGHotfVsXto/F7OU8Mhy1XarF5lKJ4hAhUXQxX Z95nFy490uk8jgU2NNOsaj5ko5N8klWXXf3bNqLTjmMfMODR7CpzwVO0K9XPm6Uiqpmo 7NpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="G/1gTLai"; 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 q1si3298973pgh.396.2019.04.18.16.05.09; Thu, 18 Apr 2019 16:05:31 -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=@linaro.org header.s=google header.b="G/1gTLai"; 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 S1726069AbfDRXC6 (ORCPT + 99 others); Thu, 18 Apr 2019 19:02:58 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42472 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfDRXC5 (ORCPT ); Thu, 18 Apr 2019 19:02:57 -0400 Received: by mail-pg1-f194.google.com with SMTP id p6so1835249pgh.9 for ; Thu, 18 Apr 2019 16:02:57 -0700 (PDT) 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=bIwZNepkZcafS+Ng1sIJ4koMH/C8FpxZ1rR7ZlajLIo=; b=G/1gTLaiw/xumtLmXzgDeQ80a2DT3YeDeCy1LeDRzgS1vothcQgfRHKAnG6pLb79MQ pgLmklO1IMt0r+YPJvXQVTavBbggtBAwAGC1EECInlX9Vm7bBBSFaay9KHwNup7o6hew xhhn/pDZnIZMr/236Rb7GmKaNzize3p7X2gpFOnv9aGhaemsAwd7J5ei0+2pw/0TZ6w0 PBk6V4/rT4NSnl762uLLpuXoDlt5z2AxKr090HYrbUxA2TS0LeMANvY/I2us9Oio8teE ozhZ4RdqKulFc+ETItJGAkQ1+k61CNmTqz6j3eMO/T+cI7oiaBoKWWX7lZA+ero1p+YO U+NA== 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=bIwZNepkZcafS+Ng1sIJ4koMH/C8FpxZ1rR7ZlajLIo=; b=qDDswQm/eC/VeNbX/jTdMxDKxqkuQGeXHBlYIBAqcUw31AON6/DdoSEDpgxLFiT2a6 H/OUJqOmNnpiiQM8Y3MK/v8qBJcJ9Aj9bUlX+kOmJk63GDLuBmXMauGSr2Sd2XoBgvBs 7Exf8v4PXNQJ0hMX7qvU4vU1wNqMfEVNMMJWTZSi0kOyzYtbf09tCk0KLn9sTKkFCC7q MrI6v1YarIWs9Xa6cKbptl9X/nPU6RMjOhbsiGsbCJ+vlge4wND7f2+bJjQwyd9RtYQI xpGQuxLUhNXRmE3MgwqIkgu4AB0yP2BA7M0/mpQgPHOI4P52zDvgjUjP3m6c+RFGstA5 TzJA== X-Gm-Message-State: APjAAAXo0a5aL+R/iXYdL5Wg1A3sO++6wrZ/q4laNGbe1tnaC6d0YDgL 5uJSUwVte76eZ2WdKQEiisxnaw== X-Received: by 2002:aa7:8284:: with SMTP id s4mr246400pfm.235.1555628576166; Thu, 18 Apr 2019 16:02:56 -0700 (PDT) Received: from builder (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id d20sm4156327pfo.77.2019.04.18.16.02.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Apr 2019 16:02:55 -0700 (PDT) Date: Thu, 18 Apr 2019 16:02:53 -0700 From: Bjorn Andersson To: Georgi Djakov Cc: robh+dt@kernel.org, vkoul@kernel.org, evgreen@chromium.org, daidavid1@codeaurora.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v2 2/4] interconnect: qcom: Add QCS404 interconnect provider driver Message-ID: <20190418230253.GO27005@builder> References: <20190415104357.5305-1-georgi.djakov@linaro.org> <20190415104357.5305-3-georgi.djakov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190415104357.5305-3-georgi.djakov@linaro.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 15 Apr 03:43 PDT 2019, Georgi Djakov wrote: > diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c [..] > +#define QCS404_MASTER_AMPSS_M0 0 > +#define QCS404_MASTER_GRAPHICS_3D 1 > +#define QCS404_MASTER_MDP_PORT0 2 > +#define QCS404_SNOC_BIMC_1_MAS 3 > +#define QCS404_MASTER_TCU_0 4 > +#define QCS404_MASTER_SPDM 5 > +#define QCS404_MASTER_BLSP_1 6 > +#define QCS404_MASTER_BLSP_2 7 > +#define QCS404_MASTER_XM_USB_HS1 8 > +#define QCS404_MASTER_CRYPTO_CORE0 9 > +#define QCS404_MASTER_SDCC_1 10 > +#define QCS404_MASTER_SDCC_2 11 > +#define QCS404_SNOC_PNOC_MAS 12 > +#define QCS404_MASTER_QPIC 13 > +#define QCS404_MASTER_QDSS_BAM 14 > +#define QCS404_BIMC_SNOC_MAS 15 > +#define QCS404_PNOC_SNOC_MAS 16 > +#define QCS404_MASTER_QDSS_ETR 17 > +#define QCS404_MASTER_EMAC 18 > +#define QCS404_MASTER_PCIE 19 > +#define QCS404_MASTER_USB3 20 > +#define QCS404_PNOC_INT_0 21 > +#define QCS404_PNOC_INT_2 22 > +#define QCS404_PNOC_INT_3 23 > +#define QCS404_PNOC_SLV_0 24 > +#define QCS404_PNOC_SLV_1 25 > +#define QCS404_PNOC_SLV_2 26 > +#define QCS404_PNOC_SLV_3 27 > +#define QCS404_PNOC_SLV_4 28 > +#define QCS404_PNOC_SLV_6 29 > +#define QCS404_PNOC_SLV_7 30 > +#define QCS404_PNOC_SLV_8 31 > +#define QCS404_PNOC_SLV_9 32 > +#define QCS404_PNOC_SLV_10 33 > +#define QCS404_PNOC_SLV_11 34 > +#define QCS404_SNOC_QDSS_INT 35 > +#define QCS404_SNOC_INT_0 36 > +#define QCS404_SNOC_INT_1 37 > +#define QCS404_SNOC_INT_2 38 > +#define QCS404_SLAVE_EBI_CH0 39 > +#define QCS404_BIMC_SNOC_SLV 40 > +#define QCS404_SLAVE_SPDM_WRAPPER 41 > +#define QCS404_SLAVE_PDM 42 > +#define QCS404_SLAVE_PRNG 43 > +#define QCS404_SLAVE_TCSR 44 > +#define QCS404_SLAVE_SNOC_CFG 45 > +#define QCS404_SLAVE_MESSAGE_RAM 46 > +#define QCS404_SLAVE_DISPLAY_CFG 47 > +#define QCS404_SLAVE_GRAPHICS_3D_CFG 48 > +#define QCS404_SLAVE_BLSP_1 49 > +#define QCS404_SLAVE_TLMM_NORTH 50 > +#define QCS404_SLAVE_PCIE_1 51 > +#define QCS404_SLAVE_EMAC_CFG 52 > +#define QCS404_SLAVE_BLSP_2 53 > +#define QCS404_SLAVE_TLMM_EAST 54 > +#define QCS404_SLAVE_TCU 55 > +#define QCS404_SLAVE_PMIC_ARB 56 > +#define QCS404_SLAVE_SDCC_1 57 > +#define QCS404_SLAVE_SDCC_2 58 > +#define QCS404_SLAVE_TLMM_SOUTH 59 > +#define QCS404_SLAVE_USB_HS 60 > +#define QCS404_SLAVE_USB3 61 > +#define QCS404_SLAVE_CRYPTO_0_CFG 62 > +#define QCS404_PNOC_SNOC_SLV 63 > +#define QCS404_SLAVE_APPSS 64 > +#define QCS404_SLAVE_WCSS 65 > +#define QCS404_SNOC_BIMC_1_SLV 66 > +#define QCS404_SLAVE_OCIMEM 67 > +#define QCS404_SNOC_PNOC_SLV 68 > +#define QCS404_SLAVE_QDSS_STM 69 > +#define QCS404_SLAVE_CATS_128 70 > +#define QCS404_SLAVE_OCMEM_64 71 > +#define QCS404_SLAVE_LPASS 72 An enum would probably be cleaner, given that the actual values are not significant. [..] > +static int qnoc_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + const struct qcom_icc_desc *desc; > + struct icc_onecell_data *data; > + struct icc_provider *provider; > + struct qcom_icc_node **qnodes; > + struct qcom_icc_provider *qp; > + struct icc_node *node; > + size_t num_nodes, i; > + int ret; > + > + rpm = dev_get_drvdata(dev->parent); > + if (!rpm) { > + dev_err(dev, "unable to retrieve handle to RPM\n"); > + return -ENODEV; > + } In line with my feedback on the DT binding I would prefer if this driver deals with the devices on the mmio/soc bus and you move the SMD/RPM part to a separate driver - then perform the SMD/RPM operation by calling into the other driver. Given how much of this driver is platforms specific then I think it's a pretty clean split for adding further (SMD/RPM based) platforms. Except for the decision on where in the device tree this sits I think the implementation looks good now! Regards, Bjorn