Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1406617 > unrolled thread
| Started by | Jaewon Kim <jaewon31.kim@samsung.com> |
|---|---|
| First post | 2016-05-25 06:40 +0200 |
| Last post | 2016-05-27 10:00 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[RESEND][PATCH] drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent Jaewon Kim <jaewon31.kim@samsung.com> - 2016-05-25 06:40 +0200
Re: [RESEND][PATCH] drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent Rob Herring <robh+dt@kernel.org> - 2016-05-25 16:40 +0200
Re: [RESEND][PATCH] drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent Marek Szyprowski <m.szyprowski@samsung.com> - 2016-05-27 10:00 +0200
| From | Jaewon Kim <jaewon31.kim@samsung.com> |
|---|---|
| Date | 2016-05-25 06:40 +0200 |
| Subject | [RESEND][PATCH] drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent |
| Message-ID | <rCyLT-4WT-1@gated-at.bofh.it> |
From: Jaewon <jaewon31.kim@samsung.com>
There was an alignment mismatch issue for CMA and it was fixed by
commit 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup").
However the way of the commit considers not only dma-contiguous(CMA) but also
dma-coherent which has no that requirement.
This patch checks more to distinguish dma-contiguous(CMA) from dma-coherent.
Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
---
drivers/of/of_reserved_mem.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index ed01c01..45b873e 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -127,7 +127,10 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
}
/* Need adjust the alignment to satisfy the CMA requirement */
- if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool"))
+ if (IS_ENABLED(CONFIG_CMA)
+ && of_flat_dt_is_compatible(node, "shared-dma-pool")
+ && of_get_flat_dt_prop(node, "reusable", NULL)
+ && !of_get_flat_dt_prop(node, "no-map", NULL)) {
align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
prop = of_get_flat_dt_prop(node, "alloc-ranges", &len);
--
1.9.1
[toc] | [next] | [standalone]
| From | Rob Herring <robh+dt@kernel.org> |
|---|---|
| Date | 2016-05-25 16:40 +0200 |
| Subject | Re: [RESEND][PATCH] drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent |
| Message-ID | <rCI8x-25o-1@gated-at.bofh.it> |
| In reply to | #1406617 |
On Tue, May 24, 2016 at 11:29 PM, Jaewon Kim <jaewon31.kim@samsung.com> wrote:
> From: Jaewon <jaewon31.kim@samsung.com>
>
> There was an alignment mismatch issue for CMA and it was fixed by
> commit 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup").
> However the way of the commit considers not only dma-contiguous(CMA) but also
> dma-coherent which has no that requirement.
>
> This patch checks more to distinguish dma-contiguous(CMA) from dma-coherent.
>
> Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
I suppose this needs to go to stable? If so, adding the stable tag and
kernel version would be nice so I don't have to.
> ---
> drivers/of/of_reserved_mem.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
I'm looking for an ack from Marek on this.
Rob
[toc] | [prev] | [next] | [standalone]
| From | Marek Szyprowski <m.szyprowski@samsung.com> |
|---|---|
| Date | 2016-05-27 10:00 +0200 |
| Subject | Re: [RESEND][PATCH] drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent |
| Message-ID | <rDkQx-BQ-13@gated-at.bofh.it> |
| In reply to | #1406953 |
Hello,
On 2016-05-25 16:38, Rob Herring wrote:
> On Tue, May 24, 2016 at 11:29 PM, Jaewon Kim <jaewon31.kim@samsung.com> wrote:
>> From: Jaewon <jaewon31.kim@samsung.com>
>>
>> There was an alignment mismatch issue for CMA and it was fixed by
>> commit 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup").
>> However the way of the commit considers not only dma-contiguous(CMA) but also
>> dma-coherent which has no that requirement.
>>
>> This patch checks more to distinguish dma-contiguous(CMA) from dma-coherent.
>>
>> Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
> I suppose this needs to go to stable? If so, adding the stable tag and
> kernel version would be nice so I don't have to.
>
>> ---
>> drivers/of/of_reserved_mem.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
> I'm looking for an ack from Marek on this.
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web