Re: [PATCH 07/12] dma-mapping: move CONFIG_DMA_CMA to kernel/dma/Kconfig

2019-02-11 Thread Greg Kroah-Hartman
On Mon, Feb 11, 2019 at 02:35:49PM +0100, Christoph Hellwig wrote: > This is where all the related code already lives. > > Signed-off-by: Christoph Hellwig > --- > drivers/base/Kconfig | 77 > kernel/dma/Kconfig | 77

Re: [PATCH 06/12] dma-mapping: improve selection of dma_declare_coherent availability

2019-02-11 Thread Greg Kroah-Hartman
On Mon, Feb 11, 2019 at 02:35:48PM +0100, Christoph Hellwig wrote: > This API is primarily used through DT entries, but two architectures > and two drivers call it directly. So instead of selecting the config > symbol for random architectures pull it in implicitly for the actual > users. Also ren

Re: [PATCH 09/12] dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag

2019-02-11 Thread Greg Kroah-Hartman
On Mon, Feb 11, 2019 at 02:35:51PM +0100, Christoph Hellwig wrote: > All users of dma_declare_coherent want their allocations to be > exclusive, so default to exclusive allocations. > > Signed-off-by: Christoph Hellwig > --- > Documentation/DMA-API.txt | 9 +-- > arch/ar

Re: [PATCH 02/12] device.h: dma_mem is only needed for HAVE_GENERIC_DMA_COHERENT

2019-02-11 Thread Greg Kroah-Hartman
On Mon, Feb 11, 2019 at 02:35:44PM +0100, Christoph Hellwig wrote: > No need to carry an unused field around. > > Signed-off-by: Christoph Hellwig > --- > include/linux/device.h | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Greg Kroah-Hartman _

Re: [PATCH 06/12] dma-mapping: improve selection of dma_declare_coherent availability

2019-02-11 Thread Paul Burton
Hi Christoph, On Mon, Feb 11, 2019 at 02:35:48PM +0100, Christoph Hellwig wrote: > This API is primarily used through DT entries, but two architectures > and two drivers call it directly. So instead of selecting the config > symbol for random architectures pull it in implicitly for the actual > u

Re: [PATCH 1/2] dma-mapping: add a kconfig symbol for arch_setup_dma_ops availability

2019-02-11 Thread Paul Burton
Hi Christoph, On Mon, Feb 04, 2019 at 09:14:19AM +0100, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- > arch/arc/Kconfig | 1 + > arch/arc/include/asm/Kbuild | 1 + > arch/arc/include/asm/dma-mapping.h | 13 - > arch/arm/Kconfig

Re: [RFC 1/2] ARC: U-boot: check arguments paranoidly

2019-02-11 Thread Vineet Gupta
Ping ! Are you happy with approach ? -Vineet On 2/6/19 2:13 PM, Vineet Gupta wrote: > On 2/6/19 9:22 AM, Eugeniy Paltsev wrote: >> Handle U-boot arguments paranoidly: >> * don't allow to pass unknown tag. >> * try to use external device tree blob only if corresponding tag >>(TAG_DTB) is set

Re: [PATCH 1/2] dma-mapping: add a kconfig symbol for arch_setup_dma_ops availability

2019-02-11 Thread Vineet Gupta
+CC Eugeniy As resident ARC DMA expert can you please this a quick spin. -Vineet On 2/4/19 12:14 AM, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- > arch/arc/Kconfig | 1 + > arch/arc/include/asm/Kbuild | 1 + > arch/arc/include/asm/dma-mappin

Re: add config symbols for arch_{setup,teardown}_dma_ops

2019-02-11 Thread Catalin Marinas
On Mon, Feb 11, 2019 at 02:21:56PM +0100, Christoph Hellwig wrote: > Any chance to get a quick review on this small series? For arm64: Acked-by: Catalin Marinas ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.

[PATCH 12/12] dma-mapping: remove dma_assign_coherent_memory

2019-02-11 Thread Christoph Hellwig
The only useful bit in this function was the already assigned check. Once that is moved to dma_init_coherent_memory thee rest can easily be handled in the two callers. Signed-off-by: Christoph Hellwig --- kernel/dma/coherent.c | 47 +-- 1 file changed, 14

[PATCH 11/12] dma-mapping: handle per-device coherent memory mmap in common code

2019-02-11 Thread Christoph Hellwig
We handle allocation and freeing in common code, so we should handle mmap the same way. Also all users of per-device coherent memory are exclusive, that is if we can't allocate from the per-device pool we can't use the system memory either. Unfold the current dma_mmap_from_dev_coherent implementa

