Re: [PARPORT] interrupt-driven lp

Philip Blundell (
Fri, 02 Jan 1998 13:50:37 +0000

> unsigned long int timeslip = (jiffies - dev->time);
> if ((timeslip < dev->timeslice) ||
> (atomic_read(&dev->port->waiters) == 0))
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I know; that is deliberate. It avoids thrashing the port sharing code when
there's no need to.

>If you want to take backward compatibility you must don' t take any notice
>about others __waiters__ devices. This was why ppa (not a waiter
>pardevice) remains locked at first (waiting for a lp_parport_release).

The correct fix, which I tried to put into parport-980101 though I've no idea
if it works (early indications are that something is still wrong) is to make
the waiters variable count other devices as well. Please take a look.

>I think this is the best and efficient way to handle the parport_yield.
>For example in lp when we run lp_schedule we __must__ schedule() at least
>one time and not only parport_claim_or_block(). We check for need_resched

Indeed. That's why parport_claim_or_block() returns a value saying whether or
not it slept. If it didn't, you may need to call schedule() yourself.

>before run lp_schedule(). If we don' t check for need_reshed means that we
>had to TASK_INTERRUPTIBLE sleep waiting for a timeout, so we __must__
>schedule() with parport __released__. Your parport_yield() function can' t
>run well for all kind of pardevices. I think that it' s device dependent
>choose what do in fucntion of PARPORT_YIELD().

I don't understand this; can you explain more clearly?


-- To unsubscribe, send mail to: --
-- with the single word "unsubscribe" in the body of the message. --

This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:17 EST