[PATCH 4/7] dma-mapping: add a dma_alloc_need_uncached helper

2019-06-14 Thread Christoph Hellwig
Check if we need to allocate uncached memory for a device given the allocation flags. Switch over the uncached segment check to this helper to deal with architectures that do not support the dma_cache_sync operation and thus should not returned cacheable memory for DMA_ATTR_NON_CONSISTENT

[PATCH 2/7] arc: remove the partial DMA_ATTR_NON_CONSISTENT support

2019-06-14 Thread Christoph Hellwig
The arc DMA code supports DMA_ATTR_NON_CONSISTENT allocations, but does not provide a cache_sync operation. This means any user of it will never be able to actually transfer cache ownership and thus cause coherency bugs. Signed-off-by: Christoph Hellwig --- arch/arc/mm/dma.c | 21

[PATCH 5/7] dma-direct: handle DMA_ATTR_NON_CONSISTENT in common code

2019-06-14 Thread Christoph Hellwig
Only call into arch_dma_alloc if we require an uncached mapping, and remove the parisc code manually doing normal cached DMA_ATTR_NON_CONSISTENT allocations. Signed-off-by: Christoph Hellwig --- arch/parisc/kernel/pci-dma.c | 48 ++-- kernel/dma/direct.c

[PATCH 3/7] openrisc: remove the partial DMA_ATTR_NON_CONSISTENT support

2019-06-14 Thread Christoph Hellwig
The openrisc DMA code supports DMA_ATTR_NON_CONSISTENT allocations, but does not provide a cache_sync operation. This means any user of it will never be able to actually transfer cache ownership and thus cause coherency bugs. Signed-off-by: Christoph Hellwig --- arch/openrisc/kernel/dma.c | 22

[PATCH 6/7] dma-direct: handle DMA_ATTR_NO_KERNEL_MAPPING in common code

2019-06-14 Thread Christoph Hellwig
DMA_ATTR_NO_KERNEL_MAPPING is generally implemented by allocating normal cacheable pages or CMA memory, and then returning the page pointer as the opaque handle. Lift that code from the xtensa and generic dma remapping implementations into the generic dma-direct code so that we don't even call

[PATCH 7/7] arc: use the generic remapping allocator for coherent DMA allocations

2019-06-14 Thread Christoph Hellwig
Replace the code that sets up uncached PTEs with the generic vmap based remapping code. It also provides an atomic pool for allocations from non-blocking context, which we not properly supported by the existing arc code. Signed-off-by: Christoph Hellwig --- arch/arc/Kconfig | 2 ++

[PATCH 1/7] arm-nommu: remove the partial DMA_ATTR_NON_CONSISTENT support

2019-06-14 Thread Christoph Hellwig
The arm-nommu DMA code supports DMA_ATTR_NON_CONSISTENT allocations, but does not provide a cache_sync operation. This means any user of it will never be able to actually transfer cache ownership and thus cause coherency bugs. Signed-off-by: Christoph Hellwig ---

handle "special" dma allocation in common code

2019-06-14 Thread Christoph Hellwig
Hi all,, this series ensures that the common dma-direct code handles the somewhat special allocation types requested by the DMA_ATTR_NON_CONSISTENT and DMA_ATTR_NO_KERNEL_MAPPING flags directly. To do so it also removes three partial and thus broken implementations of DMA_ATTR_NON_CONSISTENT.

Re: [PATCH 7/7] arc: use the generic remapping allocator for coherent DMA allocations

2019-06-14 Thread Eugeniy Paltsev
Hi Christoph, Regular question - do you have any public git repository with all this dma changes? I want to test it for ARC. Pretty sure the [PATCH 2/7] arc: remove the partial DMA_ATTR_NON_CONSISTENT support is fine. Not so sure about [PATCH 7/7] arc: use the generic remapping allocator for

[PATCH] ARC: ARCv2: jump label: implement jump label patching

2019-06-14 Thread Eugeniy Paltsev
Implement jump label patching for ARC. Jump labels provide an interface to generate dynamic branches using self-modifying code. This allows us to implement conditional branches where changing branch direction is expensive but branch selection is basically 'free' This implementation uses 32-bit

