[lkml]   [2001]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: timing out on a semaphore
    Tim Waugh wrote:
    > I'm trying to chase down a semaphore time-out problem. I want to
    > sleep on a semaphore until either
    > (a) it's signalled, or
    > (b) some amount of time has elapsed.
    > What I'm doing is calling add_timer, and then down_interruptible, and
    > finally del_timer. The timer's function ups the semaphore.
    > The code is in parport_wait_event, in drivers/parport/ieee1284.c.
    > Can anyone see anything obviously wrong with it? It seems to
    > sometimes get stuck.

    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.

    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

     \ /
      Last update: 2005-03-22 13:17    [W:0.021 / U:29.920 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site