[PATCH 09/12] dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag

2019-02-11 Thread Christoph Hellwig
All users of dma_declare_coherent want their allocations to be exclusive, so default to exclusive allocations. Signed-off-by: Christoph Hellwig --- Documentation/DMA-API.txt | 9 +-- arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 12 +++-- arch/arm/mach-imx/mach-mx3

[PATCH 08/12] dma-mapping: remove dma_mark_declared_memory_occupied

2019-02-11 Thread Christoph Hellwig
This API is not used anywhere, so remove it. Signed-off-by: Christoph Hellwig --- Documentation/DMA-API.txt | 17 - include/linux/dma-mapping.h | 9 - kernel/dma/coherent.c | 23 --- 3 files changed, 49 deletions(-) diff --git a/Documentation

[PATCH 10/12] dma-mapping: simplify allocations from per-device coherent memory

2019-02-11 Thread Christoph Hellwig
All users of per-device coherent memory are exclusive, that is if we can't allocate from the per-device pool we can't use the system memory either. Unfold the current dma_{alloc,free}_from_dev_coherent implementation and always use the per-device pool if it exists. Signed-off-by: Christoph Hellwig

[PATCH 07/12] dma-mapping: move CONFIG_DMA_CMA to kernel/dma/Kconfig

2019-02-11 Thread Christoph Hellwig
This is where all the related code already lives. Signed-off-by: Christoph Hellwig --- drivers/base/Kconfig | 77 kernel/dma/Kconfig | 77 2 files changed, 77 insertions(+), 77 deletions(-) diff --git a/

[PATCH 06/12] dma-mapping: improve selection of dma_declare_coherent availability

2019-02-11 Thread Christoph Hellwig
This API is primarily used through DT entries, but two architectures and two drivers call it directly. So instead of selecting the config symbol for random architectures pull it in implicitly for the actual users. Also rename the Kconfig option to describe the feature better. Signed-off-by: Chri

[PATCH 05/12] dma-mapping: remove an incorrect __iommem annotation

2019-02-11 Thread Christoph Hellwig
memmap return a regular void pointer, not and __iomem one. Signed-off-by: Christoph Hellwig --- kernel/dma/coherent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/coherent.c b/kernel/dma/coherent.c index 66f0fb7e9a3a..4b76aba574c2 100644 --- a/kernel/dma/coheren

[PATCH 04/12] of: select OF_RESERVED_MEM automatically

2019-02-11 Thread Christoph Hellwig
The OF_RESERVED_MEM can be used if we have either CMA or the generic declare coherent code built and we support the early flattened DT. So don't bother making it a user visible options that is selected by most configs that fit the above category, but just select it when the requirements are met.

[PATCH 03/12] of: mark early_init_dt_alloc_reserved_memory_arch static

2019-02-11 Thread Christoph Hellwig
This function is only used in of_reserved_mem.c, and never overridden despite the __weak marker. Signed-off-by: Christoph Hellwig --- drivers/of/of_reserved_mem.c| 2 +- include/linux/of_reserved_mem.h | 7 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/of/of_r

[PATCH 01/12] mfd/sm501: depend on HAS_DMA

2019-02-11 Thread Christoph Hellwig
Currently the sm501 mfd driver can be compiled without any dependencies, but through the use of dma_declare_coherent it really depends on having DMA and iomem support. Normally we don't explicitly require DMA support as we have stubs for it if on UML, but in this case the driver selects support fo

[PATCH 02/12] device.h: dma_mem is only needed for HAVE_GENERIC_DMA_COHERENT

2019-02-11 Thread Christoph Hellwig
No need to carry an unused field around. Signed-off-by: Christoph Hellwig --- include/linux/device.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index 6cb4640b6160..be544400acdd 100644 --- a/include/linux/device.h +++ b/include/linux/devi

dma_declare_coherent spring cleaning

2019-02-11 Thread Christoph Hellwig
Hi all, this series removes various bits of dead code and refactors the remaining functionality around dma_declare_coherent to be a somewhat more coherent code base. ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infrade

Re: add config symbols for arch_{setup,teardown}_dma_ops

2019-02-11 Thread Christoph Hellwig
Any chance to get a quick review on this small series? On Mon, Feb 04, 2019 at 09:14:18AM +0100, Christoph Hellwig wrote: > Hi all, > > this series adds kconfig symbols to indicate that the architecture > provides the arch_setup_dma_ops and arch_teardown_dma_ops hooks. > > This avoids polluting