Re: [PATCH] interrupt driven hvc_console as vio device

From: Ryan Arnold
Date: Wed Aug 25 2004 - 12:11:57 EST


On Tue, 2004-08-24 at 23:46, Andrew Morton wrote:
> > static void hvc_close(struct tty_struct *tty, struct file * filp)
> > {
> > ...
> > + while (hp->n_outbuf) {
> > + spin_unlock_irqrestore(&hp->lock, flags);
> > + yield();
> > + spin_lock_irqsave(&hp->lock, flags);
> > + }
>
> ick.
>
> I suspect that if the caller of hvc_close() has realtime scheduling policy,
> this locks up. Unless it's waiting for interrupt activity.
>
> Really, a real sleep/wakeup would be tons better.

Paulus suggested that tty_wait_until_sent() would be most appropriate
since it actually does a sleep/wakeup. I think I'll rearrange this
function a bit so that I won't have to drop the spin_lock and then grab
it again as well. Thanks for the suggestion.

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/