* Re: [PATCH 4/4] drivers: dma-contiguous: add initialization from device tree
[not found] ` <00b501cf974c$2db1a800$8914f800$@lge.com>
@ 2014-07-07 10:36 ` Marek Szyprowski
0 siblings, 0 replies; only message in thread
From: Marek Szyprowski @ 2014-07-07 10:36 UTC (permalink / raw)
To: Joonsoo Kim, linux-kernel, linux-arm-kernel, linaro-mm-sig,
devicetree, linux-doc
Cc: 'Benjamin Herrenschmidt', 'Arnd Bergmann',
'Michal Nazarewicz', 'Grant Likely',
'Tomasz Figa', 'Sascha Hauer',
'Laura Abbott', 'Rob Herring',
'Olof Johansson', 'Pawel Moll',
'Mark Rutland', 'Stephen Warren',
'Ian Campbell', 'Tomasz Figa',
'Kumar Gala', 'Nishanth Peethambaran',
'Marc', 'Josh Cartwright',
'Catalin Marinas', 'Will Deacon',
'Paul Mackerras', 'Jon Medhurst',
'Aneesh Kumar K.V.', 'Andrew Morton'
Hello,
On 2014-07-04 07:52, Joonsoo Kim wrote:
>> -----Original Message-----
>> From: Marek Szyprowski [mailto:m.szyprowski@samsung.com]
>> Sent: Wednesday, July 02, 2014 7:49 PM
>>
>> Subject: [PATCH 4/4] drivers: dma-contiguous: add initialization from
>> device tree
>>
>> Add a code to create CMA region from reserved memory and add support for
>> handling 'shared-dma-pool' reserved-memory device tree nodes.
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> ---
>> drivers/base/dma-contiguous.c | 67
>> +++++++++++++++++++++++++++++++++++++++++
>> include/linux/cma.h | 3 ++
>> mm/cma.c | 69
> ++++++++++++++++++++++++++++++++-----------
>> 3 files changed, 122 insertions(+), 17 deletions(-)
>>
...
>> +/**
>> * cma_declare_contiguous() - reserve custom contiguous area
>> * @base: Base address of the reserved area optional, use 0 for any
>> * @size: Size of the reserved area (in bytes),
>> @@ -162,18 +210,12 @@ int __init cma_declare_contiguous(phys_addr_t base,
>> phys_addr_t alignment, unsigned int order_per_bit,
>> bool fixed, struct cma **res_cma)
>> {
>> - struct cma *cma;
>> - int ret = 0;
>> + int ret;
>>
>> pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n",
>> __func__, (unsigned long)size, (unsigned long)base,
>> (unsigned long)limit, (unsigned long)alignment);
>>
>> - if (cma_area_count == ARRAY_SIZE(cma_areas)) {
>> - pr_err("Not enough slots for CMA reserved regions!\n");
>> - return -ENOSPC;
>> - }
>> -
> Hello, Marek.
>
> After this change, if we have not enough cma_areas, memory will leak.
> I think that we need separate function to check constraint and this
> function should be called before reserving memory in
> cma_declare_contiguous().
Well, I will leave this check to avoid memory leak then.
> BTW, this mail doesn't appear in LKML. What happens? :)
I have no idea, I will send second version then.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-07 10:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1404298132-6050-1-git-send-email-m.szyprowski@samsung.com>
[not found] ` <1404298132-6050-5-git-send-email-m.szyprowski@samsung.com>
[not found] ` <00b501cf974c$2db1a800$8914f800$@lge.com>
2014-07-07 10:36 ` [PATCH 4/4] drivers: dma-contiguous: add initialization from device tree Marek Szyprowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox