From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Chen-Yu Tsai <wenst@chromium.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Tinghan Shen <tinghan.shen@mediatek.com>
Subject: Re: [PATCH] remoteproc: mtk_scp: Only populate devices SCP cores
Date: Thu, 5 Dec 2024 09:47:42 -0700 [thread overview]
Message-ID: <Z1HZLq4iJQGmKDgM@p14s> (raw)
In-Reply-To: <20241202062826.66619-1-wenst@chromium.org>
Good day,
On Mon, Dec 02, 2024 at 02:28:25PM +0800, Chen-Yu Tsai wrote:
> When multi-core SCP support was added, the driver was made to populate
> platform devices for all the sub-nodes. This ended up adding platform
> devices for the rpmsg sub-nodes as well, which never actually get used,
> since rpmsg devices are registered through the rpmsg interface.
>
> Limit of_platform_populate() to just populating the SCP cores with a
> compatible string match list.
>
> Fixes: 1fdbf0cdde98 ("remoteproc: mediatek: Probe SCP cluster on multi-core SCP")
> Cc: Tinghan Shen <tinghan.shen@mediatek.com>
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> ---
> drivers/remoteproc/mtk_scp.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 0f4a7065d0bd..8206a1766481 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -1326,6 +1326,11 @@ static int scp_cluster_init(struct platform_device *pdev, struct mtk_scp_of_clus
> return ret;
> }
>
> +static const struct of_device_id scp_core_match[] = {
> + { .compatible = "mediatek,scp-core" },
> + {}
> +};
> +
> static int scp_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> @@ -1357,13 +1362,15 @@ static int scp_probe(struct platform_device *pdev)
> INIT_LIST_HEAD(&scp_cluster->mtk_scp_list);
> mutex_init(&scp_cluster->cluster_lock);
>
> - ret = devm_of_platform_populate(dev);
> + ret = of_platform_populate(dev_of_node(dev), scp_core_match, NULL, dev);
> if (ret)
> return dev_err_probe(dev, ret, "Failed to populate platform devices\n");
>
> ret = scp_cluster_init(pdev, scp_cluster);
> - if (ret)
> + if (ret) {
> + of_platform_depopulate(dev);
> return ret;
> + }
>
> return 0;
> }
> @@ -1379,6 +1386,7 @@ static void scp_remove(struct platform_device *pdev)
> rproc_del(scp->rproc);
> scp_free(scp);
> }
> + of_platform_depopulate(&pdev->dev);
This looks like a sensible addition to me but I'll give Angelo some time to
chime in.
Regards,
Mathieu
> mutex_destroy(&scp_cluster->cluster_lock);
> }
>
> --
> 2.47.0.338.g60cca15819-goog
>
prev parent reply other threads:[~2024-12-05 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 6:28 [PATCH] remoteproc: mtk_scp: Only populate devices SCP cores Chen-Yu Tsai
2024-12-02 6:55 ` Chen-Yu Tsai
2024-12-05 16:47 ` Mathieu Poirier [this message]
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=Z1HZLq4iJQGmKDgM@p14s \
--to=mathieu.poirier@linaro.org \
--cc=andersson@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=tinghan.shen@mediatek.com \
--cc=wenst@chromium.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.