ioremap of pci region on pSeries LPAR vs SMP

Linas Vepstas linas at austin.ibm.com
Tue Jan 11 04:47:16 EST 2005


Hi Paul,

On Mon, Jan 10, 2005 at 08:10:59PM +1100, Paul Mackerras was heard to remark:
> Anil Kumar Prasad writes:
> 
> > On JS20, i get va in IO_REGION (0xE000....) while on
> > p630  ioremap returns address in
> > EEH_REGION(0xA000...). As soon as i try to dereference
> > this returned va on p630, kernel crashes(dump is at
> > the end of mail).
> 
> You shouldn't ever directly dereference the result of ioremap.  You
> have to use readb/readw/readl and writeb/writew/writel.

Paul,

Please note that someone removed the EEH_REGION stuff recently,
october-ish I think.  I don't know why, I thought it was something 
you condoned.  And so in the latest kernels, it *is* legal to directly 
dereference the result of ioremap.  That is, Anil wouldn't have seen 
this bug if he'd been running the current BK sources.

Was removing this mechanism the right thing to do?  If so, why?
It seemed like a great way to force everyone to use the 
readb/etc macros.


--linas




More information about the Linuxppc64-dev mailing list