Problem of concurrency in arch/ppc/8260_io/uart.c

Joakim Tjernlund Joakim.Tjernlund at lumentis.se
Sat Sep 27 18:07:54 EST 2003


> Joakim Tjernlund wrote:
>
> > Yes, thats correct. I did try different ways around that but the only thing that
> > would work is to make copy_from_user() copy to i tmp buf and then copy the
> > tmp buf into the BD. Would that be better?
>
> I wonder what happens if we mark a buffer ready with a count of zero?
> Since the typical case is no page fault, I would just update the BD ptr
> early, use the buffer, mark it ready.  If you get a fault, put a zero
> for the count and mark it ready.

I tried that and it broke the CPM.

> If that freaks out the CPM, put one
> byte of zero into the buffer and give it a count of 1.  Then you just have
> to hold the lock across the update of the BD ptr, just like everywhere else.

That will work, but wont the zero show up on the console? hmm, since
the zero count will be very unlikely case anyhow,  I can live with that.

 Jocke

>
> -- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list