All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, iommu@lists.linux-foundation.org,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/4] vmalloc: lift the arm flag for coherent mappings to common code
Date: Fri, 30 Aug 2019 16:59:35 +0200	[thread overview]
Message-ID: <20190830145935.GA19838@lst.de> (raw)
In-Reply-To: <20190830092918.GV13294@shell.armlinux.org.uk>

On Fri, Aug 30, 2019 at 10:29:18AM +0100, Russell King - ARM Linux admin wrote:
> On Fri, Aug 30, 2019 at 08:29:21AM +0200, Christoph Hellwig wrote:
> > The arm architecture had a VM_ARM_DMA_CONSISTENT flag to mark DMA
> > coherent remapping for a while.  Lift this flag to common code so
> > that we can use it generically.  We also check it in the only place
> > VM_USERMAP is directly check so that we can entirely replace that
> > flag as well (although I'm not even sure why we'd want to allow
> > remapping DMA appings, but I'd rather not change behavior).
> 
> Good, because if you did change that behaviour, you'd break almost
> every ARM framebuffer and cripple ARM audio drivers.

How would that break them?  All the usual video and audio drivers that
use dma_alloc_* then use dma_mmap_* which never end up in the only place
that actually checks VM_USERMAP (remap_vmalloc_range_partial) as they
end up in the dma_map_ops mmap methods which contain what is effecitvely
open coded versions of that routine.  There are very few callers of
remap_vmalloc_range_partial / remap_vmalloc_range, and while a few of
those actually are in media drivers and the virtual frame buffer video
driver, none of these seems to be called on dma memory (which would
be a layering violation anyway).
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, iommu@lists.linux-foundation.org,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/4] vmalloc: lift the arm flag for coherent mappings to common code
Date: Fri, 30 Aug 2019 16:59:35 +0200	[thread overview]
Message-ID: <20190830145935.GA19838@lst.de> (raw)
In-Reply-To: <20190830092918.GV13294@shell.armlinux.org.uk>

On Fri, Aug 30, 2019 at 10:29:18AM +0100, Russell King - ARM Linux admin wrote:
> On Fri, Aug 30, 2019 at 08:29:21AM +0200, Christoph Hellwig wrote:
> > The arm architecture had a VM_ARM_DMA_CONSISTENT flag to mark DMA
> > coherent remapping for a while.  Lift this flag to common code so
> > that we can use it generically.  We also check it in the only place
> > VM_USERMAP is directly check so that we can entirely replace that
> > flag as well (although I'm not even sure why we'd want to allow
> > remapping DMA appings, but I'd rather not change behavior).
> 
> Good, because if you did change that behaviour, you'd break almost
> every ARM framebuffer and cripple ARM audio drivers.

How would that break them?  All the usual video and audio drivers that
use dma_alloc_* then use dma_mmap_* which never end up in the only place
that actually checks VM_USERMAP (remap_vmalloc_range_partial) as they
end up in the dma_map_ops mmap methods which contain what is effecitvely
open coded versions of that routine.  There are very few callers of
remap_vmalloc_range_partial / remap_vmalloc_range, and while a few of
those actually are in media drivers and the virtual frame buffer video
driver, none of these seems to be called on dma memory (which would
be a layering violation anyway).

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>,
	iommu@lists.linux-foundation.org,
	Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-xtensa@linux-xtensa.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] vmalloc: lift the arm flag for coherent mappings to common code
Date: Fri, 30 Aug 2019 16:59:35 +0200	[thread overview]
Message-ID: <20190830145935.GA19838@lst.de> (raw)
In-Reply-To: <20190830092918.GV13294@shell.armlinux.org.uk>

On Fri, Aug 30, 2019 at 10:29:18AM +0100, Russell King - ARM Linux admin wrote:
> On Fri, Aug 30, 2019 at 08:29:21AM +0200, Christoph Hellwig wrote:
> > The arm architecture had a VM_ARM_DMA_CONSISTENT flag to mark DMA
> > coherent remapping for a while.  Lift this flag to common code so
> > that we can use it generically.  We also check it in the only place
> > VM_USERMAP is directly check so that we can entirely replace that
> > flag as well (although I'm not even sure why we'd want to allow
> > remapping DMA appings, but I'd rather not change behavior).
> 
> Good, because if you did change that behaviour, you'd break almost
> every ARM framebuffer and cripple ARM audio drivers.

How would that break them?  All the usual video and audio drivers that
use dma_alloc_* then use dma_mmap_* which never end up in the only place
that actually checks VM_USERMAP (remap_vmalloc_range_partial) as they
end up in the dma_map_ops mmap methods which contain what is effecitvely
open coded versions of that routine.  There are very few callers of
remap_vmalloc_range_partial / remap_vmalloc_range, and while a few of
those actually are in media drivers and the virtual frame buffer video
driver, none of these seems to be called on dma memory (which would
be a layering violation anyway).


  reply	other threads:[~2019-08-30 15:01 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30  6:29 cleanup vmap usage in the dma-mapping layer Christoph Hellwig
2019-08-30  6:29 ` Christoph Hellwig
2019-08-30  6:29 ` Christoph Hellwig
2019-08-30  6:29 ` [PATCH 1/4] vmalloc: lift the arm flag for coherent mappings to common code Christoph Hellwig
2019-08-30  6:29   ` Christoph Hellwig
2019-08-30  6:29   ` Christoph Hellwig
2019-08-30  9:29   ` Russell King - ARM Linux admin
2019-08-30  9:29     ` Russell King - ARM Linux admin
2019-08-30  9:29     ` Russell King - ARM Linux admin
2019-08-30 14:59     ` Christoph Hellwig [this message]
2019-08-30 14:59       ` Christoph Hellwig
2019-08-30 14:59       ` Christoph Hellwig
2019-08-30  6:29 ` [PATCH 2/4] dma-mapping: always use VM_DMA_COHERENT for generic DMA remap Christoph Hellwig
2019-08-30  6:29   ` Christoph Hellwig
2019-08-30  6:29   ` Christoph Hellwig
2019-08-30  6:29 ` [PATCH 3/4] dma-mapping: introduce a dma_common_find_pages helper Christoph Hellwig
2019-08-30  6:29   ` Christoph Hellwig
2019-08-30  6:29   ` Christoph Hellwig
2019-10-02 12:05   ` Geert Uytterhoeven
2019-10-02 12:05     ` Geert Uytterhoeven
2019-10-02 12:05     ` Geert Uytterhoeven
2019-10-02 16:45     ` Robin Murphy
2019-10-02 16:45       ` Robin Murphy
2019-10-02 16:45       ` Robin Murphy
2019-10-06 18:45     ` Christoph Hellwig
2019-10-06 18:45       ` Christoph Hellwig
2019-10-06 18:45       ` Christoph Hellwig
2019-10-07  7:35       ` Geert Uytterhoeven
2019-10-07  7:35         ` Geert Uytterhoeven
2019-10-07  7:35         ` Geert Uytterhoeven
2019-08-30  6:29 ` [PATCH 4/4] arm: remove wrappers for the generic dma remap helpers Christoph Hellwig
2019-08-30  6:29   ` Christoph Hellwig
2019-08-30  6:29   ` Christoph Hellwig

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=20190830145935.GA19838@lst.de \
    --to=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=linux@armlinux.org.uk \
    --cc=robin.murphy@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.