Re: [PATCH] interrupt driven hvc_console as vio device

From: Ryan Arnold
Date: Wed Aug 25 2004 - 12:14:24 EST


On Tue, 2004-08-24 at 23:49, Andrew Morton wrote:

> > + spin_lock_irqsave(&hp->lock, flags);
> > + retval = N_OUTBUF - hp->n_outbuf;
> > + spin_unlock_irqrestore(&hp->lock, flags);

> The new locking in these functions doesn't really do anything, apart from
> adding memory barriers. If that's what you really want, I suggest you
> simply add (commented) memory barriers.

Since chars_in_buffer() can be called from the tty write task and the
n_outbuf value is changed from the hvc_console task I didn't want there
to be any confusion as to the real value of the variable when
chars_in_buffer() was reading it. Is this the proper scenario for a
memory barrier?

Ryan S. Arnold
IBM Linux Technology Center

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/