Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360541

Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with dma_map_single

From Robin Murphy <robin.murphy@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with dma_map_single
Date 2016-03-18 12:30 +0100
Message-ID <re0Lo-4Z2-11@gated-at.bofh.it> (permalink)
References <rdOhc-4TJ-9@gated-at.bofh.it> <rdP3B-5d9-47@gated-at.bofh.it> <rdPmW-5Fn-11@gated-at.bofh.it> <rdPZE-5Wl-5@gated-at.bofh.it> <rdZ2W-3Jq-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 18/03/16 09:30, Boris Brezillon wrote:
> On Thu, 17 Mar 2016 23:50:20 +0000
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
>
>> On Thu, Mar 17, 2016 at 07:17:24PM -0400, okaya@codeaurora.org wrote:
>>> What is the correct way? I don't want to write engine->sram_dma = sram
>>
>> Well, what the driver _is_ wanting to do is to go from a CPU physical
>> address to a device DMA address.  phys_to_dma() looks like the correct
>> thing there to me, but I guess that's just an offset and doesn't take
>> account of any IOMMU that may be in the way.
>>
>> If you have an IOMMU, then the whole phys_to_dma() thing is a total
>> failure as it only does a linear translation, and there are no
>> interfaces in the kernel to take account of an IOMMU in the way.  So,
>> it needs something designed for the job, implemented and discussed by
>> the normal methods of proposing a new cross-arch interface for drivers
>> to use.
>>
>> What I'm certain of, though, is that the change proposed in this patch
>> will break current users of this driver: virt_to_page() on an address
>> returned by ioremap() is completely undefined, and will result in
>> either a kernel oops, or if not poking at memory which isn't a struct
>> page, ultimately resulting in something that isn't SRAM being pointed
>> to by "engine->sram_dma".
>>
>
> Or we could just do
>
> 	engine->sram_dma = res->start;
>
> which is pretty much what the SRAM/genalloc code is doing already.

As Russell points out this is yet another type of "set up a DMA master 
to access something other than kernel RAM" - there's already discussion 
in progress over how to handle this for dmaengine slaves[1], so 
gathering more use-cases might help distil exactly what the design of 
not-strictly-DMA-but-so-closely-coupled-it-can't-really-live-anywhere-else 
needs to be.

Robin.

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2016-March/414422.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with dma_map_single Sinan Kaya <okaya@codeaurora.org> - 2016-03-17 23:10 +0100
  [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions Sinan Kaya <okaya@codeaurora.org> - 2016-03-17 23:10 +0100
    Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions Robin Murphy <robin.murphy@arm.com> - 2016-03-18 13:20 +0100
      Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions Sinan Kaya <okaya@codeaurora.org> - 2016-03-18 16:10 +0100
        Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions Konrad Rzeszutek Wilk <konrad@kernel.org> - 2016-03-28 20:30 +0200
          Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma  functions Stefano Stabellini <sstabellini@kernel.org> - 2016-03-29 14:50 +0200
            Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions Sinan Kaya <okaya@codeaurora.org> - 2016-03-29 15:00 +0200
          Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions Arnd Bergmann <arnd@arndb.de> - 2016-03-29 21:40 +0200
  [PATCH 3/3] dma-mapping: move swiotlb dma-phys functions to common header Sinan Kaya <okaya@codeaurora.org> - 2016-03-17 23:10 +0100
    Re: [PATCH 3/3] dma-mapping: move swiotlb dma-phys functions to  common header Robin Murphy <robin.murphy@arm.com> - 2016-03-18 12:40 +0100
      Re: [PATCH 3/3] dma-mapping: move swiotlb dma-phys functions to  common header Sinan Kaya <okaya@codeaurora.org> - 2016-03-18 15:00 +0100
  Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Russell King - ARM Linux <linux@arm.linux.org.uk> - 2016-03-18 00:00 +0100
    Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single okaya@codeaurora.org - 2016-03-18 00:20 +0100
      Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Russell King - ARM Linux <linux@arm.linux.org.uk> - 2016-03-18 01:00 +0100
        Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-03-18 10:40 +0100
          Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Robin Murphy <robin.murphy@arm.com> - 2016-03-18 12:30 +0100
            Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-03-18 12:40 +0100
            Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Sinan Kaya <okaya@codeaurora.org> - 2016-03-18 15:00 +0100
              Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Sinan Kaya <okaya@codeaurora.org> - 2016-03-18 15:10 +0100
              Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Sinan Kaya <okaya@codeaurora.org> - 2016-03-18 15:30 +0100
              Re: [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with  dma_map_single Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-03-18 15:30 +0100

csiph-web