lkml.org 
[lkml]   [2015]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 3/7] mm: Change ioremap to set up huge I/O mappings
From
Date
On Mon, 2015-01-26 at 15:58 -0800, Andrew Morton wrote:
> On Mon, 26 Jan 2015 16:13:25 -0700 Toshi Kani <toshi.kani@hp.com> wrote:
>
> > Change ioremap_pud_range() and ioremap_pmd_range() to set up
> > huge I/O mappings when their capability is enabled and their
> > conditions are met in a given request -- both virtual & physical
> > addresses are aligned and its range fufills the mapping size.
> >
> > These changes are only enabled when both CONFIG_HUGE_IOMAP
> > and CONFIG_HAVE_ARCH_HUGE_VMAP are defined.
> >
> > --- a/lib/ioremap.c
> > +++ b/lib/ioremap.c
> > @@ -81,6 +81,14 @@ static inline int ioremap_pmd_range(pud_t *pud, unsigned long addr,
> > return -ENOMEM;
> > do {
> > next = pmd_addr_end(addr, end);
> > +
> > + if (ioremap_pmd_enabled() &&
> > + ((next - addr) == PMD_SIZE) &&
> > + !((phys_addr + addr) & (PMD_SIZE-1))) {
>
> IS_ALIGNED might be a little neater here.

Right. Will use IS_ALIGNED.

> > + pmd_set_huge(pmd, phys_addr + addr, prot);
> > + continue;
> > + }
> > +
> > if (ioremap_pte_range(pmd, addr, next, phys_addr + addr, prot))
> > return -ENOMEM;
> > } while (pmd++, addr = next, addr != end);
> > @@ -99,6 +107,14 @@ static inline int ioremap_pud_range(pgd_t *pgd, unsigned long addr,
> > return -ENOMEM;
> > do {
> > next = pud_addr_end(addr, end);
> > +
> > + if (ioremap_pud_enabled() &&
> > + ((next - addr) == PUD_SIZE) &&
> > + !((phys_addr + addr) & (PUD_SIZE-1))) {
>
> And here.

Will do.

Thanks,
-Toshi



\
 
 \ /
  Last update: 2015-01-27 01:21    [W:0.078 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site