[PATCH AUTOSEL 4.14 01/27] ARC: fix build warnings

2019-06-14 Thread Sasha Levin
From: Vineet Gupta [ Upstream commit 89c92142f75eb80064f5b9f484b1b4d81790 ] | arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla] | arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] Signed-off-by: Vineet Gupta

[PATCH AUTOSEL 4.14 02/27] ARC: [plat-hsdk]: Add missing multicast filter bins number to GMAC node

2019-06-14 Thread Sasha Levin
From: Jose Abreu [ Upstream commit ecc906a11c2a0940e1a380debd8bd5bc09faf454 ] GMAC controller on HSDK boards supports 256 Hash Table size so we need to add the multicast filter bins property. This allows for the Hash filter to work properly using stmmac driver. Cc: Joao Pinto Cc: Rob Herring

[PATCH AUTOSEL 4.19 04/39] ARC: [plat-hsdk]: Add missing multicast filter bins number to GMAC node

2019-06-14 Thread Sasha Levin
From: Jose Abreu [ Upstream commit ecc906a11c2a0940e1a380debd8bd5bc09faf454 ] GMAC controller on HSDK boards supports 256 Hash Table size so we need to add the multicast filter bins property. This allows for the Hash filter to work properly using stmmac driver. Cc: Joao Pinto Cc: Rob Herring

[PATCH AUTOSEL 4.19 01/39] ARC: fix build warnings

2019-06-14 Thread Sasha Levin
From: Vineet Gupta [ Upstream commit 89c92142f75eb80064f5b9f484b1b4d81790 ] | arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla] | arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] Signed-off-by: Vineet Gupta

[PATCH AUTOSEL 4.19 05/39] ARC: [plat-hsdk]: Add missing FIFO size entry in GMAC node

2019-06-14 Thread Sasha Levin
From: Jose Abreu [ Upstream commit 4c70850aeb2e40016722cd1abd43c679666d3ca0 ] Add the binding for RX/TX fifo size of GMAC node. Cc: Joao Pinto Cc: Rob Herring Cc: Mark Rutland Cc: Vineet Gupta Tested-by: Eugeniy Paltsev Acked-by: Alexey Brodkin Signed-off-by: Jose Abreu Signed-off-by:

[PATCH AUTOSEL 5.1 02/59] ARC: fix build warnings

2019-06-14 Thread Sasha Levin
From: Vineet Gupta [ Upstream commit 89c92142f75eb80064f5b9f484b1b4d81790 ] | arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla] | arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] Signed-off-by: Vineet Gupta

[PATCH AUTOSEL 4.9 01/18] ARC: fix build warnings with !CONFIG_KPROBES

2019-06-14 Thread Sasha Levin
From: Vineet Gupta [ Upstream commit 4c6fabda1ad1dec6d274c098ef0a91809c74f2e3 ] | CC lib/nmi_backtrace.o | In file included from ../include/linux/kprobes.h:43:0, | from ../lib/nmi_backtrace.c:17: | ../arch/arc/include/asm/kprobes.h:57:13: warning: 'trap_is_kprobe'

[PATCH AUTOSEL 5.1 12/59] ARC: [plat-hsdk]: Add missing FIFO size entry in GMAC node

2019-06-14 Thread Sasha Levin
From: Jose Abreu [ Upstream commit 4c70850aeb2e40016722cd1abd43c679666d3ca0 ] Add the binding for RX/TX fifo size of GMAC node. Cc: Joao Pinto Cc: Rob Herring Cc: Mark Rutland Cc: Vineet Gupta Tested-by: Eugeniy Paltsev Acked-by: Alexey Brodkin Signed-off-by: Jose Abreu Signed-off-by:

[PATCH AUTOSEL 5.1 11/59] ARC: [plat-hsdk]: Add missing multicast filter bins number to GMAC node

2019-06-14 Thread Sasha Levin
From: Jose Abreu [ Upstream commit ecc906a11c2a0940e1a380debd8bd5bc09faf454 ] GMAC controller on HSDK boards supports 256 Hash Table size so we need to add the multicast filter bins property. This allows for the Hash filter to work properly using stmmac driver. Cc: Joao Pinto Cc: Rob Herring