* [PATCH] arm: dma mapping: export arm iommu functions
@ 2012-12-27 7:14 Prathyush K
2012-12-27 14:15 ` Marek Szyprowski
0 siblings, 1 reply; 5+ messages in thread
From: Prathyush K @ 2012-12-27 7:14 UTC (permalink / raw)
To: linux-arm-kernel, linaro-mm-sig, linux-mm; +Cc: m.szyprowski, prathyush
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.
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
---
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);
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
--
1.8.0
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] arm: dma mapping: export arm iommu functions
2012-12-27 7:14 [PATCH] arm: dma mapping: export arm iommu functions Prathyush K
@ 2012-12-27 14:15 ` Marek Szyprowski
2012-12-28 4:23 ` Prathyush K
0 siblings, 1 reply; 5+ messages in thread
From: Marek Szyprowski @ 2012-12-27 14:15 UTC (permalink / raw)
To: Prathyush K; +Cc: linux-arm-kernel, linaro-mm-sig, linux-mm, prathyush
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?
> Signed-off-by: Prathyush K <prathyush.k@samsung.com>
> ---
> 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() ?
> 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
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] arm: dma mapping: export arm iommu functions
2012-12-27 14:15 ` Marek Szyprowski
@ 2012-12-28 4:23 ` Prathyush K
2012-12-29 6:53 ` Olof Johansson
0 siblings, 1 reply; 5+ messages in thread
From: Prathyush K @ 2012-12-28 4:23 UTC (permalink / raw)
To: Marek Szyprowski; +Cc: Prathyush K, linux-arm-kernel, linaro-mm-sig, linux-mm
[-- Attachment #1: Type: text/plain, Size: 2033 bytes --]
On Thu, Dec 27, 2012 at 7:45 PM, Marek Szyprowski
<m.szyprowski@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
> 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 <prathyush.k@samsung.com>
>> ---
>> 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
[-- Attachment #2: Type: text/html, Size: 4018 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] arm: dma mapping: export arm iommu functions
2012-12-28 4:23 ` Prathyush K
@ 2012-12-29 6:53 ` Olof Johansson
2013-01-01 1:07 ` Subash Patel
0 siblings, 1 reply; 5+ messages in thread
From: Olof Johansson @ 2012-12-29 6:53 UTC (permalink / raw)
To: Prathyush K
Cc: Marek Szyprowski, Prathyush K, linux-arm-kernel, linaro-mm-sig,
linux-mm
On Fri, Dec 28, 2012 at 09:53:47AM +0530, Prathyush K wrote:
> On Thu, Dec 27, 2012 at 7:45 PM, Marek Szyprowski
> <m.szyprowski@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
> > 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);
The driver shouldn't have to call these low-level functions directly,
something's wrong if you need that.
How is the DMA address management different here from other system/io mmus? is
that 256M window a hardware restriction?
-Olof
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] arm: dma mapping: export arm iommu functions
2012-12-29 6:53 ` Olof Johansson
@ 2013-01-01 1:07 ` Subash Patel
0 siblings, 0 replies; 5+ messages in thread
From: Subash Patel @ 2013-01-01 1:07 UTC (permalink / raw)
To: Olof Johansson
Cc: Prathyush K, Marek Szyprowski, Prathyush K, linux-arm-kernel,
linaro-mm-sig, linux-mm
On Friday 28 December 2012 10:53 PM, Olof Johansson wrote:
> On Fri, Dec 28, 2012 at 09:53:47AM +0530, Prathyush K wrote:
>> On Thu, Dec 27, 2012 at 7:45 PM, Marek Szyprowski
>> <m.szyprowski@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
>>> 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);
>
> The driver shouldn't have to call these low-level functions directly,
> something's wrong if you need that.
These are not truly low-level calls, but arm specific wrappers to the
dma-mapping implementations. Drivers need to call former to declare
mappings requirement needed for their IOMMU and later to start using it.
>
> How is the DMA address management different here from other system/io mmus? is
> that 256M window a hardware restriction?
No, each IOMMU is capable of 4G. But to keep the IOMMU address space to
what is required, various sizes were used earlier and later fixed on to
256M. This can be increased if the drivers demand more buffers mapped to
the device at anytime.
Regards,
Subash
>
> -Olof
>
> --
> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-01-01 1:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-27 7:14 [PATCH] arm: dma mapping: export arm iommu functions Prathyush K
2012-12-27 14:15 ` Marek Szyprowski
2012-12-28 4:23 ` Prathyush K
2012-12-29 6:53 ` Olof Johansson
2013-01-01 1:07 ` Subash Patel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).