All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-dmapool-align-to-arch_dma_minalign-in-non-coherent-dma-mode.patch added to -mm tree
@ 2017-09-13 21:55 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-09-13 21:55 UTC (permalink / raw)
  To: chenhc, stable, zhangfx, mm-commits


The patch titled
     Subject: mm/dmapool.c: align to ARCH_DMA_MINALIGN in non-coherent DMA mode
has been added to the -mm tree.  Its filename is
     mm-dmapool-align-to-arch_dma_minalign-in-non-coherent-dma-mode.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-dmapool-align-to-arch_dma_minalign-in-non-coherent-dma-mode.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-dmapool-align-to-arch_dma_minalign-in-non-coherent-dma-mode.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Huacai Chen <chenhc@lemote.com>
Subject: mm/dmapool.c: align to ARCH_DMA_MINALIGN in non-coherent DMA mode

In non-coherent DMA mode, kernel uses cache flushing operations to
maintain I/O coherency, so the dmapool objects should be aligned to
ARCH_DMA_MINALIGN.

Link: http://lkml.kernel.org/r/1505294451-21312-1-git-send-email-chenhc@lemote.com
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/dmapool.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN mm/dmapool.c~mm-dmapool-align-to-arch_dma_minalign-in-non-coherent-dma-mode mm/dmapool.c
--- a/mm/dmapool.c~mm-dmapool-align-to-arch_dma_minalign-in-non-coherent-dma-mode
+++ a/mm/dmapool.c
@@ -140,6 +140,9 @@ struct dma_pool *dma_pool_create(const c
 	else if (align & (align - 1))
 		return NULL;
 
+	if (!plat_device_is_coherent(dev))
+		align = max_t(size_t, align, dma_get_cache_alignment());
+
 	if (size == 0)
 		return NULL;
 	else if (size < 4)
_

Patches currently in -mm which might be from chenhc@lemote.com are

mm-dmapool-align-to-arch_dma_minalign-in-non-coherent-dma-mode.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-13 21:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13 21:55 + mm-dmapool-align-to-arch_dma_minalign-in-non-coherent-dma-mode.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.