[RFC PATCH V1 14/33] powerpc/mm: Use helper for finding pte bits mapping I/O area

Benjamin Herrenschmidt benh at kernel.crashing.org
Wed Jan 13 18:18:07 AEDT 2016


On Wed, 2016-01-13 at 11:37 +0530, Aneesh Kumar K.V wrote:
> Benjamin Herrenschmidt <benh at kernel.crashing.org> writes:
> 
> > On Tue, 2016-01-12 at 10:42 +0300, Denis Kirjanov wrote:
> > > > +static inline unsigned long pte_io_cache_bits(void)
> > > > +{
> > > > +     return _PAGE_NO_CACHE | _PAGE_GUARDED;
> > > > +}
> > > This could be just plain #define
> > 
> > Or just use pgprot_noncached()
> > 
> #define pgprot_noncached(prot)	  (__pgprot((pgprot_val(prot) &
> ~_PAGE_CACHE_CTL) | \
> 				            _PAGE_NO_CACHE |
> _PAGE_GUARDED))
> 
> 
> That will return me a pgprot_t.  I can fix that by using
> pgprot_val(pgprot_noncached(0)). Is that what you are suggesting ?

Shouln't ioremap just use pgprot_noncached(PAGE_KERNEL) or similar ?

Cheers,
Ben.



More information about the Linuxppc-dev mailing list