[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151023205610.GB10197@linux.vnet.ibm.com>
Date: Fri, 23 Oct 2015 13:56:10 -0700
From: Nishanth Aravamudan <nacc@...ux.vnet.ibm.com>
To: Matthew Wilcox <willy@...ux.intel.com>
Cc: Keith Busch <keith.busch@...el.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Alexey Kardashevskiy <aik@...abs.ru>,
David Gibson <david@...son.dropbear.id.au>,
Christoph Hellwig <hch@...radead.org>,
"David S. Miller" <davem@...emloft.net>,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, sparclinux@...r.kernel.org
Subject: [PATCH 1/7 v3] dma-mapping: add generic dma_get_page_shift API
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 <nacc@...ux.vnet.ibm.com>
---
v1 -> v2:
Based upon feedback from Christoph Hellwig, implement the IOMMU page
size lookup as a generic DMA API, rather than an architecture-specific
hack.
v2 -> v3:
Based upon feedback from Christoph Hellwig that not all architectures
have moved to dma-mapping-common.h, so move the #ifdef and default to
linux/dma-mapping.h.
---
include/linux/dma-mapping.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ac07ff0..7eaba8d 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -95,6 +95,13 @@ static inline u64 dma_get_mask(struct device *dev)
return DMA_BIT_MASK(32);
}
+#ifndef HAVE_ARCH_DMA_GET_PAGE_SHIFT
+static inline unsigned long dma_get_page_shift(struct device *dev)
+{
+ return PAGE_SHIFT;
+}
+#endif
+
#ifdef CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK
int dma_set_coherent_mask(struct device *dev, u64 mask);
#else
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists