All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] device.h: Move out arch independent dma_iommu_mapping struct
@ 2014-06-04  8:11 ` ritesh.harjani at gmail.com
  0 siblings, 0 replies; 14+ messages in thread
From: ritesh.harjani @ 2014-06-04  8:11 UTC (permalink / raw)
  To: catalin.marinas, Will.Deacon, m.szyprowski, rmk, gregkh
  Cc: ritesh.harjani, linux-arm-kernel, linux-kernel

From: Ritesh Harjani <ritesh.harjani@gmail.com>

There has been various ongoing discussions on making arm iommu's dma-mapping
stuff to be common code which is arch independent[1].
Current users of this code will be arm and arm64, but later other archs
can start utilizing this as well.

Based on these discussion there has been work going on to refactor common
arch independent code of arm iommu's dma-mapping to lib/iommu-helper.c [2].

Since now dma_iommu_mapping stuff will be arch independent, so it make sense
to move out struct dma_iommu_mapping *mapping variable from arch/arm/*/device.h 
to include/linux/device.h as a first step [3].
Also, to move out complete structure definition of dma_iommu_mapping 
to include/linux/iommu-helper.h


Links:
[1]: https://www.mail-archive.com/iommu@lists.linux-foundation.org/msg03458.html
[2]: http://www.spinics.net/lists/arm-kernel/msg336343.html
[3]: http://www.spinics.net/lists/arm-kernel/msg336682.html

Ritesh Harjani (1):
  device.h: arm,dma-iommu: Move out dma_iommu_mapping struct

 arch/arm/Kconfig                          |  4 ++++
 arch/arm/include/asm/device.h             |  9 ---------
 arch/arm/include/asm/dma-iommu.h          | 16 +---------------
 arch/arm/mm/dma-mapping.c                 | 20 ++++++++++----------
 drivers/gpu/drm/exynos/exynos_drm_iommu.c | 10 +++++-----
 include/linux/device.h                    |  4 ++++
 include/linux/iommu-helper.h              | 22 ++++++++++++++++++++++
 7 files changed, 46 insertions(+), 39 deletions(-)

-- 
1.8.1.3


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 0/1] device.h: Move out arch independent dma_iommu_mapping struct
@ 2014-06-04  8:11 ` ritesh.harjani at gmail.com
  0 siblings, 0 replies; 14+ messages in thread
From: ritesh.harjani at gmail.com @ 2014-06-04  8:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ritesh Harjani <ritesh.harjani@gmail.com>

There has been various ongoing discussions on making arm iommu's dma-mapping
stuff to be common code which is arch independent[1].
Current users of this code will be arm and arm64, but later other archs
can start utilizing this as well.

Based on these discussion there has been work going on to refactor common
arch independent code of arm iommu's dma-mapping to lib/iommu-helper.c [2].

Since now dma_iommu_mapping stuff will be arch independent, so it make sense
to move out struct dma_iommu_mapping *mapping variable from arch/arm/*/device.h 
to include/linux/device.h as a first step [3].
Also, to move out complete structure definition of dma_iommu_mapping 
to include/linux/iommu-helper.h


Links:
[1]: https://www.mail-archive.com/iommu at lists.linux-foundation.org/msg03458.html
[2]: http://www.spinics.net/lists/arm-kernel/msg336343.html
[3]: http://www.spinics.net/lists/arm-kernel/msg336682.html

Ritesh Harjani (1):
  device.h: arm,dma-iommu: Move out dma_iommu_mapping struct

 arch/arm/Kconfig                          |  4 ++++
 arch/arm/include/asm/device.h             |  9 ---------
 arch/arm/include/asm/dma-iommu.h          | 16 +---------------
 arch/arm/mm/dma-mapping.c                 | 20 ++++++++++----------
 drivers/gpu/drm/exynos/exynos_drm_iommu.c | 10 +++++-----
 include/linux/device.h                    |  4 ++++
 include/linux/iommu-helper.h              | 22 ++++++++++++++++++++++
 7 files changed, 46 insertions(+), 39 deletions(-)

-- 
1.8.1.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
  2014-06-04  8:11 ` ritesh.harjani at gmail.com
@ 2014-06-04  8:11   ` ritesh.harjani at gmail.com
  -1 siblings, 0 replies; 14+ messages in thread
From: ritesh.harjani @ 2014-06-04  8:11 UTC (permalink / raw)
  To: catalin.marinas, Will.Deacon, m.szyprowski, rmk, gregkh
  Cc: ritesh.harjani, linux-arm-kernel, linux-kernel

From: Ritesh Harjani <ritesh.harjani@gmail.com>

This patch moves out *mapping pointer of dma_iommu_mapping
from arch/arm/include/asm/device.h to include/liunux/device.h

Also, it moves out complete structre definition of dma_iommu_mapping
to include/linux/iommu-helper.h

This is done since arm iommu's dma-mapping arch independent code,
needs to be moved out to lib/iommu-helper.c, this means
dma_iommu_mapping will be arch independent and later other archs
can make use of it.

Signed-off-by: Ritesh Harjani <ritesh.harjani@gmail.com>
---
 arch/arm/Kconfig                          |  4 ++++
 arch/arm/include/asm/device.h             |  9 ---------
 arch/arm/include/asm/dma-iommu.h          | 16 +---------------
 arch/arm/mm/dma-mapping.c                 | 20 ++++++++++----------
 drivers/gpu/drm/exynos/exynos_drm_iommu.c | 10 +++++-----
 include/linux/device.h                    |  4 ++++
 include/linux/iommu-helper.h              | 22 ++++++++++++++++++++++
 7 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c0b31fc..20717fb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -78,6 +78,7 @@ config ARM_DMA_USE_IOMMU
 	bool
 	select ARM_HAS_SG_CHAIN
 	select NEED_SG_DMA_LENGTH
+	select DMA_USE_IOMMU_HELPER_MAPPING
 
 if ARM_DMA_USE_IOMMU
 
@@ -1945,6 +1946,9 @@ config SWIOTLB
 config IOMMU_HELPER
 	def_bool SWIOTLB
 
+config DMA_USE_IOMMU_HELPER_MAPPING
+	def_bool n
+
 config XEN_DOM0
 	def_bool y
 	depends on XEN
diff --git a/arch/arm/include/asm/device.h b/arch/arm/include/asm/device.h
index dc662fc..6e2cb0e 100644
--- a/arch/arm/include/asm/device.h
+++ b/arch/arm/include/asm/device.h
@@ -14,9 +14,6 @@ struct dev_archdata {
 #ifdef CONFIG_IOMMU_API
 	void *iommu; /* private IOMMU data */
 #endif
