Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1098514ybb; Wed, 8 Apr 2020 16:38:02 -0700 (PDT) X-Google-Smtp-Source: APiQypJzXJVN8qE43qtT96Bd/zHJ2oiq+u4F4oWonHvinDgKAHNp1av/F6NqDXMVL+Zlk5X63lxE X-Received: by 2002:aca:fd48:: with SMTP id b69mr4325891oii.126.1586389082562; Wed, 08 Apr 2020 16:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586389082; cv=none; d=google.com; s=arc-20160816; b=gLBJTUD53MOZFUjQeZ6428+ciJVpOQDAVnfNG0YzN8//+iPllkzps6a+WhiI6cMmgr +y4pb0n2lL9cML458p46viKAA38Ly9UrsCHVV8jPNyHwteahM5mLOgZCX3X49M4UCGzJ ISBB/UfZJ8EwdRWjVu6YrLRLuPWIDtnW+fTKZ/vhAWgOBFxFrXSJzHViy0k7farCcPmU q8gbUmXrEJvytcKdkFRkROUs+Lqyx8s+kctpsmOc1/n3IyHZl4bOKSuiLLsV5HUSiUXa TnTRlGciNLEoW47zhEE/aRawvPy6h3HpatIQdr2UzyMNteGvvc7sTXS9fW3vuFIvfvp2 8edw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=PODbbgtVWuPslDvV4MMEBLr5qth9MTMMFxaZhWZlnyU=; b=X7dkjQGNSSvje4UNtg5qVuosAOMD6NC3qZFDqp0WxT2BfiJhHqHl7ol9YjYjjtpWaM TSoPo0oN048GENsWYeaXm9o6tn1bvsqK8m6tUJAXLlB58Wv2ybNwWJtfDkwmIsRRWjkq VHLUeK4Q0e5fdPbkPbeONPzSnZg+YT9qy7owVmotFEhItFnUonQ6pV9CkstzYAfdqL2M FzvCu+Ikk5puipAbT7gTK+9G5SXJAI7EVnmawsTal1hbC9w5ww8ZPnLY9mg1ujaQ0l8d w1+xUbFhl7HpLavnq4cxlKL4j8+gITzAv5w0lrCauQcpIbARp3hUtGq5DOM6Bi+zpvwf BVgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="Qein/CQC"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s27si3169963otg.229.2020.04.08.16.37.49; Wed, 08 Apr 2020 16:38:02 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b="Qein/CQC"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbgDHXhK (ORCPT + 99 others); Wed, 8 Apr 2020 19:37:10 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:45065 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbgDHXhJ (ORCPT ); Wed, 8 Apr 2020 19:37:09 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586389028; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=PODbbgtVWuPslDvV4MMEBLr5qth9MTMMFxaZhWZlnyU=; b=Qein/CQCTbISRboFOkKwQAku9ZhNOdrLHwW+QnCygo9DylH+LzC0a6bkJPUEXIJF0G3SEPhV X59lTpO+EyMkJRBv+GBL072Z9AlkCAokjDBARetMN93rtAYlNPV2KCjaevQAm/texTKPoiaz BOw6Rsyd2LOnKao8ysqg1qeST80= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e8e601f.7f6ee5d03298-smtp-out-n02; Wed, 08 Apr 2020 23:37:03 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 73EF8C43636; Wed, 8 Apr 2020 23:37:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from sidgup-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sidgup) by smtp.codeaurora.org (Postfix) with ESMTPSA id 59808C433F2; Wed, 8 Apr 2020 23:37:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 59808C433F2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sidgup@codeaurora.org From: Siddharth Gupta To: agross@kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com Cc: Rishabh Bhatnagar , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, Siddharth Gupta Subject: [PATCH v2 4/6] remoteproc: qcom: Add name field for every subdevice Date: Wed, 8 Apr 2020 16:36:41 -0700 Message-Id: <1586389003-26675-5-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586389003-26675-1-git-send-email-sidgup@codeaurora.org> References: <1586389003-26675-1-git-send-email-sidgup@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rishabh Bhatnagar When a client driver wishes to utilize functionality from a particular subdevice of a remoteproc, it cannot differentiate between the subdevices that have been added. This patch allows the client driver to distinguish between subdevices and thus utilize their functionality. Signed-off-by: Rishabh Bhatnagar Signed-off-by: Siddharth Gupta --- drivers/remoteproc/qcom_common.c | 6 ++++++ include/linux/remoteproc.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index 60650bc..1d2351b 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -56,6 +56,7 @@ void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink) return; glink->dev = dev; + glink->subdev.name = kstrdup("glink", GFP_KERNEL); glink->subdev.start = glink_subdev_start; glink->subdev.stop = glink_subdev_stop; @@ -73,6 +74,7 @@ void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glin if (!glink->node) return; + kfree(glink->subdev.name); rproc_remove_subdev(rproc, &glink->subdev); of_node_put(glink->node); } @@ -152,6 +154,7 @@ void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd) return; smd->dev = dev; + smd->subdev.name = kstrdup("smd", GFP_KERNEL); smd->subdev.start = smd_subdev_start; smd->subdev.stop = smd_subdev_stop; @@ -169,6 +172,7 @@ void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd) if (!smd->node) return; + kfree(smd->subdev.name); rproc_remove_subdev(rproc, &smd->subdev); of_node_put(smd->node); } @@ -220,6 +224,7 @@ void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr, const char *ssr_name) { ssr->name = ssr_name; + ssr->subdev.name = kstrdup("ssr_notifs", GFP_KERNEL); ssr->subdev.unprepare = ssr_notify_unprepare; rproc_add_subdev(rproc, &ssr->subdev); @@ -233,6 +238,7 @@ EXPORT_SYMBOL_GPL(qcom_add_ssr_subdev); */ void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr) { + kfree(ssr->subdev.name); rproc_remove_subdev(rproc, &ssr->subdev); } EXPORT_SYMBOL_GPL(qcom_remove_ssr_subdev); diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index c5d36e6..687e1eb 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -523,6 +523,7 @@ struct rproc { /** * struct rproc_subdev - subdevice tied to a remoteproc * @node: list node related to the rproc subdevs list + * @name: name of the subdevice * @prepare: prepare function, called before the rproc is started * @start: start function, called after the rproc has been started * @stop: stop function, called before the rproc is stopped; the @crashed @@ -531,6 +532,7 @@ struct rproc { */ struct rproc_subdev { struct list_head node; + char *name; int (*prepare)(struct rproc_subdev *subdev); int (*start)(struct rproc_subdev *subdev); -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project