All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ryan Roberts" <ryan.roberts@arm.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [RFC PATCH v1 6/8] misc/arm-cla: Set up memory translation context
Date: Fri, 17 Jul 2026 11:02:14 +0000	[thread overview]
Message-ID: <20260717110214.64D881F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260717104759.123203-7-ryan.roberts@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Type mismatch in the `min()` macro arguments will trigger strict type-checking compiler errors.
--

--- Patch [6]: [RFC PATCH v1 6/8] misc/arm-cla: Set up memory translation context ---
commit 5af1b39fed17c5b5bbf7cdc121a0531df0a24e2d
Author: Ryan Roberts <ryan.roberts@arm.com>

misc/arm-cla: Set up memory translation context

This commit sets up a Memory Translation Context (MTC) during CLA bringup for
CPU MMU DMA configurations. It populates the MTC from EL1 configuration,
configuring the accelerator to run as EL0 and installing user translation
contexts via TTBR0.

> diff --git a/drivers/misc/arm-cla/cla-ops.c b/drivers/misc/arm-cla/cla-ops.c
> index 7ddb973927e99..4d3f4f453e0b4 100644
> --- a/drivers/misc/arm-cla/cla-ops.c
> +++ b/drivers/misc/arm-cla/cla-ops.c
> @@ -180,6 +180,10 @@ static int cla_op_access_reg(struct cla_dev *dev, u8 op,
>  	case CLA_LAUNCH_OP_REGWRITE:
>  		max_regidx = 0x100000000;
>  		break;
> +	case CLA_LAUNCH_OP_SETCTX:
> +	case CLA_LAUNCH_OP_GETCTX:
> +		max_regidx = 0x80;
> +		break;
>  	default:
>  		WARN_ON(1);
>  		return -EINVAL;

[Severity: Low]
Will this result in a build failure due to strict type checking in the min()
macro?

Further down in cla_op_access_reg(), the code calculates the max register
using min():

    while (nregs > 0) {
        unsigned int reg_group = ALIGN_DOWN(regidx, 8);
        unsigned int max_reg = min(regidx + nregs, reg_group + 8);

Since nregs is a size_t (64-bit on ARM64) and reg_group is an unsigned int
(32-bit), the min() macro will catch the type mismatch between its arguments.
Could this be resolved by using min_t() or casting the arguments to matching
types?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260717104759.123203-1-ryan.roberts@arm.com?part=6

  reply	other threads:[~2026-07-17 11:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 10:47 [RFC PATCH v1 0/8] Arm Core Local Accelerator Driver Ryan Roberts
2026-07-17 10:47 ` [RFC PATCH v1 1/8] misc/arm-cla: Add driver skeleton and documentation Ryan Roberts
2026-07-17 10:56   ` sashiko-bot
2026-07-17 13:49   ` Arnd Bergmann
2026-07-17 15:44     ` Ryan Roberts
2026-07-17 16:10       ` Arnd Bergmann
2026-07-17 10:47 ` [RFC PATCH v1 2/8] misc/arm-cla: Add launch operation helpers Ryan Roberts
2026-07-17 11:01   ` sashiko-bot
2026-07-17 12:16   ` Arnd Bergmann
2026-07-17 10:47 ` [RFC PATCH v1 3/8] misc/arm-cla: Probe firmware-described devices Ryan Roberts
2026-07-17 10:57   ` sashiko-bot
2026-07-17 12:25   ` Arnd Bergmann
2026-07-17 12:36     ` Ryan Roberts
2026-07-17 10:47 ` [RFC PATCH v1 4/8] misc/arm-cla: Initialize devices on CPU bringup Ryan Roberts
2026-07-17 10:58   ` sashiko-bot
2026-07-17 10:47 ` [RFC PATCH v1 5/8] misc/arm-cla: Accelerator context save and restore Ryan Roberts
2026-07-17 10:58   ` sashiko-bot
2026-07-17 10:47 ` [RFC PATCH v1 6/8] misc/arm-cla: Set up memory translation context Ryan Roberts
2026-07-17 11:02   ` sashiko-bot [this message]
2026-07-17 10:47 ` [RFC PATCH v1 7/8] misc/arm-cla: Manage domain contexts Ryan Roberts
2026-07-17 11:01   ` sashiko-bot
2026-07-17 10:47 ` [RFC PATCH v1 8/8] misc/arm-cla: Add userspace interface Ryan Roberts
2026-07-17 11:10   ` sashiko-bot
2026-07-17 12:54   ` Arnd Bergmann
2026-07-17 14:35     ` Ryan Roberts
2026-07-17 15:31       ` Arnd Bergmann
2026-07-17 16:21         ` Ryan Roberts
2026-07-17 20:11           ` Arnd Bergmann
2026-07-17 11:33 ` [RFC PATCH v1 0/8] Arm Core Local Accelerator Driver Will Deacon
2026-07-17 12:09   ` Marc Zyngier
2026-07-17 12:33     ` Ryan Roberts
2026-07-17 12:30   ` Ryan Roberts
2026-07-17 13:32   ` Jason Gunthorpe
2026-07-17 13:42     ` Ryan Roberts

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=20260717110214.64D881F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ryan.roberts@arm.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 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.