From: sashiko-bot@kernel.org
To: "Roman Vivchar" <rva333@protonmail.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 3/3] mailbox: mtk-cmdq: add mt6572 support
Date: Mon, 07 Sep 2026 18:17:11 +0000 [thread overview]
Message-ID: <20260907181711.C3B441F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907-6572-gce-v2-3-412a5b037290@protonmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Functions generating SPR/GPR-based instructions lack safety checks for legacy_isa, potentially causing GCE hardware lockups on MT6572.
--
commit 4694eedf10a37d189a86ca417a39efa7d5e2b2dd
Author: Roman Vivchar <rva333@protonmail.com>
mailbox: mtk-cmdq: add mt6572 support
Add legacy_isa field forwarding to the cmdq helper and a platform data
for the mt6572 GCE.
> diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> index e523c84b48088..5e7bc52baaa13 100644
> --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
[ ... ]
> @@ -787,6 +789,14 @@ static const struct dev_pm_ops cmdq_pm_ops = {
> cmdq_runtime_resume, NULL)
> };
>
> +static const struct gce_plat gce_plat_mt6572 = {
> + .thread_nr = 14,
> + .shift = 0,
> + .control_by_sw = false,
> + .legacy_isa = true,
> + .gce_num = 1
> +};
> +
[Severity: High]
Does enabling legacy ISA expose missing safety checks in the cmdq helper?
Looking at drivers/soc/mediatek/mtk-cmdq-helper.c, functions like
cmdq_pkt_write_pa() and cmdq_pkt_poll_addr() appear to generate SPR and
GPR-based instructions without checking for legacy hardware capabilities:
drivers/soc/mediatek/mtk-cmdq-helper.c:cmdq_pkt_write_pa() {
...
err = cmdq_pkt_assign(pkt, CMDQ_THR_SPR_IDX0, CMDQ_ADDR_HIGH(pa_base));
...
}
drivers/soc/mediatek/mtk-cmdq-helper.c:cmdq_pkt_poll_addr() {
...
inst.sop = CMDQ_POLL_ADDR_GPR;
...
}
If a client driver on MT6572 calls these functions, would it silently emit
structurally invalid instructions to the command buffer?
Since the legacy ISA on MT6572 does not support SPR or GPR instructions,
could this result in an unrecoverable GCE hardware lockup when flushed?
Would it make sense to check pkt->priv.legacy_isa in these functions and
return -EOPNOTSUPP to prevent hardware lockups?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907-6572-gce-v2-0-412a5b037290@protonmail.com?part=3
next prev parent reply other threads:[~2026-09-07 18:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 18:03 [PATCH v2 0/3] MediaTek mt6572 GCE support Roman Vivchar via B4 Relay
2026-09-07 18:03 ` [PATCH v2 1/3] dt-bindings: mailbox: mediatek,gce-mailbox: add mt6572 Roman Vivchar via B4 Relay
2026-09-07 18:03 ` [PATCH v2 2/3] soc: mediatek: cmdq-helper: add legacy GCE ISA support Roman Vivchar via B4 Relay
2026-09-07 18:16 ` sashiko-bot
2026-09-09 9:57 ` AngeloGioacchino Del Regno
2026-09-07 18:03 ` [PATCH v2 3/3] mailbox: mtk-cmdq: add mt6572 support Roman Vivchar via B4 Relay
2026-09-07 18:17 ` sashiko-bot [this message]
2026-09-08 7:01 ` [PATCH v2 0/3] MediaTek mt6572 GCE support AngeloGioacchino Del Regno
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=20260907181711.C3B441F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=rva333@protonmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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