Re: [PARPORT] Re: ParPort problem ?


Tim Waugh (tim@cyberelk.demon.co.uk)
Wed, 11 Mar 1998 22:39:16 +0000 (GMT)


On Wed, 11 Mar 1998, Philip Blundell wrote:

> >The parport_pc driver has probably misdetected your IRQ... Try specifying
> >it on the boot, or module-insertion line.
>
> Although this shouldn't happen any more, it would be nice if lp logged a
> message if an IRQ it was expecting never arrived.

Here's a patch, but it's awful. Anyone know the right way?

Tim.
*/

--- linux/drivers/char/lp.c~ Sat Mar 7 14:51:30 1998
+++ linux/drivers/char/lp.c Wed Mar 11 22:38:16 1998
@@ -289,6 +289,7 @@
                                         current->timeout = jiffies + LP_TIME(minor);
                                         lp_schedule (minor);
                                 } else {
+ unsigned long timeout;
                                         cli();
                                         if (LP_PREEMPTED(minor)) {
                                                 sti();
@@ -303,11 +304,13 @@
                                                 sti();
                                                 continue;
                                         }
- current->timeout = jiffies + LP_TIMEOUT_INTERRUPT;
+ timeout = current->timeout = jiffies + LP_TIMEOUT_INTERRUPT;
                                         interruptible_sleep_on(&lp->dev->wait_q);
                                         disable_irq(lp->dev->port->irq);
                                         w_ctr(minor, LP_PSELECP | LP_PINITP);
                                         sti();
+ if (jiffies >= timeout)
+ printk (KERN_WARNING "lp: never got interrupt!\n");
                                         if (lp_check_status(minor))
                                                 return rc ? rc : -EIO;
                                 }

-- 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 Wed 30 Dec 1998 - 10:17:32 EST