Re: [PATCH] dma-direct: enable mmap for !CONFIG_MMU

2020-06-16 Thread Vladimir Murzin
;dma-mapping: remove CONFIG_ARCH_NO_COHERENT_DMA_MMAP") > Signed-off-by: Christoph Hellwig > Reported-by: dillon min > Reviewed-by: Vladimir Murzin > Tested-by: dillon min > --- > kernel/dma/Kconfig | 1 + > kernel/dma/direct.c | 14 -- > 2 files changed, 1 inser

Re: [BUG] dma-ranges, reserved memory regions, dma_alloc_coherent: possible bug?

2019-10-30 Thread Vladimir Murzin
On 10/29/19 4:52 PM, Daniele Alessandrelli wrote: > On Tue, Oct 29, 2019 at 9:43 AM Daniele Alessandrelli > wrote: >> >> On Mon, Oct 28, 2019 at 10:59 AM Vladimir Murzin >> wrote: >>> >>> @Daniele, it'd be handy to know if that fix issue for you.

[PATCH] dma-mapping: fix handling of dma-ranges for reserved memory (again)

2019-10-30 Thread Vladimir Murzin
ut fix back in place and respect dma-ranges for reserved memory. Fixes: 43fc509c3efb ("dma-coherent: introduce interface for default DMA pool") Reported-by: Daniele Alessandrelli Tested-by: Daniele Alessandrelli Tested-by: Alexandre Torgue Signed-off-by: Vladimir Murzin --- arch/a

Re: [BUG] dma-ranges, reserved memory regions, dma_alloc_coherent: possible bug?

2019-10-28 Thread Vladimir Murzin
On 10/28/19 10:55 AM, Alexandre Torgue wrote: > Hi Vlad, > > On 10/24/19 5:27 PM, Vladimir Murzin wrote: >> Hi Alex, >> >> On 10/24/19 4:20 PM, Alexandre Torgue wrote: >>> Hi Vlad, >>> >>> On 10/24/19 2:43 PM, Vladimir Murzin wrote: >&

Re: [BUG] dma-ranges, reserved memory regions, dma_alloc_coherent: possible bug?

2019-10-24 Thread Vladimir Murzin
Hi Alex, On 10/24/19 4:20 PM, Alexandre Torgue wrote: > Hi Vlad, > > On 10/24/19 2:43 PM, Vladimir Murzin wrote: >> On 10/17/19 10:46 AM, Vladimir Murzin wrote: >>> I'm wondering if I've missed something with diff bellow (it was a long time >>> ago

Re: [BUG] dma-ranges, reserved memory regions, dma_alloc_coherent: possible bug?

2019-10-24 Thread Vladimir Murzin
On 10/17/19 10:46 AM, Vladimir Murzin wrote: > I'm wondering if I've missed something with diff bellow (it was a long time > ago when I touched DMA)? Any comments on that? I can only build test it, so lack of testing stopping me from sending it as a proper patch :( > >

Re: [BUG] dma-ranges, reserved memory regions, dma_alloc_coherent: possible bug?

2019-10-17 Thread Vladimir Murzin
On 10/17/19 11:03 AM, Alexandre Torgue wrote: > Hi Vlad > > On 10/17/19 11:46 AM, Vladimir Murzin wrote: >> On 10/14/19 4:01 PM, Vladimir Murzin wrote: >>> On 10/14/19 2:54 PM, Robin Murphy wrote: >>>> On 13/10/2019 15:28, Daniele Alessandrelli wrote:

Re: [BUG] dma-ranges, reserved memory regions, dma_alloc_coherent: possible bug?

2019-10-17 Thread Vladimir Murzin
On 10/14/19 4:01 PM, Vladimir Murzin wrote: > On 10/14/19 2:54 PM, Robin Murphy wrote: >> On 13/10/2019 15:28, Daniele Alessandrelli wrote: >>> Hi, >>> >>> It looks like dma_alloc_coherent() is setting the dma_handle output >>> parameter to the m

Re: [BUG] dma-ranges, reserved memory regions, dma_alloc_coherent: possible bug?

2019-10-14 Thread Vladimir Murzin
On 10/14/19 2:54 PM, Robin Murphy wrote: > On 13/10/2019 15:28, Daniele Alessandrelli wrote: >> Hi, >> >> It looks like dma_alloc_coherent() is setting the dma_handle output >> parameter to the memory physical address and not the device bus >> address when the device is using reserved memory region

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

2019-06-24 Thread Vladimir Murzin
_global_coherent(get_order(size), > -cpu_addr); > - > - WARN_ON_ONCE(ret == 0); > - } > + int ret = dma_release_from_global_coherent(get_order(size), cpu_addr); > > - return; > + WARN_ON_ONCE(ret == 0); > } > > static int arm_nommu_dma_mmap(struct device *dev, struct vm_area_struct *vma, > FWIW: Reviewed-by: Vladimir Murzin Cheers Vladimir

Re: [PATCH 1/4] arm-nommu: don't define arch_teardown_dma_ops

2018-09-11 Thread Vladimir Murzin
7aba302e76 100644 > --- a/arch/arm/mm/dma-mapping-nommu.c > +++ b/arch/arm/mm/dma-mapping-nommu.c > @@ -237,7 +237,3 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, > u64 size, > > set_dma_ops(dev, dma_ops); > } > - > -void a

