diff options
Diffstat (limited to 'arch/um/drivers/line.c')
-rw-r--r-- | arch/um/drivers/line.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 851a7c8caae5..b8e3e800ee41 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -36,8 +36,9 @@ static void line_timer_cb(void *arg) | |||
36 | { | 36 | { |
37 | struct line *line = arg; | 37 | struct line *line = arg; |
38 | 38 | ||
39 | chan_interrupt(&line->chan_list, &line->task, line->tty, | 39 | if(!line->throttled) |
40 | line->driver->read_irq); | 40 | chan_interrupt(&line->chan_list, &line->task, line->tty, |
41 | line->driver->read_irq); | ||
41 | } | 42 | } |
42 | 43 | ||
43 | /* Returns the free space inside the ring buffer of this line. | 44 | /* Returns the free space inside the ring buffer of this line. |
@@ -340,6 +341,30 @@ int line_ioctl(struct tty_struct *tty, struct file * file, | |||
340 | return ret; | 341 | return ret; |
341 | } | 342 | } |
342 | 343 | ||
344 | void line_throttle(struct tty_struct *tty) | ||
345 | { | ||
346 | struct line *line = tty->driver_data; | ||
347 | |||
348 | deactivate_chan(&line->chan_list, line->driver->read_irq); | ||
349 | line->throttled = 1; | ||
350 | } | ||
351 | |||
352 | void line_unthrottle(struct tty_struct *tty) | ||
353 | { | ||
354 | struct line *line = tty->driver_data; | ||
355 | |||
356 | line->throttled = 0; | ||
357 | chan_interrupt(&line->chan_list, &line->task, tty, | ||
358 | line->driver->read_irq); | ||
359 | |||
360 | /* Maybe there is enough stuff pending that calling the interrupt | ||
361 | * throttles us again. In this case, line->throttled will be 1 | ||
362 | * again and we shouldn't turn the interrupt back on. | ||
363 | */ | ||
364 | if(!line->throttled) | ||
365 | reactivate_chan(&line->chan_list, line->driver->read_irq); | ||
366 | } | ||
367 | |||
343 | static irqreturn_t line_write_interrupt(int irq, void *data, | 368 | static irqreturn_t line_write_interrupt(int irq, void *data, |
344 | struct pt_regs *unused) | 369 | struct pt_regs *unused) |
345 | { | 370 | { |