-#ifdef CONFIG_ARM_DMA_USE_IOMMU
-	struct dma_iommu_mapping	*mapping;
-#endif
 };
 
 struct omap_device;
@@ -27,10 +24,4 @@ struct pdev_archdata {
 #endif
 };
 
-#ifdef CONFIG_ARM_DMA_USE_IOMMU
-#define to_dma_iommu_mapping(dev) ((dev)->archdata.mapping)
-#else
-#define to_dma_iommu_mapping(dev) NULL
-#endif
-
 #endif
diff --git a/arch/arm/include/asm/dma-iommu.h b/arch/arm/include/asm/dma-iommu.h
index 8e3fcb9..50c010b 100644
--- a/arch/arm/include/asm/dma-iommu.h
+++ b/arch/arm/include/asm/dma-iommu.h
@@ -8,21 +8,7 @@
 #include <linux/dma-debug.h>
 #include <linux/kmemcheck.h>
 #include <linux/kref.h>
-
-struct dma_iommu_mapping {
-	/* iommu specific data */
-	struct iommu_domain	*domain;
-
-	unsigned long		**bitmaps;	/* array of bitmaps */
-	unsigned int		nr_bitmaps;	/* nr of elements in array */
-	unsigned int		extensions;
-	size_t			bitmap_size;	/* size of a single bitmap */
-	size_t			bits;		/* per bitmap */
-	dma_addr_t		base;
-
-	spinlock_t		lock;
-	struct kref		kref;
-};
+#include <linux/iommu-helper.h>
 
 struct dma_iommu_mapping *
 arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size);
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 3d43c41..b82561e 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1292,7 +1292,7 @@ err:
 static dma_addr_t
 __iommu_create_mapping(struct device *dev, struct page **pages, size_t size)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
 	dma_addr_t dma_addr, iova;
 	int i, ret = DMA_ERROR_CODE;
@@ -1328,7 +1328,7 @@ fail:
 
 static int __iommu_remove_mapping(struct device *dev, dma_addr_t iova, size_t size)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 
 	/*
 	 * add optional in-page offset from iova to size and align
@@ -1541,7 +1541,7 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
 			  enum dma_data_direction dir, struct dma_attrs *attrs,
 			  bool is_coherent)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova, iova_base;
 	int ret = 0;
 	unsigned int count;
@@ -1762,7 +1762,7 @@ static dma_addr_t arm_coherent_iommu_map_page(struct device *dev, struct page *p
 	     unsigned long offset, size_t size, enum dma_data_direction dir,
 	     struct dma_attrs *attrs)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t dma_addr;
 	int ret, prot, len = PAGE_ALIGN(size + offset);
 
@@ -1815,7 +1815,7 @@ static void arm_coherent_iommu_unmap_page(struct device *dev, dma_addr_t handle,
 		size_t size, enum dma_data_direction dir,
 		struct dma_attrs *attrs)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova = handle & PAGE_MASK;
 	int offset = handle & ~PAGE_MASK;
 	int len = PAGE_ALIGN(size + offset);
@@ -1840,7 +1840,7 @@ static void arm_iommu_unmap_page(struct device *dev, dma_addr_t handle,
 		size_t size, enum dma_data_direction dir,
 		struct dma_attrs *attrs)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova = handle & PAGE_MASK;
 	struct page *page = phys_to_page(iommu_iova_to_phys(mapping->domain, iova));
 	int offset = handle & ~PAGE_MASK;
@@ -1859,7 +1859,7 @@ static void arm_iommu_unmap_page(struct device *dev, dma_addr_t handle,
 static void arm_iommu_sync_single_for_cpu(struct device *dev,
 		dma_addr_t handle, size_t size, enum dma_data_direction dir)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova = handle & PAGE_MASK;
 	struct page *page = phys_to_page(iommu_iova_to_phys(mapping->domain, iova));
 	unsigned int offset = handle & ~PAGE_MASK;
@@ -1873,7 +1873,7 @@ static void arm_iommu_sync_single_for_cpu(struct device *dev,
 static void arm_iommu_sync_single_for_device(struct device *dev,
 		dma_addr_t handle, size_t size, enum dma_data_direction dir)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova = handle & PAGE_MASK;
 	struct page *page = phys_to_page(iommu_iova_to_phys(mapping->domain, iova));
 	unsigned int offset = handle & ~PAGE_MASK;
@@ -2045,7 +2045,7 @@ int arm_iommu_attach_device(struct device *dev,
 		return err;
 
 	kref_get(&mapping->kref);
-	dev->archdata.mapping = mapping;
+	dev->mapping = mapping;
 	set_dma_ops(dev, &iommu_ops);
 
 	pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev));
@@ -2072,7 +2072,7 @@ void arm_iommu_detach_device(struct device *dev)
 
 	iommu_detach_device(mapping->domain, dev);
 	kref_put(&mapping->kref, release_iommu_mapping);
-	dev->archdata.mapping = NULL;
+	dev->mapping = NULL;
 	set_dma_ops(dev, NULL);
 
 	pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev));
diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
index 091068f..2dabdbf 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
@@ -46,7 +46,7 @@ int drm_create_iommu_mapping(struct drm_device *drm_dev)
 	dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
 					GFP_KERNEL);
 	dma_set_max_seg_size(dev, 0xffffffffu);
-	dev->archdata.mapping = mapping;
+	dev->mapping = mapping;
 
 	return 0;
 }
@@ -63,7 +63,7 @@ void drm_release_iommu_mapping(struct drm_device *drm_dev)
 {
 	struct device *dev = drm_dev->dev;
 
-	arm_iommu_release_mapping(dev->archdata.mapping);
+	arm_iommu_release_mapping(dev->mapping);
 }
 
 /*
@@ -81,7 +81,7 @@ int drm_iommu_attach_device(struct drm_device *drm_dev,
 	struct device *dev = drm_dev->dev;
 	int ret;
 
-	if (!dev->archdata.mapping) {
+	if (!dev->mapping) {
 		DRM_ERROR("iommu_mapping is null.\n");
 		return -EFAULT;
 	}
@@ -91,7 +91,7 @@ int drm_iommu_attach_device(struct drm_device *drm_dev,
 					GFP_KERNEL);
 	dma_set_max_seg_size(subdrv_dev, 0xffffffffu);
 
-	ret = arm_iommu_attach_device(subdrv_dev, dev->archdata.mapping);
+	ret = arm_iommu_attach_device(subdrv_dev, dev->mapping);
 	if (ret < 0) {
 		DRM_DEBUG_KMS("failed iommu attach.\n");
 		return ret;
@@ -124,7 +124,7 @@ void drm_iommu_detach_device(struct drm_device *drm_dev,
 				struct device *subdrv_dev)
 {
 	struct device *dev = drm_dev->dev;
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 
 	if (!mapping || !mapping->domain)
 		return;
diff --git a/include/linux/device.h b/include/linux/device.h
index c0a1261..c73df6f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -705,6 +705,10 @@ struct device {
 	/* arch specific additions */
 	struct dev_archdata	archdata;
 
