Re: timing out on a semaphore

From: Andrew Morton (
Date: Tue Feb 27 2001 - 17:40:35 EST

Tim Waugh wrote:
> On Sun, Feb 25, 2001 at 11:10:39PM +0000, Andrew Morton wrote:
> > I think there might be a bogon in __down_interruptible's
> > handling of the semaphore state in this case. I remember
> > spotting something a few months back but I can't immediately
> > remember what it was :(
> >
> > I'd suggest you slot a
> >
> > sema_init(&port->physport->ieee1284.irq, 1);
> >
> > into parport_wait_event() prior to adding the timer. If that
> > fixes it I'll go back through my patchpile, see if I can
> > resurrect that grey cell.
> I haven't been able to confirm that it works around it (can't repeat
> the problem here), but what would you say if I said it did? ;-)

One of two things:

1: Your code is leaving the semaphore in a down'ed state

2: The semaphore code is leaving the semaphore in a funny

hmm. I see from your other email that the sema_init() has
made the problem go away. Could you please review the code,
see if there's an imbalance somewhere?

What is parport_ieee1284_write_compat() trying to do with
the semaphore? It will leave the semaphore in a downed
state. Intentional? Is this code actually being used
by the person who is having the problem? Could this
loop be replaced by a simple sema_init()?

(As you can tell, I'm desparately avoiding having
to understand the semaphore code again :))

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Feb 28 2001 - 21:00:15 EST