Re: [PARPORT] patch-2.2.3-tmw9


Tim Waugh (tim@cyberelk.demon.co.uk)
Sat, 20 Mar 1999 16:06:22 +0000 (GMT)


On Sat, 20 Mar 1999, Philip Blundell wrote:

> If I interrupt printing with ^C I now get something like this:
>
> parport1: Using compatibility mode
> parport1: Operation interrupted at 240
> parport1: wrote 240/512 bytes
> parport1: lp released parport while in use!

Yes. The last message is just alarmist.

> To deal with this and make sure the count is right, I think there
> maybe needs to be an explicit synchronisation call into the low-level
> driver rather than just setting td->abort and hoping for the best.
> The good news is that I haven't had a crash yet. :-)

:-) Would an additional spinlock do the trick?

        td->abort = 1;
        spin_lock (&td->busy);
        spin_unlock (&td->busy);
        use td->count;

(with a spin_trylock/spin_unlock in the low-level driver)

> then the only way to stop it seems to be to use kill -9. From dmesg and
> strace it seems that SIGINT is being correctly delivered and the write is
> returning but bash is deciding to immediately retry it.

I see what you mean. Right, I think I see why -- I'm not returning
-EINTR, just 0. I'll take a look at that. I think it basically means I
should do:

        if (down_interruptible(&sem)) {
                td->abort = 1;
                spin_lock (&td->busy);
                spin_unlock (&td->busy);
                return td->count ? : -EINTR;
        }

Tim.
*/

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Sun 28 Mar 1999 - 17:04:30 EST