Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7047290ybi; Thu, 13 Jun 2019 08:41:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcIMTbRemZqYHs7WGKItHZBmyGyU4RrcXmgaJdg2K/YwVGjVR7Xo3ethSM3rjLMFwAoiXz X-Received: by 2002:a17:90a:2305:: with SMTP id f5mr6566196pje.128.1560440472322; Thu, 13 Jun 2019 08:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560440472; cv=none; d=google.com; s=arc-20160816; b=QWh7An0i65u1HKD3tAamz9F31P8GIje9NvQrg4xprjwX0KOYHvkb2wW3QZ66JGgtpK nj9nqBKEN4g5d7k8etV8/XGihWcke4KPlncaUu48oTpqIH6IZUvQH37FIaDlCGQ5r49a Xx++T+hJh/J1zoOvrQjswjzQDYalz68G2p9dfKYOJnBRD48bDGa1+pNePJXjgKOC9Gxt R5S8RcwVV9xYq+JNLC6XalPhRRnaL6IrC3HjsxwWqEobunogfH9TCk8dC3Snw8huIp9d z9yxIkVLRWrxxZaRPh2Qah5bwZesDYfsOpZtQhBfRI/OtK/i1msPwW5ZYKB03Qa0ThW6 4Jjw== 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=BtWWHY6GZ+irdemUSJWfYrXBvNRLu0hF7sjwfuTufnI=; b=NsyOeJLgsml7wcztNHgTrXTt8q1xcwhp2ek99na2BQYhp/NYGEz9+gtqR6xgjT9hqR Va1FdwbvfXFL6dlZNwRx/6ALccUeqKncmu5KaD/u6hfzwKu28Hgd4o43JRtxG3rvzbNJ bcSHszEMYouFXT1GQO+VXsaArFQDmDUB2CurHSnxwgaSHVCBwI5G45xXS0KNgTQsfpAI Cb3D7al6NVSyUMb7ppMHQ2ThE5JV143eUF+Z0sh0NgDTTdvpRUU8wFIi9QB9MV3A7XXu JI6Z4UAT7UBACTHKJYGsKsVdZhM6bpFSdo3dJ1UkJFZ/1p5QGurhLfZdF6VO/2uBOeHM r7Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aNrHcY49; 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 y6si78551pgg.386.2019.06.13.08.40.57; Thu, 13 Jun 2019 08:41:12 -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=aNrHcY49; 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 S1728665AbfFMPkU (ORCPT + 99 others); Thu, 13 Jun 2019 11:40:20 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34206 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388619AbfFMPkF (ORCPT ); Thu, 13 Jun 2019 11:40:05 -0400 Received: by mail-pg1-f195.google.com with SMTP id p10so5319135pgn.1 for ; Thu, 13 Jun 2019 08:40:05 -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=BtWWHY6GZ+irdemUSJWfYrXBvNRLu0hF7sjwfuTufnI=; b=aNrHcY49yqaTJyE6Q+tcq+ByCZETc9h8PDkWq0+W++gEKy7j2NPlZU6hV1EbcwU5JD syMpCXwkWs5TvSjhBj0dlJ8OXOaPSIsvf+OeD+GtfT3U268ILHAHQv/IX5IenGtrARRe mw+Ixy3ns7L4JoriCdM9WDixKKSjBC1QwWOzr04uPPGdniZZ20O9mJrXgTFfJEgih5Gq xsZhXhsh3x6OiapwDDjUOYQy93/jGkxq9tl2mVQ9P8CLhEp+jPdJrfN163CeRm/3rsoz TFjq6hvlCZNEg2z5CsU7QsTd45nxBa2cAmJybVe9j+wsW1GqeFwLtlvc1VgptDh06dal us+g== 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=BtWWHY6GZ+irdemUSJWfYrXBvNRLu0hF7sjwfuTufnI=; b=gavhkDGls9JA78IajtGI6UcGWKlQiAdmVVl15edngqK8hsMhkxP17qRAgkXah6SCFy tSp+f4yEmikUr2AdzY9BT8magCAEGEjVafI5wPwFqVRO97USUSBbEIVlg1JUe1r4w4Pp e5BUjXt2A47ntTaDk44PNY/X6lmpjDq3eMeZ3GsmKvYwkm6y+4caEw6yAeZpeDwilxGw vgXKsRGnBlqsDccJK9Qx0SZTBGPmHwBrMjgiLUEAkXmhrg4JV8TOR44zR4OBClXYqdDU EqMUhrk74GEyB3gekaitflXDU1KDjOYa7/zpKcjtks48u5zzLMPeS4xRerbpi3ETqPFW qOgA== X-Gm-Message-State: APjAAAUUndCvDQLIwVfWSv0yNFjwyuGVpXP9IsnacU4J14n+sV0TwDS9 IlWbXaOyOR3//iL6lXKRt7+PAg== X-Received: by 2002:aa7:8083:: with SMTP id v3mr15241596pff.69.1560440405094; Thu, 13 Jun 2019 08:40:05 -0700 (PDT) Received: from builder (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id u20sm54807pfm.145.2019.06.13.08.40.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 08:40:04 -0700 (PDT) Date: Thu, 13 Jun 2019 08:40:02 -0700 From: Bjorn Andersson To: Georgi Djakov Cc: robh+dt@kernel.org, agross@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 v4 2/5] soc: qcom: smd-rpm: Create RPM interconnect proxy child device Message-ID: <20190613154002.GH6792@builder> References: <20190613151323.10850-1-georgi.djakov@linaro.org> <20190613151323.10850-3-georgi.djakov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190613151323.10850-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 Thu 13 Jun 08:13 PDT 2019, Georgi Djakov wrote: > Register a platform device to handle the communication of bus bandwidth > requests with the remote processor. The interconnect proxy device is part > of this remote processor (RPM) hardware. Let's create a icc-smd-rpm proxy > child device to represent the bus throughput functionality that is provided > by the RPM. > Reviewed-by: Bjorn Andersson > Signed-off-by: Georgi Djakov > --- > > v4: > - Return error if platform_device_register_data() fails > - Remove platform_set_drvdata() on the child device. > > v3: > - New patch. > > drivers/soc/qcom/smd-rpm.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/soc/qcom/smd-rpm.c b/drivers/soc/qcom/smd-rpm.c > index fa9dd12b5e39..34cdd638a6c1 100644 > --- a/drivers/soc/qcom/smd-rpm.c > +++ b/drivers/soc/qcom/smd-rpm.c > @@ -19,12 +19,14 @@ > /** > * struct qcom_smd_rpm - state of the rpm device driver > * @rpm_channel: reference to the smd channel > + * @icc: interconnect proxy device > * @ack: completion for acks > * @lock: mutual exclusion around the send/complete pair > * @ack_status: result of the rpm request > */ > struct qcom_smd_rpm { > struct rpmsg_endpoint *rpm_channel; > + struct platform_device *icc; > struct device *dev; > > struct completion ack; > @@ -193,6 +195,7 @@ static int qcom_smd_rpm_callback(struct rpmsg_device *rpdev, > static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) > { > struct qcom_smd_rpm *rpm; > + int ret; > > rpm = devm_kzalloc(&rpdev->dev, sizeof(*rpm), GFP_KERNEL); > if (!rpm) > @@ -205,11 +208,23 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) > rpm->rpm_channel = rpdev->ept; > dev_set_drvdata(&rpdev->dev, rpm); > > - return of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); > + rpm->icc = platform_device_register_data(&rpdev->dev, "icc_smd_rpm", -1, > + NULL, 0); > + if (IS_ERR(rpm->icc)) > + return PTR_ERR(rpm->icc); > + > + ret = of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); > + if (ret) > + platform_device_unregister(rpm->icc); > + > + return ret; > } > > static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev) > { > + struct qcom_smd_rpm *rpm = dev_get_drvdata(&rpdev->dev); > + > + platform_device_unregister(rpm->icc); > of_platform_depopulate(&rpdev->dev); > } >