From: Pankaj Suryawanshi <pankajssuryawanshi@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Christoph Hellwig <hch@infradead.org>,
linux-mm@kvack.org, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, Vlastimil Babka <vbabka@suse.cz>,
Michal Hocko <mhocko@kernel.org>
Subject: Re: DMA-API attr - DMA_ATTR_NO_KERNEL_MAPPING
Date: Mon, 1 Jul 2019 23:37:24 +0530 [thread overview]
Message-ID: <CACDBo56taTYwSvzH9ZPbTzPM6gMzknki94QsAoo+oNkyCLkTMA@mail.gmail.com> (raw)
In-Reply-To: <0725b9aa-0523-daef-b4ff-7e2dd910cf3c@arm.com>
On Mon, Jul 1, 2019 at 11:24 PM Robin Murphy <robin.murphy@arm.com> wrote:
>
> On 01/07/2019 18:47, Pankaj Suryawanshi wrote:
> >> If you want a kernel mapping, *don't* explicitly request not to have a
> >> kernel mapping in the first place. It's that simple.
> >>
> >
> > Do you mean do not use dma-api ? because if i used dma-api it will give you
> > mapped virtual address.
> > or i have to use directly cma_alloc() in my driver. // if i used this
> > approach i need to reserved more vmalloc area.
>
> No, I mean just call dma_alloc_attrs() normally *without* adding the
> DMA_ATTR_NO_KERNEL_MAPPING flag. That flag means "I never ever want to
> make CPU accesses to this buffer from the kernel" - that is clearly not
> the case for your code, so it is utterly nonsensical to still pass the
> flag but try to hack around it later.
Actually my use case is that i want virtual mapping only when i will
play video as my vpu/gpu driver is design like that.
and i am using 32-bit so virtual memory is splitted as 3G/1G so dont
have enough memory for all the time to mapped with kernel space.
Lets say i am allocating 400MB for driver but i want only 30MB for
virtual mapping (not everytime) that is the case.
>
>
> Robin.
next prev parent reply other threads:[~2019-07-01 18:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 16:41 Pankaj Suryawanshi
2019-06-26 16:42 ` Pankaj Suryawanshi
2019-06-26 17:51 ` Christoph Hellwig
2019-06-28 16:29 ` Pankaj Suryawanshi
2019-07-01 14:09 ` Robin Murphy
2019-07-01 17:47 ` Pankaj Suryawanshi
2019-07-01 17:52 ` Pankaj Suryawanshi
2019-07-01 17:54 ` Robin Murphy
2019-07-01 18:07 ` Pankaj Suryawanshi [this message]
2019-07-01 18:36 ` Pankaj Suryawanshi
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=CACDBo56taTYwSvzH9ZPbTzPM6gMzknki94QsAoo+oNkyCLkTMA@mail.gmail.com \
--to=pankajssuryawanshi@gmail.com \
--cc=hch@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=robin.murphy@arm.com \
--cc=vbabka@suse.cz \
/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