+#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
+	struct dma_iommu_mapping	*mapping;
+#endif
+
 	struct device_node	*of_node; /* associated device tree node */
 	struct acpi_dev_node	acpi_node; /* associated ACPI device node */
 
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h
index 86bdeff..0c5e4c7 100644
--- a/include/linux/iommu-helper.h
+++ b/include/linux/iommu-helper.h
@@ -3,6 +3,28 @@
 
 #include <linux/kernel.h>
 
+#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
+struct dma_iommu_mapping {
+	/* iommu specific data */
+	struct iommu_domain	*domain;
+
+	unsigned long		**bitmaps;	/* array of bitmaps */
+	unsigned int		nr_bitmaps;	/* nr of elements in array */
+	unsigned int		extensions;
+	size_t			bitmap_size;	/* size of a single bitmap */
+	size_t			bits;		/* per bitmap */
+	dma_addr_t		base;
+
+	spinlock_t		lock;
+	struct kref		kref;
+};
+
+#define to_dma_iommu_mapping(dev) ((dev)->mapping)
+#else
+#define to_dma_iommu_mapping(dev) NULL
+#endif
+
+
 static inline unsigned long iommu_device_max_index(unsigned long size,
 						   unsigned long offset,
 						   u64 dma_mask)
-- 
1.8.1.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 1/1] device.h: arm, dma-iommu: Move out dma_iommu_mapping struct
@ 2014-06-04  8:11   ` ritesh.harjani at gmail.com
  0 siblings, 0 replies; 14+ messages in thread
From: ritesh.harjani at gmail.com @ 2014-06-04  8:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ritesh Harjani <ritesh.harjani@gmail.com>

This patch moves out *mapping pointer of dma_iommu_mapping
from arch/arm/include/asm/device.h to include/liunux/device.h

Also, it moves out complete structre definition of dma_iommu_mapping
to include/linux/iommu-helper.h

This is done since arm iommu's dma-mapping arch independent code,
needs to be moved out to lib/iommu-helper.c, this means
dma_iommu_mapping will be arch independent and later other archs
can make use of it.

Signed-off-by: Ritesh Harjani <ritesh.harjani@gmail.com>
---
 arch/arm/Kconfig                          |  4 ++++
 arch/arm/include/asm/device.h             |  9 ---------
 arch/arm/include/asm/dma-iommu.h          | 16 +---------------
 arch/arm/mm/dma-mapping.c                 | 20 ++++++++++----------
 drivers/gpu/drm/exynos/exynos_drm_iommu.c | 10 +++++-----
 include/linux/device.h                    |  4 ++++
 include/linux/iommu-helper.h              | 22 ++++++++++++++++++++++
 7 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c0b31fc..20717fb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -78,6 +78,7 @@ config ARM_DMA_USE_IOMMU
 	bool
 	select ARM_HAS_SG_CHAIN
 	select NEED_SG_DMA_LENGTH
+	select DMA_USE_IOMMU_HELPER_MAPPING
 
 if ARM_DMA_USE_IOMMU
 
@@ -1945,6 +1946,9 @@ config SWIOTLB
 config IOMMU_HELPER
 	def_bool SWIOTLB
 
+config DMA_USE_IOMMU_HELPER_MAPPING
+	def_bool n
+
 config XEN_DOM0
 	def_bool y
 	depends on XEN
diff --git a/arch/arm/include/asm/device.h b/arch/arm/include/asm/device.h
index dc662fc..6e2cb0e 100644
--- a/arch/arm/include/asm/device.h
+++ b/arch/arm/include/asm/device.h
@@ -14,9 +14,6 @@ struct dev_archdata {
 #ifdef CONFIG_IOMMU_API
 	void *iommu; /* private IOMMU data */
 #endif
-#ifdef CONFIG_ARM_DMA_USE_IOMMU
-	struct dma_iommu_mapping	*mapping;
-#endif
 };
 
 struct omap_device;
@@ -27,10 +24,4 @@ struct pdev_archdata {
 #endif
 };
 
-#ifdef CONFIG_ARM_DMA_USE_IOMMU
-#define to_dma_iommu_mapping(dev) ((dev)->archdata.mapping)
-#else
-#define to_dma_iommu_mapping(dev) NULL
-#endif
-
 #endif
diff --git a/arch/arm/include/asm/dma-iommu.h b/arch/arm/include/asm/dma-iommu.h
index 8e3fcb9..50c010b 100644
--- a/arch/arm/include/asm/dma-iommu.h
+++ b/arch/arm/include/asm/dma-iommu.h
@@ -8,21 +8,7 @@
 #include <linux/dma-debug.h>
 #include <linux/kmemcheck.h>
 #include <linux/kref.h>
-
-struct dma_iommu_mapping {
-	/* iommu specific data */
-	struct iommu_domain	*domain;
-
-	unsigned long		**bitmaps;	/* array of bitmaps */
-	unsigned int		nr_bitmaps;	/* nr of elements in array */
-	unsigned int		extensions;
-	size_t			bitmap_size;	/* size of a single bitmap */
-	size_t			bits;		/* per bitmap */
-	dma_addr_t		base;
-
-	spinlock_t		lock;
-	struct kref		kref;
-};
+#include <linux/iommu-helper.h>
 
 struct dma_iommu_mapping *
 arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size);
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 3d43c41..b82561e 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1292,7 +1292,7 @@ err:
 static dma_addr_t
 __iommu_create_mapping(struct device *dev, struct page **pages, size_t size)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
 	dma_addr_t dma_addr, iova;
 	int i, ret = DMA_ERROR_CODE;
@@ -1328,7 +1328,7 @@ fail:
 
 static int __iommu_remove_mapping(struct device *dev, dma_addr_t iova, size_t size)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 
 	/*
 	 * add optional in-page offset from iova to size and align
@@ -1541,7 +1541,7 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
 			  enum dma_data_direction dir, struct dma_attrs *attrs,
 			  bool is_coherent)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova, iova_base;
 	int ret = 0;
 	unsigned int count;
@@ -1762,7 +1762,7 @@ static dma_addr_t arm_coherent_iommu_map_page(struct device *dev, struct page *p
 	     unsigned long offset, size_t size, enum dma_data_direction dir,
 	     struct dma_attrs *attrs)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t dma_addr;
 	int ret, prot, len = PAGE_ALIGN(size + offset);
 
@@ -1815,7 +1815,7 @@ static void arm_coherent_iommu_unmap_page(struct device *dev, dma_addr_t handle,
 		size_t size, enum dma_data_direction dir,
 		struct dma_attrs *attrs)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova = handle & PAGE_MASK;
 	int offset = handle & ~PAGE_MASK;
 	int len = PAGE_ALIGN(size + offset);
@@ -1840,7 +1840,7 @@ static void arm_iommu_unmap_page(struct device *dev, dma_addr_t handle,
 		size_t size, enum dma_data_direction dir,
 		struct dma_attrs *attrs)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova = handle & PAGE_MASK;
 	struct page *page = phys_to_page(iommu_iova_to_phys(mapping->domain, iova));
 	int offset = handle & ~PAGE_MASK;
@@ -1859,7 +1859,7 @@ static void arm_iommu_unmap_page(struct device *dev, dma_addr_t handle,
 static void arm_iommu_sync_single_for_cpu(struct device *dev,
 		dma_addr_t handle, size_t size, enum dma_data_direction dir)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova = handle & PAGE_MASK;
 	struct page *page = phys_to_page(iommu_iova_to_phys(mapping->domain, iova));
 	unsigned int offset = handle & ~PAGE_MASK;
@@ -1873,7 +1873,7 @@ static void arm_iommu_sync_single_for_cpu(struct device *dev,
 static void arm_iommu_sync_single_for_device(struct device *dev,
 		dma_addr_t handle, size_t size, enum dma_data_direction dir)
 {
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 	dma_addr_t iova = handle & PAGE_MASK;
 	struct page *page = phys_to_page(iommu_iova_to_phys(mapping->domain, iova));
 	unsigned int offset = handle & ~PAGE_MASK;
@@ -2045,7 +2045,7 @@ int arm_iommu_attach_device(struct device *dev,
 		return err;
 
 	kref_get(&mapping->kref);
-	dev->archdata.mapping = mapping;
+	dev->mapping = mapping;
 	set_dma_ops(dev, &iommu_ops);
 
 	pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev));
@@ -2072,7 +2072,7 @@ void arm_iommu_detach_device(struct device *dev)
 
 	iommu_detach_device(mapping->domain, dev);
 	kref_put(&mapping->kref, release_iommu_mapping);
-	dev->archdata.mapping = NULL;
+	dev->mapping = NULL;
 	set_dma_ops(dev, NULL);
 
 	pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev));
diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
index 091068f..2dabdbf 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
@@ -46,7 +46,7 @@ int drm_create_iommu_mapping(struct drm_device *drm_dev)
 	dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
 					GFP_KERNEL);
 	dma_set_max_seg_size(dev, 0xffffffffu);
-	dev->archdata.mapping = mapping;
+	dev->mapping = mapping;
 
 	return 0;
 }
@@ -63,7 +63,7 @@ void drm_release_iommu_mapping(struct drm_device *drm_dev)
 {
 	struct device *dev = drm_dev->dev;
 
-	arm_iommu_release_mapping(dev->archdata.mapping);
+	arm_iommu_release_mapping(dev->mapping);
 }
 
 /*
@@ -81,7 +81,7 @@ int drm_iommu_attach_device(struct drm_device *drm_dev,
 	struct device *dev = drm_dev->dev;
 	int ret;
 
-	if (!dev->archdata.mapping) {
+	if (!dev->mapping) {
 		DRM_ERROR("iommu_mapping is null.\n");
 		return -EFAULT;
 	}
@@ -91,7 +91,7 @@ int drm_iommu_attach_device(struct drm_device *drm_dev,
 					GFP_KERNEL);
 	dma_set_max_seg_size(subdrv_dev, 0xffffffffu);
 
-	ret = arm_iommu_attach_device(subdrv_dev, dev->archdata.mapping);
+	ret = arm_iommu_attach_device(subdrv_dev, dev->mapping);
 	if (ret < 0) {
 		DRM_DEBUG_KMS("failed iommu attach.\n");
 		return ret;
@@ -124,7 +124,7 @@ void drm_iommu_detach_device(struct drm_device *drm_dev,
 				struct device *subdrv_dev)
 {
 	struct device *dev = drm_dev->dev;
-	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	struct dma_iommu_mapping *mapping = dev->mapping;
 
 	if (!mapping || !mapping->domain)
 		return;
diff --git a/include/linux/device.h b/include/linux/device.h
index c0a1261..c73df6f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -705,6 +705,10 @@ struct device {
 	/* arch specific additions */
 	struct dev_archdata	archdata;
 
+#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
+	struct dma_iommu_mapping	*mapping;
+#endif
+
 	struct device_node	*of_node; /* associated device tree node */
 	struct acpi_dev_node	acpi_node; /* associated ACPI device node */
 
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h
index 86bdeff..0c5e4c7 100644
--- a/include/linux/iommu-helper.h
+++ b/include/linux/iommu-helper.h
@@ -3,6 +3,28 @@
 
 #include <linux/kernel.h>
 
+#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
+struct dma_iommu_mapping {
+	/* iommu specific data */
+	struct iommu_domain	*domain;
+
+	unsigned long		**bitmaps;	/* array of bitmaps */
+	unsigned int		nr_bitmaps;	/* nr of elements in array */
+	unsigned int		extensions;
+	size_t			bitmap_size;	/* size of a single bitmap */
+	size_t			bits;		/* per bitmap */
+	dma_addr_t		base;
+
+	spinlock_t		lock;
+	struct kref		kref;
+};
+
+#define to_dma_iommu_mapping(dev) ((dev)->mapping)
+#else
+#define to_dma_iommu_mapping(dev) NULL
+#endif
+
+
 static inline unsigned long iommu_device_max_index(unsigned long size,
 						   unsigned long offset,
 						   u64 dma_mask)
-- 
1.8.1.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
  2014-06-04  8:11   ` [PATCH 1/1] device.h: arm, dma-iommu: " ritesh.harjani at gmail.com
