Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235509
b: refs/heads/master
c: 0a1f1a0
h: refs/heads/master
i:
  235507: 9f5662c
v: v3
  • Loading branch information
Tejun Heo authored and Greg Kroah-Hartman committed Feb 3, 2011
1 parent e2ce5e3 commit d75570e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 78841462d72fe7038cb7ea48adecc6fc395f2dc5
refs/heads/master: 0a1f1a0b626d79071ee9fe91b7fcd28be6332677
17 changes: 15 additions & 2 deletions trunk/drivers/tty/tty_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,19 @@ static int tty_ldisc_halt(struct tty_struct *tty)
return cancel_delayed_work_sync(&tty->buf.work);
}

/**
* tty_ldisc_flush_works - flush all works of a tty
* @tty: tty device to flush works for
*
* Sync flush all works belonging to @tty.
*/
static void tty_ldisc_flush_works(struct tty_struct *tty)
{
flush_work_sync(&tty->hangup_work);
flush_work_sync(&tty->SAK_work);
flush_delayed_work_sync(&tty->buf.work);
}

/**
* tty_ldisc_wait_idle - wait for the ldisc to become idle
* @tty: tty to wait for
Expand Down Expand Up @@ -653,7 +666,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)

mutex_unlock(&tty->ldisc_mutex);

flush_scheduled_work();
tty_ldisc_flush_works(tty);

retval = tty_ldisc_wait_idle(tty);

Expand Down Expand Up @@ -905,7 +918,7 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)

tty_unlock();
tty_ldisc_halt(tty);
flush_scheduled_work();
tty_ldisc_flush_works(tty);
tty_lock();

mutex_lock(&tty->ldisc_mutex);
Expand Down

0 comments on commit d75570e

Please sign in to comment.