[PATCH 3/14] hvc_console: Dont always kick the poll thread in interrupt
Anton Blanchard
anton at samba.org
Thu Jul 7 01:52:41 EST 2005
From: Milton Miller <miltonm at bga.com>
Have the hvc console code try to pull characters immediately when
receiving an interrupt, and kick the poll thread only if the
immediate poll indicates it needed a call back to do more work.
Signed-off-by: Milton Miller <miltonm at bga.com>
Signed-off-by: Anton Blanchard <anton at samba.org>
diff -puN drivers/char/hvc_console.c~hvc-console-irq-nodelay drivers/char/hvc_console.c
--- gr_work_udbg/drivers/char/hvc_console.c~hvc-console-irq-nodelay 2005-02-08 00:42:40.386023479 -0600
+++ gr_work_udbg-miltonm/drivers/char/hvc_console.c 2005-02-08 00:42:40.396021893 -0600
@@ -254,13 +254,17 @@ static void hvc_kick(void)
wake_up_process(hvc_task);
}
+static int hvc_poll(struct hvc_struct *hp);
+
/*
* NOTE: This API isn't used if the console adapter doesn't support interrupts.
* In this case the console is poll driven.
*/
static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{
- hvc_kick();
+ /* if hvc_poll request a repoll, then kick the hvcd thread */
+ if (hvc_poll(dev_instance))
+ hvc_kick();
return IRQ_HANDLED;
}
@@ -598,8 +602,8 @@ static int hvc_poll(struct hvc_struct *h
/*
* Account for the total amount read in one loop, and if above
- * 64 bytes, we do a quick schedule loop to let the tty grok the
- * data and eventually throttle us.
+ * 64 bytes, we do a quick schedule loop to let the tty grok
+ * the data and eventually throttle us.
*/
read_total += n;
if (read_total >= 64) {
_
More information about the Linuxppc64-dev
mailing list