@ 2014-06-04 17:51     ` Greg KH
  -1 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2014-06-04 17:51 UTC (permalink / raw)
  To: ritesh.harjani
  Cc: catalin.marinas, Will.Deacon, m.szyprowski, rmk,
	linux-arm-kernel, linux-kernel

On Wed, Jun 04, 2014 at 01:41:46PM +0530, ritesh.harjani@gmail.com wrote:
> From: Ritesh Harjani <ritesh.harjani@gmail.com>
> 
> This patch moves out *mapping pointer of dma_iommu_mapping
> from arch/arm/include/asm/device.h to include/liunux/device.h

Why?  Who else can use this becides arm devices?

> 
> Also, it moves out complete structre definition of dma_iommu_mapping
> to include/linux/iommu-helper.h
> 
> This is done since arm iommu's dma-mapping arch independent code,
> needs to be moved out to lib/iommu-helper.c, this means
> dma_iommu_mapping will be arch independent and later other archs
> can make use of it.

Will that really happen?  Do you have patches that do that?  I'd prefer
to not do stuff like this until you have a patch series that needs it,
otherwise this is just unneeded churn.

> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -705,6 +705,10 @@ struct device {
>  	/* arch specific additions */
>  	struct dev_archdata	archdata;
>  
> +#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
> +	struct dma_iommu_mapping	*mapping;
> +#endif
> +
>  	struct device_node	*of_node; /* associated device tree node */
>  	struct acpi_dev_node	acpi_node; /* associated ACPI device node */
>  

Are you sure this will not break the build on systems that enable that
option, yet do not include iommu-helper.h?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
@ 2014-06-04 17:51     ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2014-06-04 17:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 04, 2014 at 01:41:46PM +0530, ritesh.harjani at gmail.com wrote:
> From: Ritesh Harjani <ritesh.harjani@gmail.com>
> 
> This patch moves out *mapping pointer of dma_iommu_mapping
> from arch/arm/include/asm/device.h to include/liunux/device.h

Why?  Who else can use this becides arm devices?

> 
> Also, it moves out complete structre definition of dma_iommu_mapping
> to include/linux/iommu-helper.h
> 
> This is done since arm iommu's dma-mapping arch independent code,
> needs to be moved out to lib/iommu-helper.c, this means
> dma_iommu_mapping will be arch independent and later other archs
> can make use of it.

Will that really happen?  Do you have patches that do that?  I'd prefer
to not do stuff like this until you have a patch series that needs it,
otherwise this is just unneeded churn.

> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -705,6 +705,10 @@ struct device {
>  	/* arch specific additions */
>  	struct dev_archdata	archdata;
>  
> +#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
> +	struct dma_iommu_mapping	*mapping;
> +#endif
> +
>  	struct device_node	*of_node; /* associated device tree node */
>  	struct acpi_dev_node	acpi_node; /* associated ACPI device node */
>  

Are you sure this will not break the build on systems that enable that
option, yet do not include iommu-helper.h?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
  2014-06-04 17:51     ` Greg KH
