Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1305427
| From | Peter Hurley <peter@hurleysoftware.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 01/19] staging: digi: Replace open-coded tty_wakeup() |
| Date | 2016-01-10 05:50 +0100 |
| Message-ID | <qPg70-7Hn-33@gated-at.bofh.it> (permalink) |
| References | <qzyUh-8cQ-9@gated-at.bofh.it> <qPg6Z-7Hn-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The open-coded tty_wakeup()s are attempts to workaround fixed bugs
in the line discipline write_wakeup() method. Replace with tty_wakeup().
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
drivers/staging/dgap/dgap.c | 28 ++++++----------------------
drivers/staging/dgnc/dgnc_tty.c | 18 ++----------------
2 files changed, 8 insertions(+), 38 deletions(-)
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index bad3551..dfbae21 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -1665,9 +1665,7 @@ static void dgap_input(struct channel_t *ch)
}
static void dgap_write_wakeup(struct board_t *bd, struct channel_t *ch,
- struct un_t *un, u32 mask,
- unsigned long *irq_flags1,
- unsigned long *irq_flags2)
+ struct un_t *un, u32 mask)
{
if (!(un->un_flags & mask))
return;
@@ -1677,17 +1675,7 @@ static void dgap_write_wakeup(struct board_t *bd, struct channel_t *ch,
if (!(un->un_flags & UN_ISOPEN))
return;
- if ((un->un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- un->un_tty->ldisc->ops->write_wakeup) {
- spin_unlock_irqrestore(&ch->ch_lock, *irq_flags2);
- spin_unlock_irqrestore(&bd->bd_lock, *irq_flags1);
-
- (un->un_tty->ldisc->ops->write_wakeup)(un->un_tty);
-
- spin_lock_irqsave(&bd->bd_lock, *irq_flags1);
- spin_lock_irqsave(&ch->ch_lock, *irq_flags2);
- }
- wake_up_interruptible(&un->un_tty->write_wait);
+ tty_wakeup(un->un_tty);
wake_up_interruptible(&un->un_flags_wait);
}
@@ -1952,10 +1940,8 @@ static int dgap_event(struct board_t *bd)
* Process Transmit low.
*/
if (reason & IFTLW) {
- dgap_write_wakeup(bd, ch, &ch->ch_tun, UN_LOW,
- &lock_flags, &lock_flags2);
- dgap_write_wakeup(bd, ch, &ch->ch_pun, UN_LOW,
- &lock_flags, &lock_flags2);
+ dgap_write_wakeup(bd, ch, &ch->ch_tun, UN_LOW);
+ dgap_write_wakeup(bd, ch, &ch->ch_pun, UN_LOW);
if (ch->ch_flags & CH_WLOW) {
ch->ch_flags &= ~CH_WLOW;
wake_up_interruptible(&ch->ch_flags_wait);
@@ -1966,10 +1952,8 @@ static int dgap_event(struct board_t *bd)
* Process Transmit empty.
*/
if (reason & IFTEM) {
- dgap_write_wakeup(bd, ch, &ch->ch_tun, UN_EMPTY,
- &lock_flags, &lock_flags2);
- dgap_write_wakeup(bd, ch, &ch->ch_pun, UN_EMPTY,
- &lock_flags, &lock_flags2);
+ dgap_write_wakeup(bd, ch, &ch->ch_tun, UN_EMPTY);
+ dgap_write_wakeup(bd, ch, &ch->ch_pun, UN_EMPTY);
if (ch->ch_flags & CH_WEMPTY) {
ch->ch_flags &= ~CH_WEMPTY;
wake_up_interruptible(&ch->ch_flags_wait);
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 48e4b90..c152048 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -933,14 +933,7 @@ void dgnc_wakeup_writes(struct channel_t *ch)
}
if (ch->ch_tun.un_flags & UN_ISOPEN) {
- if ((ch->ch_tun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- ch->ch_tun.un_tty->ldisc->ops->write_wakeup) {
- spin_unlock_irqrestore(&ch->ch_lock, flags);
- ch->ch_tun.un_tty->ldisc->ops->write_wakeup(ch->ch_tun.un_tty);
- spin_lock_irqsave(&ch->ch_lock, flags);
- }
-
- wake_up_interruptible(&ch->ch_tun.un_tty->write_wait);
+ tty_wakeup(ch->ch_tun.un_tty);
/*
* If unit is set to wait until empty, check to make sure
@@ -975,14 +968,7 @@ void dgnc_wakeup_writes(struct channel_t *ch)
}
if (ch->ch_pun.un_flags & UN_ISOPEN) {
- if ((ch->ch_pun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- ch->ch_pun.un_tty->ldisc->ops->write_wakeup) {
- spin_unlock_irqrestore(&ch->ch_lock, flags);
- ch->ch_pun.un_tty->ldisc->ops->write_wakeup(ch->ch_pun.un_tty);
- spin_lock_irqsave(&ch->ch_lock, flags);
- }
-
- wake_up_interruptible(&ch->ch_pun.un_tty->write_wait);
+ tty_wakeup(ch->ch_pun.un_tty);
/*
* If unit is set to wait until empty, check to make sure
--
2.7.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 00/19] Fix driver crashes on hangup Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v2 05/19] tty: Remove chars_in_buffer() line discipline method Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v2 14/19] tty: Move tty_ldisc_kill() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v2 01/19] staging: digi: Replace open-coded tty_wakeup() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v2 12/19] tty: Prepare for destroying line discipline on hangup Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v2 08/19] tty: Reset c_line from driver's init_termios Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v2 02/19] serial: 68328: Remove bogus ldisc reset Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v2 16/19] tty: Refactor tty_ldisc_reinit() for reuse Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v2 03/19] bluetooth: hci_ldisc: Remove dead code Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 05:50 +0100
[PATCH v3 19/19] tty: Avoid unnecessary temporaries for tty->ldisc Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 17/19] tty: Destroy ldisc instance on hangup Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 08/19] tty: Reset c_line from driver's init_termios Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 06/19] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 04/19] NFC: nci: Remove dead code Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 15/19] tty: Use 'disc' for line discipline index name Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 01/19] staging: digi: Replace open-coded tty_wakeup() Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 14/19] tty: Move tty_ldisc_kill() Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 05/19] tty: Remove chars_in_buffer() line discipline method Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 02/19] serial: 68328: Remove bogus ldisc reset Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
Re: [PATCH v3 02/19] serial: 68328: Remove bogus ldisc reset One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-11 15:20 +0100
[PATCH v3 13/19] tty: Handle NULL tty->ldisc Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 12/19] tty: Prepare for destroying line discipline on hangup Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 03/19] bluetooth: hci_ldisc: Remove dead code Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 10/19] tty: Fix comments for tty_ldisc_get() Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 07/19] n_tty: Fix unsafe reference to "other" ldisc Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 11/19] tty: Fix comments for tty_ldisc_release() Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 09/19] staging/speakup: Use tty_ldisc_ref() for paste kworker Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 18/19] tty: Document c_line == N_TTY initial condition Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 16/19] tty: Refactor tty_ldisc_reinit() for reuse Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
[PATCH v3 00/19] Fix driver crashes on hangup Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 07:50 +0100
csiph-web