DMA Engine development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sasha Finkelstein" <k@chaosmail.tech>
Cc: vkoul@kernel.org, Frank.Li@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org, dmaengine@vger.kernel.org,
	robh@kernel.org
Subject: Re: [PATCH v3 2/2] dmaengine: apple-admac: Add M3 generation ADMACs
Date: Wed, 12 Aug 2026 09:40:31 +0000	[thread overview]
Message-ID: <20260812094032.008FD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812-t603x-admac-v3-2-d1f137f803e1@chaosmail.tech>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unconditional overwrite of global configuration registers with a potentially hardcoded channel mask during per-channel setup.
--

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

dmaengine: apple-admac: Add M3 generation ADMACs
    
The admacs present on t8122 and t603x SoCs need additional writes in
order to operate correctly. The exact purpose of this register
is unknown.

> 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
[ ... ]
> @@ -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->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 code overwrite global configuration state for all channels?

Since admac_device_config() is called per-channel during setup, writing a
hardcoded value (0x200000, which is BIT(21)) directly to global controller
registers without a read-modify-write will unconditionally clear any existing
state for other active channels.

Is T8122_UNK_28_VAL a global magic value, or might it be a channel-specific
bitmask captured from a trace that should be applied via a read-modify-write
incorporating the channel number?

>  	switch (is_tx ? config->dst_addr_width : config->src_addr_width) {
>  	case DMA_SLAVE_BUSWIDTH_1_BYTE:
>  		wordsize = 1;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-t603x-admac-v3-0-d1f137f803e1@chaosmail.tech?part=2

      reply	other threads:[~2026-08-12  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12  9:26 [PATCH v3 0/2] dmaengine: apple-admac: Add support for M3 generation Sasha Finkelstein
2026-08-12  9:26 ` [PATCH v3 1/2] dt-bindings: dma: apple,admac: Add M3 generation ADMACs Sasha Finkelstein
2026-08-12  9:26 ` [PATCH v3 2/2] dmaengine: apple-admac: " Sasha Finkelstein
2026-08-12  9:40   ` 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=20260812094032.008FD1F000E9@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