drm_vm.c: many arches equate remap_pfn_range() and io_remap_pfn_range()

Robert P. J. Day rpjday at crashcourse.ca
Thu Aug 30 04:17:52 PDT 2012


On Thu, 30 Aug 2012, Robert P. J. Day wrote:

> On Thu, 30 Aug 2012, Sascha Hauer wrote:
>
> > On Wed, Aug 29, 2012 at 06:29:53PM -0400, Robert P. J. Day wrote:
> > >
> > >   a pedantic observation, you can do with it what you wish (i'm not a
> > > list subscriber).  in drivers/gpu/drm/drm_vm.c, we read (line 629):
> > >
> > > #if !defined(__arm__)
> > >                 if (io_remap_pfn_range(vma, vma->vm_start,
> > >                                        (map->offset + offset) >> PAGE_SHIFT,
> > >                                        vma->vm_end - vma->vm_start,
> > >                                        vma->vm_page_prot))
> > >                         return -EAGAIN;
> > > #else
> > >                 if (remap_pfn_range(vma, vma->vm_start,
> > >                                         (map->offset + offset) >> PAGE_SHIFT,
> > >                                         vma->vm_end - vma->vm_start,
> > >                                         vma->vm_page_prot))
> > >                         return -EAGAIN;
> > > #endif
> >
> > This code goes down to:
> >
> > commit 4b7fb9b5746554d460e7bc986341d4b2db01e0b6
> > Author: Jordan Crouse <jcrouse at codeaurora.org>
> > Date:   Thu May 27 13:40:26 2010 -0600
> >
> >     drm: Add __arm defines to DRM
> >
> >     Add __arm defines to specify behavior specific for
> >     an ARM processor.
> >
> >     Signed-off-by: Jordan Crouse <jcrouse at codeaurora.org>
> >     Signed-off-by: Dave Airlie <airlied at redhat.com>
> >
> > Even at that time io_remap_pfn_range on arm was defined as:
> >
> > >
> > > #define io_remap_pfn_range(vma,from,pfn,size,prot) \
> > >                 remap_pfn_range(vma, from, pfn, size, prot)
> > >
> > > so it's not clear what the preprocessor test is for.  admittedly, it
> > > should work, it just seems unnecessary.  and it makes the code more
> > > confusing than it needs to be, but perhaps i've just misread
> > > something.
> >
> > I agree that this shouldn't be necessary.
>
>   for simplicity, i can submit a patch that just does a straight call
> to remap_pfn_range(), unless someone can recognize something really
> subtle happening here.

  sorry, that should have been a straight call to io_remap_pfn_range()
since that is the call invoked for all but ARM.  i'll post a patch
shortly and someone else can decide whether or not to apply it.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


More information about the dri-devel mailing list