Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ping Li" <leeonion.muyu@gmail.com>,
	miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH v4 3/3] mtd: rawnand: r852: declare NAND_USES_DMA
Date: Wed, 25 Nov 2026 12:10:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-233336@kernel.org> (raw)
In-Reply-To: <20261125115108.4147741-4-leeonion.muyu@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] mtd: rawnand: r852: unconditional NAND_USES_DMA in
  r852_register_nand_device()
--

commit bcc683752c018cf038ec971c8ed1a1fbca49d325
Author: Ping Li <leeonion.muyu@gmail.com>

mtd: rawnand: r852: declare NAND_USES_DMA

This commit sets NAND_USES_DMA and chip->buf_align = R852_DMA_LEN in
r852_register_nand_device() so nand_base bounces non-linear and misaligned
buffers before r852_do_dma() maps them with dma_map_single().

> diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c
> index 92c47d351c278..a68f58c81d6c0 100644
> --- a/drivers/mtd/nand/raw/r852.c
> +++ b/drivers/mtd/nand/raw/r852.c
> @@ -640,6 +640,9 @@ static int r852_register_nand_device(struct r852_device *dev)
>  	if (dev->readonly)
>  		dev->chip->options |= NAND_ROM;
>  
> +	dev->chip->options |= NAND_USES_DMA;
> +	dev->chip->buf_align = R852_DMA_LEN;

[Severity: Low]
Should NAND_USES_DMA and chip->buf_align be gated on dev->dma_usable?

r852_dma_test() sets dev->dma_usable = 0 when the controller lacks DMA
support or the r852_enable_dma module parameter is disabled, and
r852_read_buf() and r852_write_buf() only call r852_do_dma() when
len == R852_DMA_LEN && dev->dma_usable.  Setting these unconditionally
forces nand_base to bounce non-linear and non-512-byte-aligned buffers
through chip->data_buf even when the driver operates purely in PIO mode.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125115108.4147741-1-leeonion.muyu@gmail.com?part=3

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2026-11-25 12:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  5:50 [PATCH 0/3] mtd: rawnand: protect DMA engines from vmalloc'd buffers ping.li
2026-11-23  5:50 ` [PATCH 1/3] mtd: rawnand: fsmc: declare NAND_USES_DMA ping.li
2026-11-23  6:01   ` sashiko-bot
2026-11-23  7:04     ` Ping Li
2026-11-23  5:50 ` [PATCH 2/3] mtd: rawnand: intel: " ping.li
2026-11-23  6:01   ` sashiko-bot
2026-11-23  5:50 ` [PATCH 3/3] mtd: rawnand: r852: bounce non-linear-map buffers ping.li
2026-11-23  7:04 ` [PATCH v2 0/3] mtd: rawnand: protect DMA engines from vmalloc'd buffers Ping Li
2026-11-23  7:04   ` [PATCH v2 1/3] mtd: rawnand: intel: declare NAND_USES_DMA Ping Li
2026-11-23  7:04   ` [PATCH v2 2/3] mtd: rawnand: intel: unmap the DMA buffer in ebu_dma_start() Ping Li
2026-11-23  7:04   ` [PATCH v2 3/3] mtd: rawnand: r852: bounce non-linear-map buffers Ping Li
2026-11-25  8:55     ` Miquel Raynal
2026-11-25  9:25       ` Ping Li
2026-11-25  9:25   ` [PATCH v3 0/3] mtd: rawnand: protect DMA engines from vmalloc'd buffers Ping Li
2026-11-25  9:25     ` [PATCH v3 1/3] mtd: rawnand: intel: declare NAND_USES_DMA Ping Li
2026-11-25  9:25     ` [PATCH v3 2/3] mtd: rawnand: intel: unmap the DMA buffer in ebu_dma_start() Ping Li
2026-11-25  9:25     ` [PATCH v3 3/3] mtd: rawnand: r852: declare NAND_USES_DMA Ping Li
2026-11-25  9:48       ` Miquel Raynal
2026-11-25 11:50         ` Ping Li
2026-11-25 11:51     ` [PATCH v4 0/3] mtd: rawnand: protect DMA engines from vmalloc'd buffers Ping Li
2026-11-25 11:51       ` [PATCH v4 1/3] mtd: rawnand: intel: declare NAND_USES_DMA Ping Li
2026-11-25 11:51       ` [PATCH v4 2/3] mtd: rawnand: intel: unmap the DMA buffer in ebu_dma_start() Ping Li
2026-11-25 11:51       ` [PATCH v4 3/3] mtd: rawnand: r852: declare NAND_USES_DMA Ping Li
2026-11-25 12:10         ` sashiko-bot [this message]
2026-11-25 12:20           ` Miquel Raynal
2026-11-25 12:21       ` [PATCH v5 0/3] mtd: rawnand: protect DMA engines from vmalloc'd buffers Ping Li
2026-11-25 12:21         ` [PATCH v5 1/3] mtd: rawnand: intel: declare NAND_USES_DMA Ping Li
2026-11-25 12:21         ` [PATCH v5 2/3] mtd: rawnand: intel: unmap the DMA buffer in ebu_dma_start() Ping Li
2026-11-25 12:21         ` [PATCH v5 3/3] mtd: rawnand: r852: declare NAND_USES_DMA Ping Li
2026-11-25 12:55           ` Miquel Raynal

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-233336@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=leeonion.muyu@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vigneshr@ti.com \
    /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