@ 2014-06-04 18:46       ` Ritesh Harjani
  -1 siblings, 0 replies; 14+ messages in thread
From: Ritesh Harjani @ 2014-06-04 18:46 UTC (permalink / raw)
  To: Greg KH
  Cc: Catalin Marinas, Will Deacon, Marek Szyprowski, Russell King,
	linux-arm-kernel, linux-kernel

Hi Greg,

Thanks for reviewing.

On Wed, Jun 4, 2014 at 11:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Jun 04, 2014 at 01:41:46PM +0530, ritesh.harjani@gmail.com wrote:
>> From: Ritesh Harjani <ritesh.harjani@gmail.com>
>>
>> This patch moves out *mapping pointer of dma_iommu_mapping
>> from arch/arm/include/asm/device.h to include/liunux/device.h
>
> Why?  Who else can use this becides arm devices?

Currently only arm and arm64 are the archs at this very moment but
later other archs can make use of this, as its an arch independent
code. (Similar to as some arch make use of iommu_area_alloc in
iommu-helper.c)

>
>>
>> Also, it moves out complete structre definition of dma_iommu_mapping
>> to include/linux/iommu-helper.h
>>
>> This is done since arm iommu's dma-mapping arch independent code,
>> needs to be moved out to lib/iommu-helper.c, this means
>> dma_iommu_mapping will be arch independent and later other archs
>> can make use of it.
>
> Will that really happen?  Do you have patches that do that?  I'd prefer
> to not do stuff like this until you have a patch series that needs it,
> otherwise this is just unneeded churn.

Yes, foll link has the patch series, (under review)
http://www.spinics.net/lists/arm-kernel/msg336896.html

>
>> --- a/include/linux/device.h
>> +++ b/include/linux/device.h
>> @@ -705,6 +705,10 @@ struct device {
>>       /* arch specific additions */
>>       struct dev_archdata     archdata;
>>
>> +#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
>> +     struct dma_iommu_mapping        *mapping;
>> +#endif
>> +
>>       struct device_node      *of_node; /* associated device tree node */
>>       struct acpi_dev_node    acpi_node; /* associated ACPI device node */
>>
>
> Are you sure this will not break the build on systems that enable that
> option, yet do not include iommu-helper.h?

They need to include iommu-helper.h wherever they are using this
structure members. Until then no this should
not break the build I think for the case you mentioned. That's how it
was done in arch/arm/include/asm/device.h

Do I need to do this in diff way ?

>
> thanks,
>
> greg k-h



Thanks
Ritesh

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] device.h: arm, dma-iommu: Move out dma_iommu_mapping struct
@ 2014-06-04 18:46       ` Ritesh Harjani
  0 siblings, 0 replies; 14+ messages in thread
