From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E8B6C11D00 for ; Thu, 20 Feb 2020 02:58:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 053E52465D for ; Thu, 20 Feb 2020 02:58:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="LIoI+Ne1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728018AbgBTC6P (ORCPT ); Wed, 19 Feb 2020 21:58:15 -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) 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