Skip to content

Commit

Permalink
[PATCH] hvc_console: Dont always kick the poll thread in interrupt
Browse files Browse the repository at this point in the history
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@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Milton Miller authored and Linus Torvalds committed Jul 8, 2005
1 parent 6f24808 commit 8b67f8c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/char/hvc_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -598,8 +602,8 @@ static int hvc_poll(struct hvc_struct *hp)

/*
* 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) {
Expand Down

0 comments on commit 8b67f8c

Please sign in to comment.