lkml.org 
[lkml]   [2014]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 03/13] xen/arm: if(pfn_valid(pfn)) call native dma_ops
On Mon, Nov 10, 2014 at 04:13:55PM +0000, Stefano Stabellini wrote:
> void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
> size_t size, enum dma_data_direction dir,
> - struct dma_attrs *attrs);
> + struct dma_attrs *attrs)
> +{
> + unsigned long pfn = PFN_DOWN(handle);
> + /* Dom0 is mapped 1:1, so calling pfn_valid on a foreign mfn will
> + * always return false. If the page is local we can safely call the
> + * native dma_ops function, otherwise we call the xen specific
> + * function. */
> + if (pfn_valid(pfn)) {
> + if (__generic_dma_ops(hwdev)->unmap_page)
> + __generic_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs);

Similarly here, do we need the unmap_page check? dma_map_page() does not
do it.

--
Catalin


\
 
 \ /
  Last update: 2014-11-10 20:21    [W:0.140 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site