Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Frank Li" <Frank.Li@nxp.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v4 9/9] crypto: atmel: Use dmaengine_prep_config_single() API
Date: Wed, 06 May 2026 23:31:12 +0000	[thread overview]
Message-ID: <20260506233112.CF4EFC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260506-dma_prep_config-v4-9-85b3d22babff@nxp.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The commit message incorrectly references `dmaengine_prep_config_single()` instead of `dmaengine_prep_config_sg()`.
- [Medium] DMA configuration errors are masked as Out-Of-Memory (-ENOMEM) errors, contradicting the 'No functional change' claim.
--

commit 321a15c31b7c3672b47256b90654c736d1c61477
Author: Frank Li <Frank.Li@nxp.com>

crypto: atmel: Use dmaengine_prep_config_single() API

This commit updates the atmel-aes driver to use a combined DMA preparation API
instead of calling configuration and preparation functions separately. The
commit message claims there is no functional change.

> crypto: atmel: Use dmaengine_prep_config_single() API
> 
> Using new API dmaengine_prep_config_single() to simple code.

This isn't a bug, but the commit message references
dmaengine_prep_config_single() here and in the subject line, while the actual
code uses dmaengine_prep_config_sg().

> diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
> index b393689400b4c..d890b5a277b9c 100644
> --- a/drivers/crypto/atmel-aes.c
> +++ b/drivers/crypto/atmel-aes.c

[ ... ]

> @@ -820,12 +819,9 @@ static int atmel_aes_dma_transfer_start(struct atmel_aes_dev *dd,
>  		return -EINVAL;
>  	}
>  
> -	err = dmaengine_slave_config(dma->chan, &config);
> -	if (err)
> -		return err;
> -
> -	desc = dmaengine_prep_slave_sg(dma->chan, dma->sg, dma->sg_len, dir,
> -				       DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> +	desc = dmaengine_prep_config_sg(dma->chan, dma->sg, dma->sg_len, dir,
> +					DMA_PREP_INTERRUPT | DMA_CTRL_ACK,
> +					&config);
>  	if (!desc)
>  		return -ENOMEM;

The commit message mentions "No functional change", but does this alter the
error code propagated on configuration failures?

Previously, if dmaengine_slave_config() failed, its specific error code was
returned directly to the caller. Now, dmaengine_prep_config_sg() internally
calls dmaengine_slave_config() and returns NULL on failure, which is
unconditionally mapped to -ENOMEM here.

Could this lead to DMA configuration errors being incorrectly reported as
out-of-memory errors to the upper crypto layers?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260506-dma_prep_config-v4-0-85b3d22babff@nxp.com?part=9

      reply	other threads:[~2026-05-06 23:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 20:44 [PATCH v4 0/9] dmaengine: Add new API to combine configuration and descriptor preparation Frank Li
2026-05-06 20:44 ` [PATCH v4 1/9] dmaengine: Add API to combine configuration and preparation (sg and single) Frank Li
2026-05-06 21:39   ` sashiko-bot
2026-05-06 20:44 ` [PATCH v4 2/9] dmaengine: Add safe API to combine configuration and preparation Frank Li
2026-05-06 22:02   ` sashiko-bot
2026-05-06 20:44 ` [PATCH v4 3/9] PCI: endpoint: pci-epf-test: Use dmaenigne_prep_config_single() to simplify code Frank Li
2026-05-06 20:44 ` [PATCH v4 4/9] dmaengine: dw-edma: Use new .device_prep_config_sg() callback Frank Li
2026-05-06 22:17   ` sashiko-bot
2026-05-06 20:44 ` [PATCH v4 5/9] dmaengine: dw-edma: Pass dma_slave_config to dw_edma_device_transfer() Frank Li
2026-05-06 22:36   ` sashiko-bot
2026-05-06 20:44 ` [PATCH v4 6/9] nvmet: pci-epf: Remove unnecessary dmaengine_terminate_sync() on each DMA transfer Frank Li
2026-05-06 20:44 ` [PATCH v4 7/9] nvmet: pci-epf: Use dmaengine_prep_config_single_safe() API Frank Li
2026-05-06 23:05   ` sashiko-bot
2026-05-06 20:44 ` [PATCH v4 8/9] PCI: epf-mhi: Use dmaengine_prep_config_single() to simplify code Frank Li
2026-05-06 23:26   ` sashiko-bot
2026-05-06 20:44 ` [PATCH v4 9/9] crypto: atmel: Use dmaengine_prep_config_single() API Frank Li
2026-05-06 23:31   ` 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=20260506233112.CF4EFC2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko@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