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=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 C2FADC2BA19 for ; Wed, 15 Apr 2020 18:11:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9AB47206D9 for ; Wed, 15 Apr 2020 18:11:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Gs45V7ac" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2411710AbgDOSLr (ORCPT ); Wed, 15 Apr 2020 14:11:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2411706AbgDOSLn (ORCPT ); Wed, 15 Apr 2020 14:11:43 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ADFEC061A0F for ; Wed, 15 Apr 2020 11:11:43 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id u65so353252pfb.4 for ; Wed, 15 Apr 2020 11:11:42 -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=Hv4Gb+XU8mOj8xMFdipxFcMjlc532U8U6KOUpsFhxqY=; b=Gs45V7acM1Gg+IDEQIa8efTGGg+FVai47wUYfRNm7sgC8M3235Wdfd627OlVlKHree G/JPIqjAQoOF8XLyehNauDN4H23NKVUyIa4c6e++RGuOQusJlK5JVxRWbw3QRuUGoJqO TaD/89qJ+j7tYxgDCu/WtVuv5G/ZLBCfX9gl+AgCJXpWsj6YuJ4VaeuSXBhTKmAO2OF8 i/i5RsHx4X/GnRoq77MHKt2Ec/hYDX2QbLJFxEcAkm3pUQ/j8effzI8hR3pvnsPIcAWX Azhy1QdjR5nkInSATS1UlDa1H4dG83YYu8+8hdn/wBWZeCVW5myrBWGYSUoyIhqYnw3g qmGQ== 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=Hv4Gb+XU8mOj8xMFdipxFcMjlc532U8U6KOUpsFhxqY=; b=V4k9Fq7MfJGPkGXxb2LRuts11CO++qXVE7rEZ2c9xQ/p+/z6QywyPJbjdzSsVhTNNI spfeAKdbJmlD9Hm/zQexKFXqfy4Ulwc2mrQoaxfyS17dCIgudAStz/ULhAfSVLBhOA+J n4DHhNUtI/GXhbqaKD6iJt9xLLn6LIICAIc2QhEITe1AO1fcRtvAlArUTPN0qYR6Owp2 V/FFqgoaNjCALTC1GZRwE5tNc8tqLejz6UBWgBYGAOBzs1YZ2YNXBwkam0ZjtPA30ih7 bVt3nLBsCJQ4eE+rp6OH5QXe2GwyAZ1CQQbKRoATxLqwKvbMPSAqKSoYSOzIfuYJQRQf ZD+Q== X-Gm-Message-State: AGi0PuYkyRcsIjGRus1TSNgPYlSTgn/uMurf/HARAjogKUE0UTLNcJ1e 0/E626eAKqkyIj+FmIbBWd9HBw== X-Google-Smtp-Source: APiQypIjo5joNUHWhj8LYjKyMfT+ubnd1PrqS6lJmTvfS1amP7RXRU6Uzmg8PU7h9tURc3cv4RxdgQ== X-Received: by 2002:aa7:9625:: with SMTP id r5mr7532605pfg.256.1586974302516; Wed, 15 Apr 2020 11:11:42 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 65sm9606185pfz.211.2020.04.15.11.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 11:11:42 -0700 (PDT) Date: Wed, 15 Apr 2020 12:11:40 -0600 From: Mathieu Poirier To: Siddharth Gupta Cc: agross@kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com, 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 Subject: Re: [PATCH v2 4/6] remoteproc: qcom: Add name field for every subdevice Message-ID: <20200415181140.GF16583@xps15> References: <1586389003-26675-1-git-send-email-sidgup@codeaurora.org> <1586389003-26675-5-git-send-email-sidgup@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1586389003-26675-5-git-send-email-sidgup@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Wed, Apr 08, 2020 at 04:36:41PM -0700, Siddharth Gupta wrote: > 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 Acked-by: Mathieu Poirier > --- > 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