Re: [PATCH v5 3/3] mtd: rawnand: r852: declare NAND_USES_DMA
From: Ping Li
Date: Thu Nov 26 2026 - 01:02:29 EST
From: leeonion.muyu@xxxxxxxxx
Hi Miquel,
> Wasn't in this driver a bounce buffering operation that is no
> longer needed?
With our patch in place, a vmalloc'd buffer now gets bounced by
the core through chip->data_buf. But data_buf comes from a bare
kmalloc(), and kmalloc() does not guarantee the returned address
to be 512-aligned (with SLUB debug options, for instance, the
redzone padding shifts the object placement). So the check in
r852_do_dma() -- (unsigned long)buf & (R852_DMA_LEN - 1) -- still
has something to catch, and I believe it cannot be removed.
The second reason to keep it is that the local bounce is also the
fallback when dma_map_single() fails.
Ping