Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1513989
| From | Catalin Marinas <catalin.marinas@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] arc: Implement arch-specific dma_map_ops.mmap |
| Date | 2016-11-02 18:10 +0100 |
| Message-ID | <sz7d0-FB-45@gated-at.bofh.it> (permalink) |
| References | <sz2Q1-6i5-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Nov 02, 2016 at 03:19:43PM +0300, Alexey Brodkin wrote:
> diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c
> index 20afc65e22dc..034ec6a8a764 100644
> --- a/arch/arc/mm/dma.c
> +++ b/arch/arc/mm/dma.c
> @@ -105,6 +105,31 @@ static void arc_dma_free(struct device *dev, size_t size, void *vaddr,
> __free_pages(page, get_order(size));
> }
>
> +static int arc_dma_mmap(struct device *dev, struct vm_area_struct *vma,
> + void *cpu_addr, dma_addr_t dma_addr, size_t size,
> + unsigned long attrs)
> +{
> + unsigned long user_count = vma_pages(vma);
> + unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
> + unsigned long pfn = __phys_to_pfn(dma_addr);
I don't think that's correct in all situations. Better as (for arc):
unsigned long pfn = __phys_to_pfn(plat_dma_to_phys(dma_addr));
Other than that:
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] arc: Implement arch-specific dma_map_ops.mmap Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-11-02 13:30 +0100 Re: [PATCH] arc: Implement arch-specific dma_map_ops.mmap Catalin Marinas <catalin.marinas@arm.com> - 2016-11-02 18:10 +0100
csiph-web