Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp177424ybv; Wed, 19 Feb 2020 18:58:40 -0800 (PST) X-Google-Smtp-Source: APXvYqyL8sSlpgJkqaVX+AKO+Hczh3wBLTu2J072ncVqtW+LwJqoEydtGCrvO6jzaatISeQlFStI X-Received: by 2002:a54:4195:: with SMTP id 21mr576993oiy.92.1582167520730; Wed, 19 Feb 2020 18:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582167520; cv=none; d=google.com; s=arc-20160816; b=UdWzNjZlZpmYe4lzk3uGc6SfTGu8/lnPFTsyOt0dmq+/Jqy6UVJWyXvs8ttKiaKC5R zYf0GGX8SXQraY6HYccBtY4Ey+wC9MEeCDx0fZdV+er6etZcHXcqFQTktgSEqhH19UJE 90Yv247OLNrRl1dzW5YY83lWStAnfmCpKWYSZWUa0ty645XIMai+fL1HAJ0Be92W0eBN ebYmZ+3r1pC8oEOgtrjROdhYcjWI+kTYn0J/nBQziWbufFjNHLDMMix6tl54nLEZg5vM 4G3jbJLsJ++7RUWWQKLPRDsNKVrXFtVJEQcWDd2lwKwMix+GxleNf3DViEUSahQSzWej YL6g== 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=9u8BlgWrFHwG4Ht6CWfv3d3zqguh9fPrghJWyshx0+Y=; b=ON3xpWtzszFlmZKZ5+HEh8/SB15PTqX/efTk8I4s+tnGtTrq1CfT7gYL7FJN+qAKcb AAEyx7WmJ4KOpy1dHyAQIM3h7x6KxHQOfTyuhQGhjemmQf3U5lqJRhye/kMuk0IEDHBt rgro91xfaJEUd6zOsdTpq/qtdzqtE3xDAf6QfSIFsom71k67VnAEivdYRVhynBuZ709k TwkKxMwDlEOwEHF9o4Fnfk+GhRdNH+uaV/E+N4T2o9eErx9zhgtag9ODDp3x3rBYI/cq jUjaEmWC+eC4DQH3FwBJllnTgHYsgVA38w1F0Zk9gy5Fab+Q3W8vVTaDPFTsLmJjbKpL 13PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=LIoI+Ne1; 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 d8si944366oti.306.2020.02.19.18.58.29; Wed, 19 Feb 2020 18:58:40 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=LIoI+Ne1; 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 S1728011AbgBTC6N (ORCPT + 99 others); Wed, 19 Feb 2020 21:58:13 -0500 Received: from mail27.static.mailgun.info ([104.130.122.27]:58776 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727944AbgBTC6K (ORCPT ); Wed, 19 Feb 2020 21:58:10 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1582167489; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=9u8BlgWrFHwG4Ht6CWfv3d3zqguh9fPrghJWyshx0+Y=; b=LIoI+Ne1t7akHbK8nAo9jwkC3E6deFg/S8RlzquekuBG4RKOSIRMIIqZHUfKka3mcbs8HP8n CZ6o3OD/MvHv/Wlgmf/P2va6zgnCIe4X1mlwxxYNFSPo2p7ZJ7ehVVpc8Gr1Llt+aoMPxHpy 5xGXz3CqUYiDsFYhDFTkp243gNY= X-Mailgun-Sending-Ip: 104.130.122.27 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 5e4df5b4.7fcf295124c8-smtp-out-n02; Thu, 20 Feb 2020 02:57:56 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id F279AC4479D; Thu, 20 Feb 2020 02:57:55 +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, URIBL_BLOCKED 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 E6962C43383; Thu, 20 Feb 2020 02:57:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E6962C43383 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 4/6] drivers: remoteproc: Add name field for every subdevice Date: Wed, 19 Feb 2020 18:57:43 -0800 Message-Id: <1582167465-2549-5-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582167465-2549-1-git-send-email-sidgup@codeaurora.org> References: <1582167465-2549-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..5d59538 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -58,6 +58,7 @@ void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink) glink->dev = dev; glink->subdev.start = glink_subdev_start; glink->subdev.stop = glink_subdev_stop; + glink->subdev.name = kstrdup("glink", GFP_KERNEL); rproc_add_subdev(rproc, &glink->subdev); } @@ -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); } @@ -154,6 +156,7 @@ void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd) smd->dev = dev; smd->subdev.start = smd_subdev_start; smd->subdev.stop = smd_subdev_stop; + smd->subdev.name = kstrdup("smd", GFP_KERNEL); rproc_add_subdev(rproc, &smd->subdev); } @@ -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 e2eaba9..e2f60cc 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -519,6 +519,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 @@ -527,6 +528,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