[PATCH 2/5] [POWERPC] 8xx: generic 8xx code arch/powerpc port

Christoph Hellwig hch at lst.de
Mon Nov 20 21:24:24 EST 2006


On Fri, Nov 17, 2006 at 08:24:16PM -0500, Dan Malek wrote:
> On Nov 17, 2006, at 3:00 AM, Christoph Hellwig wrote:
> 
> >this is used by arch/ppc/fec.c to set mapping uncachable, which
> >seems rather odd to me.
> 
> I thought arch/ppc/fec.c is dead in favor of the
> "generic" version in the drivers/net directory?

Sorry, I actually meant drivers/net/fec.c.

> We use the va_to_pte() functions to find
> the mappings to create "coherent" cache areas
> by changing the cache attributes of the vmalloc()
> space.  We can't use virt_to_phys() or similar
> associated functions because they simply do the
> kernel virtual arithmetic and don't return the
> proper PTEs for for changing these attributes.

Yes, I noticed that in the second round of actually
looking at all the users.

> >it might make sense to move the implementation to fec.c.
> 
> I don't know what version of fec.c you are looking
> at, but it should use the dma_alloc_coherent() functions
> and be stashing both the physical and virtual addresses.
> I made this change long ago and I hope it hasn't
> been lost.
> 
> The coherent dma functions will in turn use
> the va_to_pte() (or associated functions) mentioned
> above.

drivers/net/fec.c in current linus tree doesn't use the dma
api at all, and there is no dma api implementation that
uses va_to_pte().  The only users of va_to_pte() in current
Linus tree are drivers/net/fec.c:fec_uncachable() in the #else
block of a large #ifdef / #ifelse spagethhi sections and va_to_phys in
arch/ppc/mm/fault.c under CONFIG_8xx, which is unused.



More information about the Linuxppc-dev mailing list