From: Ritesh Harjani @ 2014-06-04 18:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Greg,

Thanks for reviewing.

On Wed, Jun 4, 2014 at 11:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Jun 04, 2014 at 01:41:46PM +0530, ritesh.harjani at gmail.com wrote:
>> From: Ritesh Harjani <ritesh.harjani@gmail.com>
>>
>> This patch moves out *mapping pointer of dma_iommu_mapping
>> from arch/arm/include/asm/device.h to include/liunux/device.h
>
> Why?  Who else can use this becides arm devices?

Currently only arm and arm64 are the archs at this very moment but
later other archs can make use of this, as its an arch independent
code. (Similar to as some arch make use of iommu_area_alloc in
iommu-helper.c)

>
>>
>> Also, it moves out complete structre definition of dma_iommu_mapping
>> to include/linux/iommu-helper.h
>>
>> This is done since arm iommu's dma-mapping arch independent code,
>> needs to be moved out to lib/iommu-helper.c, this means
>> dma_iommu_mapping will be arch independent and later other archs
>> can make use of it.
>
> Will that really happen?  Do you have patches that do that?  I'd prefer
> to not do stuff like this until you have a patch series that needs it,
> otherwise this is just unneeded churn.

Yes, foll link has the patch series, (under review)
http://www.spinics.net/lists/arm-kernel/msg336896.html

