From: sashiko-bot@kernel.org
To: "Tomeu Vizoso" <tomeu@tomeuvizoso.net>
Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
robh@kernel.org, conor+dt@kernel.org, media-ci@linuxtv.org
Subject: Re: [PATCH v4 14/14] arm64: dts: ti: k3-j722s: Add second submailbox to the C7x cores
Date: Sun, 29 Nov 2026 12:06:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-239568@kernel.org> (raw)
In-Reply-To: <20261129-thames-v4-14-003b1e3365bf@tomeuvizoso.net>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] accel/thames: broken dru_kernel_channel_first check in
thames_core_read_caps()
--
commit 7eb0354ce4ccbc601749105abe32aaddd5f51384
Author: Tomeu Vizoso <tomeu@tomeuvizoso.net>
accel/thames: Create a context per client on device open
This commit allocates a per-client context and LPAE page table on device
open, mapping the L2 SRAM, DRU kernel channels, user stack, and save area
for each DSP core.
> diff --git a/drivers/accel/thames/thames_core.c b/drivers/accel/thames/thames_core.c
> index 8053eeeb39022..d1140a374bd62 100644
> --- a/drivers/accel/thames/thames_core.c
> +++ b/drivers/accel/thames/thames_core.c
[ ... ]
> @@ -140,8 +141,16 @@ static int thames_core_read_caps(struct thames_core *core, struct thames_handsha
> return -EINVAL;
> }
>
> - if (tdev->has_caps && memcmp(caps, &tdev->caps, sizeof(*caps))) {
> - dev_err(core->dev, "Capabilities or window sizes differ from the first core's\n");
> + /*
> + * A Context maps every core's DRU channels when the Context is
> + * created, from channel 0 on a core that has not attached yet, so a
> + * core attaching later must report the first channel its Contexts map.
> + */
> + if (tdev->has_caps &&
> + (memcmp(caps, &tdev->caps, sizeof(*caps)) ||
> + dru_kernel_channel_first != core->dru_kernel_channel_first)) {
> + dev_err(core->dev,
> + "Capabilities, window sizes or first DRU channel differ from those the device was set up with\n");
> return -EINVAL;
> }
[Severity: High]
Does comparing dru_kernel_channel_first against
core->dru_kernel_channel_first reject every secondary core when the
firmware reports a non-zero dru_kernel_channel_first?
When the first core attaches, it sets tdev->has_caps to true and stores
its own core->dru_kernel_channel_first. When a second core attaches for
the first time, tdev->has_caps is already true, but the second core's
core->dru_kernel_channel_first has not been initialized yet and is still
0, so any non-zero dru_kernel_channel_first fails with -EINVAL even when
both cores report the same value and no contexts exist yet.
In addition, thames_context_map_core_regions() uses
core->dru_kernel_channel_first per core when mapping THAMES_WINDOW_DRU, so
any context opened before the second core attaches maps DRU channel 0
(the firmware's own channels) for that core. Storing
dru_kernel_channel_first in struct thames_caps would check and map a
consistent device-wide value across all cores.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261129-thames-v4-0-003b1e3365bf@tomeuvizoso.net?part=14
prev parent reply other threads:[~2026-11-29 12:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 11:35 [PATCH v4 00/14] New DRM accel driver for Texas Instruments' C7x DSPs Tomeu Vizoso
2026-11-29 11:35 ` [PATCH v4 01/14] dt-bindings: remoteproc: k3-dsp: Add the L2 auxiliary and DRU regions Tomeu Vizoso
2026-11-29 11:35 ` [PATCH v4 02/14] dt-bindings: remoteproc: k3-dsp: Allow a second sub-mailbox Tomeu Vizoso
2026-11-29 11:35 ` [PATCH v4 03/14] accel/thames: Add header with IPC definitions Tomeu Vizoso
2026-11-29 11:35 ` [PATCH v4 04/14] accel/thames: Add driver for the C7x DSPs in TI SoCs Tomeu Vizoso
2026-11-29 11:35 ` [PATCH v4 05/14] accel/thames: Create a context per client on device open Tomeu Vizoso
2026-11-29 11:53 ` sashiko-bot
2026-11-29 11:35 ` [PATCH v4 06/14] accel/thames: Add IOCTLs for BO creation and mapping Tomeu Vizoso
2026-11-29 11:52 ` sashiko-bot
2026-11-29 11:35 ` [PATCH v4 07/14] accel/thames: Add support for submitting DMA operations Tomeu Vizoso
2026-11-29 11:48 ` sashiko-bot
2026-11-29 11:35 ` [PATCH v4 08/14] accel/thames: Add IOCTLs for job creation and submission Tomeu Vizoso
2026-11-29 11:58 ` sashiko-bot
2026-11-29 11:35 ` [PATCH v4 09/14] accel/thames: Recover from faults and timeouts Tomeu Vizoso
2026-11-29 12:00 ` sashiko-bot
2026-11-29 11:35 ` [PATCH v4 10/14] accel/thames: Add IOCTL for memory synchronization Tomeu Vizoso
2026-11-29 11:35 ` [PATCH v4 11/14] accel/thames: Install memory mappings populated and dirty Tomeu Vizoso
2026-11-29 11:56 ` sashiko-bot
2026-11-29 11:35 ` [PATCH v4 12/14] Documentation: accel/thames: Add initial docs Tomeu Vizoso
2026-11-29 11:35 ` [PATCH v4 13/14] arm64: dts: ti: k3-j722s: Add the AUX L2 SRAM and DRU regions Tomeu Vizoso
2026-11-29 11:35 ` [PATCH v4 14/14] arm64: dts: ti: k3-j722s: Add second submailbox to the C7x cores Tomeu Vizoso
2026-11-29 12:06 ` sashiko-bot [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=sashiko-outbox-239568@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=media-ci@linuxtv.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tomeu@tomeuvizoso.net \
/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