;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
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.
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
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:
>&
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
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 :(
>
>
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:
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
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
_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
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
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;
>
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)
>
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
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
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
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
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
+ 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
19 matches
Mail list logo