Re: [PATCH 29/33] dma-direct: retry allocations using GFP_DMA for small masks

2018-01-10 Thread Vladimir Murzin
ges(page, page_order); > + page = NULL; > + > + if (dev->coherent_dma_mask < DMA_BIT_MASK(32) && > + !(gfp & GFP_DMA)) { > + gfp = (gfp & ~GFP_DMA32) | GFP_DMA; > + goto again; >

Re: [PATCH 11/33] dma-mapping: move swiotlb arch helpers to a new header

2018-01-10 Thread Vladimir Murzin
On 10/01/18 08:00, Christoph Hellwig wrote: > index 9110988b92a1..f00833acb626 100644 > --- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h > +++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h > @@ -61,6 +61,14 @@ static inline void plat_post_dma_flush(struct device *dev) >

Re: [PATCH 31/67] dma-direct: make dma_direct_{alloc, free} available to other implementations

2018-01-02 Thread Vladimir Murzin
ze_t > size, > return page_address(page); > } > > -static void dma_direct_free(struct device *dev, size_t size, void *cpu_addr, > +void dma_direct_free(struct device *dev, size_t size, void *cpu_addr, > dma_addr_t dma_addr, unsigned long attrs) > { > unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT; > Reviewed-by: Vladimir Murzin Thanks Vladimir ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 30/67] dma-direct: retry allocations using GFP_DMA for small masks

2018-01-02 Thread Vladimir Murzin
On 29/12/17 08:18, Christoph Hellwig wrote: > If we got back an allocation that wasn't inside the support coherent mask, > retry the allocation using GFP_DMA. > > Based on the x86 code. > > Signed-off-by: Christoph Hellwig > --- > lib/dma-direct.c | 25 - > 1 file change

Re: [PATCH 26/67] dma-direct: use phys_to_dma

2018-01-02 Thread Vladimir Murzin
g)); > - va = sg_virt(sg); > - sg_dma_address(sg) = (dma_addr_t)virt_to_phys(va) - offset; > + > + sg_dma_address(sg) = phys_to_dma(dev, sg_phys(sg)); > sg_dma_len(sg) = sg->length; > } > > >From ARM NOMMU

Re: [PATCH 25/67] dma-direct: rename dma_noop to dma_direct

2018-01-02 Thread Vladimir Murzin
tion dir, unsigned long attrs) > { > int i; > struct scatterlist *sg; > @@ -58,12 +54,11 @@ static int dma_noop_map_sg(struct device *dev, struct > scatterlist *sgl, int nent > return nents; > } > > -const struct dma_map_ops dma_noop_ops = { > - .alloc = dma_noop_alloc, > - .free = dma_noop_free, > - .map_page = dma_noop_map_page, > - .map_sg = dma_noop_map_sg, > +const struct dma_map_ops dma_direct_ops = { > + .alloc = dma_direct_alloc, > + .free = dma_direct_free, > + .map_page = dma_direct_map_page, > + .map_sg = dma_direct_map_sg, > .is_phys= true, > }; > - > -EXPORT_SYMBOL(dma_noop_ops); > +EXPORT_SYMBOL(dma_direct_ops); > >From ARM NOMMU perspective Reviewed-by: Vladimir Murzin Thanks Vladimir ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: consolidate direct dma mapping and swiotlb support

2017-12-29 Thread Vladimir Murzin
On 29/12/17 08:18, Christoph Hellwig wrote: > Almost every architecture supports a direct dma mapping implementation, > where no iommu is used and the device dma address is a 1:1 mapping to > the physical address or has a simple linear offset. Currently the > code for this implementation is most d

Re: CONFIG_DMA_NOOP_OPS breaks ARM arch

2017-10-16 Thread Vladimir Murzin
+ Robin and Christoph On 16/10/17 06:27, Marian Mihailescu wrote: > I am using 4.14-rc4 with a patch on top that includes > arch/arm/include/asm/dma-mapping.h in a module. > > I have MMU enabled, so > select DMA_NOOP_OPS if !MMU > does nothing for me, and I get a compile error because dma_noop_op