From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx136.postini.com [74.125.245.136]) by kanga.kvack.org (Postfix) with SMTP id 62D5B8D0001 for ; Thu, 27 Dec 2012 23:23:48 -0500 (EST) Received: by mail-da0-f45.google.com with SMTP id w4so4593792dam.18 for ; Thu, 27 Dec 2012 20:23:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <50DC580C.7080507@samsung.com> References: <1356592458-11077-1-git-send-email-prathyush.k@samsung.com> <50DC580C.7080507@samsung.com> Date: Fri, 28 Dec 2012 09:53:47 +0530 Message-ID: Subject: Re: [PATCH] arm: dma mapping: export arm iommu functions From: Prathyush K Content-Type: multipart/alternative; boundary=f46d042dff519c652c04d1e20725 Sender: owner-linux-mm@kvack.org List-ID: To: Marek Szyprowski Cc: Prathyush K , linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org --f46d042dff519c652c04d1e20725 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Dec 27, 2012 at 7:45 PM, Marek Szyprowski wrote: > Hello, > > > On 12/27/2012 8:14 AM, Prathyush K wrote: > >> This patch adds EXPORT_SYMBOL calls to the three arm iommu >> functions - arm_iommu_create_mapping, arm_iommu_free_mapping >> and arm_iommu_attach_device. These functions can now be called >> from dynamic modules. >> > > Could You describe a bit more why those functions might be needed by > dynamic modules? > > Hi Marek, We are adding iommu support to exynos gsc and s5p-mfc. And these two drivers need to be built as modules to improve boot time. We're calling these three functions from inside these drivers: e.g. mapping = arm_iommu_create_mapping(&platform_bus_type, 0x20000000, SZ_256M, 4); arm_iommu_attach_device(mdev, mapping); > > Signed-off-by: Prathyush K >> --- >> arch/arm/mm/dma-mapping.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c >> index 6b2fb87..c0f0f43 100644 >> --- a/arch/arm/mm/dma-mapping.c >> +++ b/arch/arm/mm/dma-mapping.c >> @@ -1797,6 +1797,7 @@ err2: >> err: >> return ERR_PTR(err); >> } >> +EXPORT_SYMBOL(arm_iommu_**create_mapping); >> > > EXPORT_SYMOBL_GPL() ? > > Right, it should be EXPORT_SYMOBL_GPL(). Will update in next patch. > > static void release_iommu_mapping(struct kref *kref) >> { >> @@ -1813,6 +1814,7 @@ void arm_iommu_release_mapping(**struct >> dma_iommu_mapping *mapping) >> if (mapping) >> kref_put(&mapping->kref, release_iommu_mapping); >> } >> +EXPORT_SYMBOL(arm_iommu_**release_mapping); >> /** >> * arm_iommu_attach_device >> @@ -1841,5 +1843,6 @@ int arm_iommu_attach_device(struct device *dev, >> pr_debug("Attached IOMMU controller to %s device.\n", >> dev_name(dev)); >> return 0; >> } >> +EXPORT_SYMBOL(arm_iommu_**attach_device); >> #endif >> > > Best regards > -- > Marek Szyprowski > Samsung Poland R&D Center > > > Regards, Prathyush --f46d042dff519c652c04d1e20725 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Thu, Dec 27, 2012 at 7:45 PM, Marek Szyprowski <m.szypro= wski@samsung.com> wrote:
Hello,


On 12/27/2012 8:14 AM, Prathyush K wrote:
This patch adds EXPORT_SYMBOL calls to the three arm iommu
functions - arm_iommu_create_mapping, arm_iommu_free_mapping
and arm_iommu_attach_device. These functions can now be called
from dynamic modules.

Could You describe a bit more why those functions might be needed by dynami= c modules?

Hi Marek,

We are adding iommu support to exynos gsc and s5p-mfc.
And these two drivers need to be built as modules to improve boot time.

We're calling these three functions f= rom inside these drivers:
e.g.
mapping= =3D arm_iommu_create_mapping(&platform_bus_type, 0x20000000,=A0SZ_256M= , 4);
arm_iommu_attach_device(mdev, mapping);

=A0

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
---
=A0 arch/arm/mm/dma-mapping.c | 3 +++
=A0 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 6b2fb87..c0f0f43 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1797,6 +1797,7 @@ err2:
=A0 err:
=A0 =A0 =A0 =A0 return ERR_PTR(err);
=A0 }
+EXPORT_SYMBOL(arm_iommu_create_mapping);

EXPORT_SYMOBL_GPL() ?


= Right, it should be=A0EXPORT_SYMOBL_GPL().

Will update in next patch.

=A0

=A0 static void release_iommu_mapping(struct kref *kref)
=A0 {
@@ -1813,6 +1814,7 @@ void arm_iommu_release_mapping(struct dma_iomm= u_mapping *mapping)
=A0 =A0 =A0 =A0 if (mapping)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 kref_put(&mapping->kref, release_iom= mu_mapping);
=A0 }
+EXPORT_SYMBOL(arm_iommu_release_mapping);
=A0 =A0 /**
=A0 =A0* arm_iommu_attach_device
@@ -1841,5 +1843,6 @@ int arm_iommu_attach_device(struct device *dev,
=A0 =A0 =A0 =A0 pr_debug("Attached IOMMU controller to %s device.\n&qu= ot;, dev_name(dev));
=A0 =A0 =A0 =A0 return 0;
=A0 }
+EXPORT_SYMBOL(arm_iommu_attach_device);
=A0 =A0 #endif

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center


Regards,
Prathyush



--f46d042dff519c652c04d1e20725-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org