[PATCH 10/13] powerpc: check cache coherency of kernel vs firmware

Dale Farnsworth dale at farnsworth.org
Tue May 15 00:44:21 EST 2007


On Mon, May 14, 2007 at 12:40:14AM +0000, David Gibson wrote:
> On Fri, May 11, 2007 at 05:57:35PM -0700, Mark A. Greer wrote:
> > 
> > From: Dale Farnsworth <dale at farnsworth.org>
> > 
> > check_cache_coherency() verifies that the cache coherency setting of
> > the kernel (CONFIG_NOT_COHERENT_CACHE) matches that left by the firmware,
> > as indicated by coherency-off device tree property.
> 
> This looks really bogus.  If the firmware reports a coherency state,
> then presumably there's some hardware switch to turn coherency on or
> off.  In which case, can't the kernel just toggle that switch to
> whatever's appropriate for it?

Oh, if it were only a single hardware switch.  This is currently done
as part of about 500 lines of window register setting code that would
need to be moved/copied into the kernel from the firmware/bootwrapper.

It looks like the coherency part involves changing the same field in
a dozen device window registers, plus a different field in a register
for each PCI bus.  So that is doable, and preferable to just printing
an error and failing as the above referenced patch does.

I was very glad to see all of the window initialization code taken out
of the kernel and put into the bootwrapper, but I'm beginning to believe
that it needs to be put back in the kernel.

Mark, it's your code.  What do you think?

-Dale



More information about the Linuxppc-dev mailing list