From: Tanmay Shah <tanmay.shah@amd.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: andersson@kernel.org, linux-remoteproc@vger.kernel.org,
linux-kernel@vger.kernel.org, Tarak Reddy <tarak.reddy@amd.com>
Subject: Re: [PATCH v2 2/2] remoteproc: enhance rproc_put() for clusters
Date: Wed, 22 Mar 2023 10:34:57 -0700 [thread overview]
Message-ID: <830db03c-ec6e-b4aa-834a-e67622e5a41f@amd.com> (raw)
In-Reply-To: <20230322160537.GB2821487@p14s>
On 3/22/23 9:05 AM, Mathieu Poirier wrote:
> Hi Tanmay,
>
> On Tue, Mar 21, 2023 at 09:09:36PM -0700, Tanmay Shah wrote:
>> This patch enhances rproc_put() to support remoteproc clusters
>> with multiple child nodes as in rproc_get_by_phandle().
>>
>> Signed-off-by: Tarak Reddy <tarak.reddy@amd.com>
>> Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
>> ---
>> drivers/remoteproc/remoteproc_core.c | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
>> index a3e7c8798381..e7e451012615 100644
>> --- a/drivers/remoteproc/remoteproc_core.c
>> +++ b/drivers/remoteproc/remoteproc_core.c
>> @@ -2560,6 +2560,19 @@ EXPORT_SYMBOL(rproc_free);
>> void rproc_put(struct rproc *rproc)
>> {
>> module_put(rproc->dev.parent->driver->owner);
> There is something wrong here - this should have been removed.
Thanks Mathieu. Sure this needs to be fixed.
This is result of manually picking up patch from my side.
I will try to find better automated way to pick-up patches not available
on mailing list.
>
>> + struct platform_device *cluster_pdev;
>> +
>> + if (rproc->dev.parent) {
> This condition is not needed, please remove.
Ack.
>
>> + if (rproc->dev.parent->driver) {
>> + module_put(rproc->dev.parent->driver->owner);
>> + } else {
>> + cluster_pdev = of_find_device_by_node(rproc->dev.parent->of_node->parent);
>> + if (cluster_pdev) {
>> + module_put(cluster_pdev->dev.driver->owner);
>> + put_device(&cluster_pdev->dev);
I am not sure if cluster_pdev->dev should be dropped here.
Should we drop it in platform driver after rproc_free() ?
>> + }
>> + }
>> + }
> Some in-lined documentation, the way I did in patch 1/2 would be appreciated.
> Otherwize I think the above enhancement make sense.
Ack I will document in next revision.
>
> Thanks,
> Mathieu
>
>> put_device(&rproc->dev);
Also, if we decide to drop cluster->dev here then,
should we drop reference of rproc->dev before cluster->dev ?
>> }
>> EXPORT_SYMBOL(rproc_put);
>> --
>> 2.25.1
>>
next prev parent reply other threads:[~2023-03-22 17:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 4:09 [PATCH v2 0/2] remoteproc: get rproc devices for clusters Tanmay Shah
2023-03-22 4:09 ` [PATCH v2 1/2] remoteproc: Make rproc_get_by_phandle() work " Tanmay Shah
2023-03-22 4:09 ` [PATCH v2 2/2] remoteproc: enhance rproc_put() " Tanmay Shah
2023-03-22 6:20 ` kernel test robot
2023-03-22 7:31 ` kernel test robot
2023-03-22 11:52 ` Dan Carpenter
2023-03-22 16:05 ` Mathieu Poirier
2023-03-22 17:34 ` Tanmay Shah [this message]
2023-03-23 22:45 ` Mathieu Poirier
2023-03-22 14:12 ` [PATCH v2 0/2] remoteproc: get rproc devices " Bjorn Andersson
2023-03-22 16:11 ` Mathieu Poirier
2023-03-22 17:37 ` Tanmay Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=830db03c-ec6e-b4aa-834a-e67622e5a41f@amd.com \
--to=tanmay.shah@amd.com \
--cc=andersson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=tarak.reddy@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).