>
>> --- a/include/linux/device.h
>> +++ b/include/linux/device.h
>> @@ -705,6 +705,10 @@ struct device {
>>       /* arch specific additions */
>>       struct dev_archdata     archdata;
>>
>> +#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
>> +     struct dma_iommu_mapping        *mapping;
>> +#endif
>> +
>>       struct device_node      *of_node; /* associated device tree node */
>>       struct acpi_dev_node    acpi_node; /* associated ACPI device node */
>>
>
> Are you sure this will not break the build on systems that enable that
> option, yet do not include iommu-helper.h?

They need to include iommu-helper.h wherever they are using this
structure members. Until then no this should
not break the build I think for the case you mentioned. That's how it
was done in arch/arm/include/asm/device.h

Do I need to do this in diff way ?

>
> thanks,
>
> greg k-h



Thanks
Ritesh

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
  2014-06-04 18:46       ` [PATCH 1/1] device.h: arm, dma-iommu: " Ritesh Harjani
@ 2014-06-04 18:59         ` Greg KH
  -1 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2014-06-04 18:59 UTC (permalink / raw)
  To: Ritesh Harjani
  Cc: Catalin Marinas, Will Deacon, Marek Szyprowski, Russell King,
	linux-arm-kernel, linux-kernel

On Thu, Jun 05, 2014 at 12:16:28AM +0530, Ritesh Harjani wrote:
> Hi Greg,
> 
> Thanks for reviewing.
> 
> On Wed, Jun 4, 2014 at 11:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Wed, Jun 04, 2014 at 01:41:46PM +0530, ritesh.harjani@gmail.com wrote:
> >> From: Ritesh Harjani <ritesh.harjani@gmail.com>
> >>
> >> This patch moves out *mapping pointer of dma_iommu_mapping
> >> from arch/arm/include/asm/device.h to include/liunux/device.h
> >
> > Why?  Who else can use this becides arm devices?
> 
> Currently only arm and arm64 are the archs at this very moment but
> later other archs can make use of this, as its an arch independent
> code. (Similar to as some arch make use of iommu_area_alloc in
> iommu-helper.c)
> 
> >
> >>
> >> Also, it moves out complete structre definition of dma_iommu_mapping
> >> to include/linux/iommu-helper.h
> >>
> >> This is done since arm iommu's dma-mapping arch independent code,
> >> needs to be moved out to lib/iommu-helper.c, this means
> >> dma_iommu_mapping will be arch independent and later other archs
> >> can make use of it.
> >
> > Will that really happen?  Do you have patches that do that?  I'd prefer
> > to not do stuff like this until you have a patch series that needs it,
> > otherwise this is just unneeded churn.
> 
> Yes, foll link has the patch series, (under review)
> http://www.spinics.net/lists/arm-kernel/msg336896.html

Make this patch 1/3 of that series and resend, I don't want to take this
one if the others are not accepted.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
@ 2014-06-04 18:59         ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2014-06-04 18:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 05, 2014 at 12:16:28AM +0530, Ritesh Harjani wrote:
> Hi Greg,
> 
> Thanks for reviewing.
> 
> On Wed, Jun 4, 2014 at 11:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Wed, Jun 04, 2014 at 01:41:46PM +0530, ritesh.harjani at gmail.com wrote:
> >> From: Ritesh Harjani <ritesh.harjani@gmail.com>
> >>
> >> This patch moves out *mapping pointer of dma_iommu_mapping
> >> from arch/arm/include/asm/device.h to include/liunux/device.h
> >
> > Why?  Who else can use this becides arm devices?
> 
> Currently only arm and arm64 are the archs at this very moment but
> later other archs can make use of this, as its an arch independent
> code. (Similar to as some arch make use of iommu_area_alloc in
> iommu-helper.c)
> 
> >
> >>
> >> Also, it moves out complete structre definition of dma_iommu_mapping
> >> to include/linux/iommu-helper.h
> >>
> >> This is done since arm iommu's dma-mapping arch independent code,
> >> needs to be moved out to lib/iommu-helper.c, this means
> >> dma_iommu_mapping will be arch independent and later other archs
> >> can make use of it.
> >
> > Will that really happen?  Do you have patches that do that?  I'd prefer
> > to not do stuff like this until you have a patch series that needs it,
> > otherwise this is just unneeded churn.
> 
> Yes, foll link has the patch series, (under review)
> http://www.spinics.net/lists/arm-kernel/msg336896.html

Make this patch 1/3 of that series and resend, I don't want to take this
one if the others are not accepted.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
  2014-06-04 18:46       ` [PATCH 1/1] device.h: arm, dma-iommu: " Ritesh Harjani
@ 2014-06-04 19:01         ` Greg KH
  -1 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2014-06-04 19:01 UTC (permalink / raw)
  To: Ritesh Harjani
  Cc: Catalin Marinas, Will Deacon, Marek Szyprowski, Russell King,
	linux-arm-kernel, linux-kernel

On Thu, Jun 05, 2014 at 12:16:28AM +0530, Ritesh Harjani wrote:
> >> --- a/include/linux/device.h
> >> +++ b/include/linux/device.h
> >> @@ -705,6 +705,10 @@ struct device {
> >>       /* arch specific additions */
> >>       struct dev_archdata     archdata;
> >>
> >> +#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
> >> +     struct dma_iommu_mapping        *mapping;
> >> +#endif
> >> +
> >>       struct device_node      *of_node; /* associated device tree node */
> >>       struct acpi_dev_node    acpi_node; /* associated ACPI device node */
> >>
> >
> > Are you sure this will not break the build on systems that enable that
> > option, yet do not include iommu-helper.h?
> 
> They need to include iommu-helper.h wherever they are using this
> structure members. Until then no this should
> not break the build I think for the case you mentioned.

Try it and find out :)

> That's how it was done in arch/arm/include/asm/device.h

Perhaps something else was pulling in that .h file?  device.h is used
_everywhere_ you can not assume someone will have included another .h
file before it.

> Do I need to do this in diff way ?

Yes, just predefine the structure in the .h file.

And do you really need the #ifdef?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
@ 2014-06-04 19:01         ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2014-06-04 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 05, 2014 at 12:16:28AM +0530, Ritesh Harjani wrote:
> >> --- a/include/linux/device.h
> >> +++ b/include/linux/device.h
> >> @@ -705,6 +705,10 @@ struct device {
> >>       /* arch specific additions */
> >>       struct dev_archdata     archdata;
> >>
> >> +#ifdef CONFIG_DMA_USE_IOMMU_HELPER_MAPPING
> >> +     struct dma_iommu_mapping        *mapping;
> >> +#endif
> >> +
> >>       struct device_node      *of_node; /* associated device tree node */
> >>       struct acpi_dev_node    acpi_node; /* associated ACPI device node */
> >>
> >
> > Are you sure this will not break the build on systems that enable that
> > option, yet do not include iommu-helper.h?
> 
> They need to include iommu-helper.h wherever they are using this
> structure members. Until then no this should
> not break the build I think for the case you mentioned.

Try it and find out :)

> That's how it was done in arch/arm/include/asm/device.h

Perhaps something else was pulling in that .h file?  device.h is used
_everywhere_ you can not assume someone will have included another .h
file before it.

> Do I need to do this in diff way ?

Yes, just predefine the structure in the .h file.

And do you really need the #ifdef?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] device.h: arm,dma-iommu: Move out dma_iommu_mapping struct
  2014-06-04 18:59         ` Greg KH
@ 2014-06-05  9:18           ` Ritesh Harjani
  -1 siblings, 0 replies; 14+ messages in thread
From: Ritesh Harjani @ 2014-06-05  9:18 UTC (permalink / raw)
  To: Greg KH
  Cc: Catalin Marinas, Will Deacon, Marek Szyprowski, Russell King,
	linux-arm-kernel, linux-kernel

Hi Greg,

On Thu, Jun 5, 2014 at 12:29 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Jun 05, 2014 at 12:16:28AM +0530, Ritesh Harjani wrote:
>> Hi Greg,
>>
>> Thanks for reviewing.
>>
>> On Wed, Jun 4, 2014 at 11:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > On Wed, Jun 04, 2014 at 01:41:46PM +0530, ritesh.harjani@gmail.com wrote:
>> >> From: Ritesh Harjani <ritesh.harjani@gmail.com>
>> >>
>> >> This patch moves out *mapping pointer of dma_iommu_mapping
>> >> from arch/arm/include/asm/device.h to include/liunux/device.h
>> >
>> > Why?  Who else can use this becides arm devices?
>>
>> Currently only arm and arm64 are the archs at this very moment but
>> later other archs can make use of this, as its an arch independent
>> code. (Similar to as some arch make use of iommu_area_alloc in
>> iommu-helper.c)
>>
>> >
>> >>
>> >> Also, it moves out complete structre definition of dma_iommu_mapping
>> >> to include/linux/iommu-helper.h
>> >>
>> >> This is done since arm iommu's dma-mapping arch independent code,
>> >> needs to be moved out to lib/iommu-helper.c, this means
>> >> dma_iommu_mapping will be arch independent and later other archs
>> >> can make use of it.
>> >
>> > Will that really happen?  Do you have patches that do that?  I'd prefer
>> > to not do stuff like this until you have a patch series that needs it,
>> > otherwise this is just unneeded churn.
>>
>> Yes, foll link has the patch series, (under review)
>> http://www.spinics.net/lists/arm-kernel/msg336896.html
>
> Make this patch 1/3 of that series and resend, I don't want to take this
> one if the others are not accepted.

Sure I will do that.

>
> thanks,
>
> greg k-h

Thanks
Ritesh

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] device.h: arm, dma-iommu: Move out dma_iommu_mapping struct
@ 2014-06-05  9:18           ` Ritesh Harjani
  0 siblings, 0 replies; 14+ messages in thread
From: Ritesh Harjani @ 2014-06-05  9:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Greg,

On Thu, Jun 5, 2014 at 12:29 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Jun 05, 2014 at 12:16:28AM +0530, Ritesh Harjani wrote:
>> Hi Greg,
>>
>> Thanks for reviewing.
>>
>> On Wed, Jun 4, 2014 at 11:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > On Wed, Jun 04, 2014 at 01:41:46PM +0530, ritesh.harjani at gmail.com wrote:
>> >> From: Ritesh Harjani <ritesh.harjani@gmail.com>
>> >>
>> >> This patch moves out *mapping pointer of dma_iommu_mapping
>> >> from arch/arm/include/asm/device.h to include/liunux/device.h
>> >
>> > Why?  Who else can use this becides arm devices?
>>
>> Currently only arm and arm64 are the archs at this very moment but
>> later other archs can make use of this, as its an arch independent
>> code. (Similar to as some arch make use of iommu_area_alloc in
>> iommu-helper.c)
>>
>> >
>> >>
>> >> Also, it moves out complete structre definition of dma_iommu_mapping
>> >> to include/linux/iommu-helper.h
>> >>
>> >> This is done since arm iommu's dma-mapping arch independent code,
>> >> needs to be moved out to lib/iommu-helper.c, this means
>> >> dma_iommu_mapping will be arch independent and later other archs
>> >> can make use of it.
>> >
>> > Will that really happen?  Do you have patches that do that?  I'd prefer
>> > to not do stuff like this until you have a patch series that needs it,
>> > otherwise this is just unneeded churn.
>>
>> Yes, foll link has the patch series, (under review)
>> http://www.spinics.net/lists/arm-kernel/msg336896.html
>
> Make this patch 1/3 of that series and resend, I don't want to take this
> one if the others are not accepted.

Sure I will do that.

>
> thanks,
>
> greg k-h

Thanks
Ritesh

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-06-05  9:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-04  8:11 [PATCH 0/1] device.h: Move out arch independent dma_iommu_mapping struct ritesh.harjani
2014-06-04  8:11 ` ritesh.harjani at gmail.com
2014-06-04  8:11 ` [PATCH 1/1] device.h: arm,dma-iommu: Move out " ritesh.harjani
2014-06-04  8:11   ` [PATCH 1/1] device.h: arm, dma-iommu: " ritesh.harjani at gmail.com
2014-06-04 17:51   ` [PATCH 1/1] device.h: arm,dma-iommu: " Greg KH
2014-06-04 17:51     ` Greg KH
2014-06-04 18:46     ` Ritesh Harjani
2014-06-04 18:46       ` [PATCH 1/1] device.h: arm, dma-iommu: " Ritesh Harjani
2014-06-04 18:59       ` [PATCH 1/1] device.h: arm,dma-iommu: " Greg KH
2014-06-04 18:59         ` Greg KH
2014-06-05  9:18         ` Ritesh Harjani
2014-06-05  9:18           ` [PATCH 1/1] device.h: arm, dma-iommu: " Ritesh Harjani
2014-06-04 19:01       ` [PATCH 1/1] device.h: arm,dma-iommu: " Greg KH
2014-06-04 19:01         ` Greg KH

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.