We got rid of the odd selective consistent or not behavior, and now
want the normal dma_sync_single_* functions to be used for strict
ownership transfers. While dma_cache_sync hasn't been removed from
the tree yet it should not be used in any new caller, so documentation
for it is dropped here.
Move the alloc / free routines down the file so that we can easily use
the map / unmap helpers to implement non-consistent allocations.
Also drop the _coherent postfix to match the method name.
Signed-off-by: Christoph Hellwig
---
arch/sparc/kernel/iommu.c | 135
Move the alloc / free routines down the file so that we can easily use
the map / unmap helpers to implement non-consistent allocations.
Also drop the _coherent postfix to match the method name.
Signed-off-by: Christoph Hellwig
---
arch/sparc/kernel/pci_sun4v.c | 229
Just allocate the memory and use map_page to map the memory.
Signed-off-by: Christoph Hellwig
---
arch/sparc/kernel/iommu.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index
For the iommu ops we can just use the implementaton for DMA coherent
devices. For the regular ops we need mix and match a bit so that
we either use the CMA allocator without remapping, but with a special
error handling case for highmem pages, or the simple allocator.
Signed-off-by: Christoph
Hi all,
we had all kinds of discussions about how to best allocate DMAable memory
without having to deal with the problem that your normal "coherent"
DMA allocator can be very slow on platforms where DMA is not DMA
coherent.
To work around this drivers basically two choices at the moment:
(1)
Just allocate the memory and use map_page to map the memory.
Signed-off-by: Christoph Hellwig
---
arch/sparc/kernel/pci_sun4v.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index b95c70136559..24a76ecf2986
There is no need to have an additional kernel mapping for a contiguous
allocation if the device already is DMA coherent, so skip it.
Signed-off-by: Christoph Hellwig
---
arch/arm64/mm/dma-mapping.c | 35 ++-
1 file changed, 22 insertions(+), 13 deletions(-)
diff
Memory declared using dma_declare_coherent is ioremapped and thus not
always suitable for our tightened DMA_ATTR_NON_CONSISTENT definition.
Skip it given all the existing callers don't DMA_ATTR_NON_CONSISTENT
anyway.
Signed-off-by: Christoph Hellwig
---
include/linux/dma-mapping.h | 3 ++-
1
DMA_ATTR_NON_CONSISTENT forces contiguous allocations as we don't
want to remap, and is otherwise forced down the same pass as if we
were always on a coherent device. No new code required except for
a few conditionals.
Signed-off-by: Christoph Hellwig
---
arch/arm64/mm/dma-mapping.c | 18
Factor the code to remap memory returned from the DMA coherent allocator
into two helpers that can be shared by the IOMMU and direct mapping code.
Signed-off-by: Christoph Hellwig
---
arch/sparc/kernel/ioport.c | 151 -
1 file changed, 67 insertions(+), 84
No need to BUG_ON() on the cache maintainance ops - they are no-ops
by default, and there is nothing in the DMA API contract that prohibits
calling them on sbus devices (even if such drivers are unlikely to
ever appear).
Similarly a dma_supported method that always returns 0 is rather
pointless.
It has nothing to do with the content of the pci.h header.
Suggested by: Sam Ravnborg
Signed-off-by: Christoph Hellwig
---
arch/sparc/include/asm/leon.h | 9 +
arch/sparc/include/asm/pci_32.h | 9 -
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git
There is no good reason to have a double indirection for the sparc32
dma ops, so remove the sparc32_dma_ops and define separate dma_map_ops
instance for the different IOMMU types.
Signed-off-by: Christoph Hellwig
---
arch/sparc/include/asm/dma.h | 48 +---
arch/sparc/kernel/ioport.c
[sorry for the spam, had to resend due a wrongly typed linux-arm-kernel
address]
Hi all,
we had all kinds of discussions about how to best allocate DMAable memory
without having to deal with the problem that your normal "coherent"
DMA allocator can be very slow on platforms where DMA is not DMA
The only thing we need to explicitly pull in is the defines for the
CPU type.
Signed-off-by: Christoph Hellwig
---
arch/sparc/include/asm/dma-mapping.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/sparc/include/asm/dma-mapping.h
There are enough common defintions that a single header seems nicer.
Also drop the pointless include.
Signed-off-by: Christoph Hellwig
Acked-by: Sam Ravnborg
---
arch/sparc/include/asm/pci.h| 53 ++---
arch/sparc/include/asm/pci_32.h | 32
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:41:11 -0800
> Factor the code to remap memory returned from the DMA coherent allocator
> into two helpers that can be shared by the IOMMU and direct mapping code.
>
> Signed-off-by: Christoph Hellwig
Acked-by: David S. Miller
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:41:10 -0800
> No need to BUG_ON() on the cache maintainance ops - they are no-ops
> by default, and there is nothing in the DMA API contract that prohibits
> calling them on sbus devices (even if such drivers are unlikely to
> ever appear).
>
>
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:36:57 -0800
> Move the alloc / free routines down the file so that we can easily use
> the map / unmap helpers to implement non-consistent allocations.
>
> Also drop the _coherent postfix to match the method name.
>
> Signed-off-by: Christoph
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:37:00 -0800
> Just allocate the memory and use map_page to map the memory.
>
> Signed-off-by: Christoph Hellwig
Acked-by: David S. Miller
___
linux-snps-arc mailing list
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:36:58 -0800
> Just allocate the memory and use map_page to map the memory.
>
> Signed-off-by: Christoph Hellwig
Acked-by: David S. Miller
___
linux-snps-arc mailing list
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:36:59 -0800
> Move the alloc / free routines down the file so that we can easily use
> the map / unmap helpers to implement non-consistent allocations.
>
> Also drop the _coherent postfix to match the method name.
>
> Signed-off-by: Christoph
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:41:14 -0800
> It has nothing to do with the content of the pci.h header.
>
> Suggested by: Sam Ravnborg
> Signed-off-by: Christoph Hellwig
Acked-by: David S. Miller
___
linux-snps-arc mailing list
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:41:15 -0800
> There are enough common defintions that a single header seems nicer.
>
> Also drop the pointless include.
>
> Signed-off-by: Christoph Hellwig
> Acked-by: Sam Ravnborg
Acked-by: David S. Miller
From: Christoph Hellwig
Date: Sat, 8 Dec 2018 09:41:13 -0800
> The only thing we need to explicitly pull in is the defines for the
> CPU type.
>
> Signed-off-by: Christoph Hellwig
Acked-by: David S. Miller
___
linux-snps-arc mailing list
26 matches
Mail list logo