From: vladimir.murzin@arm.com (Vladimir Murzin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] nommu: allow mmap when !CONFIG_MMU
Date: Fri, 9 Dec 2016 15:36:34 +0000 [thread overview]
Message-ID: <584ACF82.5090609@arm.com> (raw)
In-Reply-To: <CA+M3ks67a9H2Ro87mPZ1_3=ucnyWNMMKnr_EW=dLS1kBxuU3Lw@mail.gmail.com>
On 09/12/16 15:27, Benjamin Gaignard wrote:
> + Vladimir
I'm not in DMA, but I can see that with your patch it deviates from
dma_common_mmap(), can you give more context, please?
Cheers
Vladimir
>
> 2016-12-01 14:48 GMT+01:00 Benjamin Gaignard <benjamin.gaignard@linaro.org>:
>> commit ab6494f0c96f ("nommu: Add noMMU support to the DMA API") have
>> add CONFIG_MMU compilation flag but that prohibit to use dma_mmap_wc()
>> when the platform doesn't have MMU.
>>
>> This patch call vm_iomap_memory() in noMMU case to test if addresses
>> are correct and set wma->vm_flags rather than all return an error.
>>
>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: arnd at arndb.de
>> ---
>> 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 ab4f745..230875e 100644
>> --- a/arch/arm/mm/dma-mapping.c
>> +++ b/arch/arm/mm/dma-mapping.c
>> @@ -868,6 +868,9 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
>> vma->vm_end - vma->vm_start,
>> vma->vm_page_prot);
>> }
>> +#else
>> + ret = vm_iomap_memory(vma, vma->vm_start,
>> + (vma->vm_end - vma->vm_start));
>> #endif /* CONFIG_MMU */
>>
>> return ret;
>> --
>> 1.9.1
>>
>
next prev parent reply other threads:[~2016-12-09 15:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 13:48 [PATCH] nommu: allow mmap when !CONFIG_MMU Benjamin Gaignard
2016-12-09 15:27 ` Benjamin Gaignard
2016-12-09 15:36 ` Vladimir Murzin [this message]
2016-12-09 15:47 ` Benjamin Gaignard
2016-12-09 20:02 ` Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=584ACF82.5090609@arm.com \
--to=vladimir.murzin@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).