Thread (41 messages) 41 messages, 6 authors, 2015-10-19

Re: [PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-10-06 03:43:40
Also in: linux-nvme, lkml

On Fri, 2015-10-02 at 13:11 -0700, Nishanth Aravamudan wrote:
quoted hunk ↗ jump to hunk
Drivers like NVMe need to be able to determine the page size used for
DMA transfers. Add a new API that defaults to return PAGE_SHIFT on all
architectures.

Signed-off-by: Nishanth Aravamudan <redacted>
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index b1bc954..86e4e97 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -355,4 +355,11 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
 }
 #endif
 
+#ifndef HAVE_ARCH_DMA_GET_PAGE_SHIFT
+static inline unsigned long dma_get_page_shift(struct device *dev)
+{
+	return PAGE_SHIFT;
+}
+#endif
+
 #endif
Adding Arnd who is asm-generic maintainer.

Arnd/Christoph can one of you give us an ack for this patch?

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help