DMA Engine development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sasha Finkelstein" <k@chaosmail.tech>
Cc: devicetree@vger.kernel.org, vkoul@kernel.org, robh@kernel.org,
	Frank.Li@kernel.org, dmaengine@vger.kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH v4 2/2] dmaengine: apple-admac: Add M3 generation ADMACs
Date: Sat, 15 Aug 2026 10:48:32 +0000	[thread overview]
Message-ID: <20260815104832.9C7D41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260815-t603x-admac-v4-2-1149e342dcb0@chaosmail.tech>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Hardcoded channel-specific bitmask written to global registers during per-channel configuration.
--

--- Patch [2]: [PATCH v4 2/2] dmaengine: apple-admac: Add M3 generation ADMACs ---
commit 64ebea6bdd03b6d431f7550dfd48b4169f531022
Author: Sasha Finkelstein <k@chaosmail.tech>

dmaengine: apple-admac: Add M3 generation ADMACs

This commit adds support for M3 generation ADMACs present on t8122 and t603x
SoCs. It introduces additional writes to unknown registers required for
these hardware variants to operate correctly.

> diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c
> --- a/drivers/dma/apple-admac.c
> +++ b/drivers/dma/apple-admac.c
> @@ -39,10 +39,14 @@
>  
>  #define FLAG_DESC_NOTIFY	BIT(16)
>  
> +#define T8122_UNK_28_VAL	0x200000
> +

[ ... ]

> @@ -747,6 +756,11 @@ static int admac_device_config(struct dma_chan *chan,
>  	u32 bus_width = readl_relaxed(ad->base + REG_BUS_WIDTH(adchan->no)) &
>  		~(BUS_WIDTH_WORD_SIZE | BUS_WIDTH_FRAME_SIZE);
>  
> +	if (ad->hw->set_unk28) {
> +		writel_relaxed(T8122_UNK_28_VAL, ad->base + REG_UNK_28);
> +		writel_relaxed(T8122_UNK_28_VAL, ad->base + REG_UNK_2C);
> +	}
> +

[Severity: High]
Does this hardcode the configuration for a specific channel pair?

T8122_UNK_28_VAL is defined as 0x200000, which equals BIT(21). In this DMA
controller, global registers typically operate using a channel pair bitmask
calculated as 1 << (ch / 2), making BIT(21) correspond to channel pair 21
(channels 42 and 43).

Because this is called in the per-channel admac_device_config(),
configuring any channel will unconditionally write the bitmask for channel
pair 21 to these global registers.

Should this value be dynamically calculated based on adchan->no, or if it
is genuinely a one-time global constant, should it be written once during
admac_probe() instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260815-t603x-admac-v4-0-1149e342dcb0@chaosmail.tech?part=2

      reply	other threads:[~2026-08-15 10:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-15 10:41 [PATCH v4 0/2] dmaengine: apple-admac: Add support for M3 generation Sasha Finkelstein
2026-08-15 10:41 ` [PATCH v4 1/2] dt-bindings: dma: apple,admac: Add M3 generation ADMACs Sasha Finkelstein
2026-08-15 10:41 ` [PATCH v4 2/2] dmaengine: apple-admac: " Sasha Finkelstein
2026-08-15 10:48   ` 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=20260815104832.9C7D41F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=k@chaosmail.tech \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox