mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	"linux-snps-arc@lists.infradead.org" 
	<linux-snps-arc@lists.infradead.org>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH v2] arc: Implement arch-specific dma_map_ops.mmap
Date: Tue, 15 Nov 2016 15:45:35 +0000	[thread overview]
Message-ID: <a5cd26c2-519e-c541-8044-b24685df8f35@synopsys.com> (raw)
In-Reply-To: <1478185573-12871-1-git-send-email-abrodkin@synopsys.com>

On 11/3/2016 3:06 PM, Alexey Brodkin wrote:
> We used to use generic implementation of dma_map_ops.mmap which is
> dma_common_mmap() but that only worked for simpler cached mappings when
> vaddr = paddr.
> 
> If a driver requests uncached DMA buffer kernel maps it to virtual
> address so that MMU gets involved and page uncached status takes into
> account. In that case usage of dma_common_mmap() lead to mapping of
> vaddr to vaddr for user-space which is obviously wrong. For more detals
> please refer to verbose explanation here [1].
> 
> So here we implement our own version of mmap() which always deals
> with dma_addr and maps underlying memory to user-space properly
> (note that DMA buffer mapped to user-space is always uncached
> because there's no way to properly manage cache from user-space).
> 
> [1] https://lkml.org/lkml/2016/10/26/973
> 
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: <stable@vger.kernel.org>
> ---

Tested-by: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>

      parent reply	other threads:[~2016-11-15 15:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 15:06 Alexey Brodkin
2016-11-03 17:03 ` Vineet Gupta
2016-11-04  5:33   ` Alexey Brodkin
2016-11-15 15:45 ` Ramiro Oliveira [this message]

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=a5cd26c2-519e-c541-8044-b24685df8f35@synopsys.com \
    --to=ramiro.oliveira@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=m.szyprowski@samsung.com \
    --cc=stable@vger.kernel.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

all inboxes | Powered by JetHome®