What we ended up doing was adding a debug wrapper around the invalidate routine that squealed whenever a non-aligned invalidation was attempted. This was/is a useful tool for finding potential problems - but can create lots of false positives. Unfortunately in order for something like this to work, you have to have a consistent philosophy for handling dma'able buffers where, when they are aligned and bloated that this address and length is used for invalidation operations. This gets into the problem of sometimes wanting to know the true length and the requested length and maybe not having both available.
It would be nice if there was more structure to enforce drivers and other subsystems to do things right, mostly because things like inadvertent line sharing are a real pain to track down. david David Gibson wrote: > On Thu, Apr 04, 2002 at 01:08:41AM -0500, Dan Malek wrote: > >>David Gibson wrote: >> >> >>>Possibly a better approach would be to make the consistent_sync() >>>function be more careful and flush rather than invalidate cachelines >>> >>That's basically what this patch does, with the overhead of always >>writing instead of just invalidating. We just went the whole circle >>here, as this isn't a logically correct solution :-). >> > http://www.ozlabs.org/people/dgibson > > > > ** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/