From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Xiangzhi Tang" <xiangzhi.tang@mediatek.com>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"irving.ch.lin" <irving-ch.lin@mediatek.com>,
"Vince-WL Liu (劉文龍)" <vince-wl.liu@mediatek.com>,
"Jh Hsu (許希孜)" <jh.hsu@mediatek.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
"Sirius Wang (王皓昱)" <sirius.wang@mediatek.com>
Cc: Rob Herring <robh@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
linux-remoteproc@vger.kernel.org,
Conor Dooley <conor+dt@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Jjian Zhou <Jjian.Zhou@mediatek.com>,
Hailong Fan <Hailong.Fan@mediatek.com>
Subject: Re: [PATCH v2 2/4] remoterpoc: mediatek: vcp: Add vcp remoteproc driver
Date: Sun, 14 Sep 2025 15:28:29 +0200 [thread overview]
Message-ID: <8c298465-893a-4a18-9955-4769288ec010@kernel.org> (raw)
In-Reply-To: <20250914122943.10412-3-xiangzhi.tang@mediatek.com>
On 14/09/2025 14:29, Xiangzhi Tang wrote:
> +
> +static const struct rproc_ops mtk_vcp_ops = {
> + .load = mtk_vcp_load,
> + .start = mtk_vcp_start,
> + .stop = mtk_vcp_stop,
> +};
> +
> +static int vcp_multi_core_init(struct platform_device *pdev,
> + struct mtk_vcp_of_cluster *vcp_cluster,
> + enum vcp_core_id core_id)
> +{
> + int ret;
> +
> + ret = of_property_read_u32(pdev->dev.of_node, "mtk,vcp-core-twohart",
> + &vcp_cluster->twohart[core_id]);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to twohart property\n");
> + return ret;
> + }
> + ret = of_property_read_u32(pdev->dev.of_node, "mtk,core-sram-offset",
Undocumented ABI, if you ever bothered to test your DTS you would see
clear warning.
> + &vcp_cluster->sram_offset[core_id]);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to sram-offset property\n");
> + return ret;
> + }
> +
> + return ret;
> +}
> +
> +static struct mtk_vcp_device *vcp_rproc_init(struct platform_device *pdev,
> + struct mtk_vcp_of_cluster *vcp_cluster)
> +{
> + struct device *dev = &pdev->dev;
> + struct device_node *np = dev_of_node(dev);
> + struct device_node *child;
> + struct platform_device *cpdev;
> + struct mtk_vcp_device *vcp;
> + struct rproc *rproc;
> + const struct mtk_vcp_of_data *vcp_of_data;
> + u32 core_id;
> + int ret;
> +
> + vcp_of_data = of_device_get_match_data(dev);
> + rproc = devm_rproc_alloc(dev, np->name, &mtk_vcp_ops,
> + vcp_of_data->platdata.fw_name,
> + sizeof(struct mtk_vcp_device));
> + if (!rproc) {
> + dev_err(dev, "unable to allocate remoteproc\n");
No, you never do this.
> + return ERR_PTR(-ENOMEM);
> + }
> +
> + vcp = rproc->priv;
> + vcp->rproc = rproc;
> + vcp->pdev = pdev;
> + vcp->dev = dev;
> + vcp->ops = &vcp_of_data->ops;
> + vcp->platdata = &vcp_of_data->platdata;
> + vcp->vcp_cluster = vcp_cluster;
> +
> + rproc->auto_boot = vcp_of_data->platdata.auto_boot;
> + rproc->sysfs_read_only = vcp_of_data->platdata.sysfs_read_only;
> + mutex_init(&vcp->vcp_cluster->vcp_feature_mutex);
> + mutex_init(&vcp->vcp_cluster->vcp_pw_clk_mutex);
> + platform_set_drvdata(pdev, vcp);
> +
> + ret = vcp_reserve_memory_ioremap(vcp);
> + if (ret) {
> + dev_err(dev, "vcp_reserve_memory_ioremap failed ret = %d\n", ret);
> + return ERR_PTR(ret);
> + }
> +
> + core_id = 0;
> + for_each_available_child_of_node(np, child) {
> + if (of_device_is_compatible(child, "mediatek,vcp-core")) {
> + cpdev = of_find_device_by_node(child);
> + if (!cpdev) {
> + ret = -ENODEV;
> + dev_err(dev, "Not found platform device for core\n");
1. That's probe path, so why are you using this old style? The syntax is
return dev_err_probe and I am dissapointed that your internal review did
not ask for that.
2. You just leak here everywhere device.
This patchset has trivial errors, which should be spotted easily by
internal review. Plus your other patch ignored EXITING feedback, so what
is even point of posting this if you are just going to ignore us?
Please confirm that you received extensive internal review before
posting this?
Mediatek posts so many patches, I complained so many times about poor
quality, things a bit improved two years ago and for a year the quality
deteriorated and Mediatek posts poor code again. It's huge company with
huge resources, so I do not understand why trivial bugs like this cannot
be found inside first, to offload the community reviewers.
NAK
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-09-14 13:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-14 12:29 [PATCH v2 0/4] ASoC: mediatek: Add support of VCP on Mediatek mt8196 SoC Xiangzhi Tang
2025-09-14 12:29 ` [PATCH v2 1/4] dt-bindings: remoteproc: Add VCP support for mt8196 Xiangzhi Tang
2025-09-14 13:18 ` Krzysztof Kozlowski
2025-09-14 21:57 ` Rob Herring (Arm)
2025-09-15 7:48 ` AngeloGioacchino Del Regno
2025-09-14 12:29 ` [PATCH v2 2/4] remoterpoc: mediatek: vcp: Add vcp remoteproc driver Xiangzhi Tang
2025-09-14 13:28 ` Krzysztof Kozlowski [this message]
2025-09-15 9:14 ` AngeloGioacchino Del Regno
2025-09-14 12:29 ` [PATCH v2 3/4] remoterpoc: mediatek: vcp: Add ipi-mbox communication Xiangzhi Tang
2025-09-14 13:30 ` Krzysztof Kozlowski
2025-09-14 12:29 ` [PATCH v2 4/4] remoterpoc: mediatek: vcp: Add vcp suspned and resume feature Xiangzhi Tang
2025-09-14 13:16 ` [PATCH v2 0/4] ASoC: mediatek: Add support of VCP on Mediatek mt8196 SoC Krzysztof Kozlowski
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=8c298465-893a-4a18-9955-4769288ec010@kernel.org \
--to=krzk@kernel.org \
--cc=Hailong.Fan@mediatek.com \
--cc=Jjian.Zhou@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=andersson@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=irving-ch.lin@mediatek.com \
--cc=jh.hsu@mediatek.com \
--cc=krzk+dt@kernel.org \
--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=mathieu.poirier@linaro.org \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
--cc=sirius.wang@mediatek.com \
--cc=vince-wl.liu@mediatek.com \
--cc=xiangzhi.tang@mediatek.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