On 6/12/23 17:31, Catalin Marinas wrote: > In preparation for supporting a kmalloc() minimum alignment smaller than > the arch DMA alignment, decouple the two definitions. This requires that > either the kmalloc() caches are aligned to a (run-time) cache-line size > or the DMA API bounces unaligned kmalloc() allocations. Subsequent > patches will implement both options. > > After this patch, ARCH_DMA_MINALIGN is expected to be used in static > alignment annotations and defined by an architecture to be the maximum > alignment for all supported configurations/SoCs in a single Image. > Architectures opting in to a smaller ARCH_KMALLOC_MINALIGN will need to > define its value in the arch headers. > > Since ARCH_DMA_MINALIGN is now always defined, adjust the #ifdef in > dma_get_cache_alignment() so that there is no change for architectures > not requiring a minimum DMA alignment. > > Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx> > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > Cc: Vlastimil Babka <vbabka@xxxxxxx> > Cc: Christoph Hellwig <hch@xxxxxx> > Cc: Robin Murphy <robin.murphy@xxxxxxx> > Tested-by: Isaac J. Manjarres <isaacmanjarres@xxxxxxxxxx> Acked-by: Vlastimil Babka <vbabka@xxxxxxx>