Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325581
b: refs/heads/master
c: 95f4d5f
h: refs/heads/master
i:
  325579: 81cf25b
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Jun 12, 2012
1 parent 353f3c6 commit 050aa35
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 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: 042e6c29c16c9c20c31110b611ed60187b0c873a
refs/heads/master: 95f4d5f01bb56b4f940c8b44be8e71c5f35f2069
4 changes: 3 additions & 1 deletion trunk/arch/um/drivers/chan_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ void chan_enable_winch(struct chan *chan, struct tty_struct *tty)
static void line_timer_cb(struct work_struct *work)
{
struct line *line = container_of(work, struct line, task.work);
struct tty_struct *tty = tty_port_tty_get(&line->port);

if (!line->throttled)
chan_interrupt(line, line->tty, line->driver->read_irq);
chan_interrupt(line, tty, line->driver->read_irq);
tty_kref_put(tty);
}

int enable_chan(struct line *line)
Expand Down
25 changes: 18 additions & 7 deletions trunk/arch/um/drivers/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ static irqreturn_t line_interrupt(int irq, void *data)
{
struct chan *chan = data;
struct line *line = chan->line;
struct tty_struct *tty = tty_port_tty_get(&line->port);

if (line)
chan_interrupt(line, line->tty, irq);
chan_interrupt(line, tty, irq);
tty_kref_put(tty);
return IRQ_HANDLED;
}

Expand Down Expand Up @@ -333,7 +335,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data)
{
struct chan *chan = data;
struct line *line = chan->line;
struct tty_struct *tty = line->tty;
struct tty_struct *tty;
int err;

/*
Expand All @@ -352,10 +354,13 @@ static irqreturn_t line_write_interrupt(int irq, void *data)
}
spin_unlock(&line->lock);

tty = tty_port_tty_get(&line->port);
if (tty == NULL)
return IRQ_NONE;

tty_wakeup(tty);
tty_kref_put(tty);

return IRQ_HANDLED;
}

Expand Down Expand Up @@ -409,7 +414,7 @@ int line_open(struct line *lines, struct tty_struct *tty)

BUG_ON(tty->driver_data);
tty->driver_data = line;
line->tty = tty;
tty_port_tty_set(&line->port, tty);

err = enable_chan(line);
if (err) /* line_close() will be called by our caller */
Expand Down Expand Up @@ -449,7 +454,7 @@ void line_close(struct tty_struct *tty, struct file * filp)
if (--line->port.count)
goto out_unlock;

line->tty = NULL;
tty_port_tty_set(&line->port, NULL);
tty->driver_data = NULL;

if (line->sigio) {
Expand Down Expand Up @@ -610,9 +615,15 @@ int line_get_config(char *name, struct line *lines, unsigned int num, char *str,
mutex_lock(&line->count_lock);
if (!line->valid)
CONFIG_CHUNK(str, size, n, "none", 1);
else if (line->tty == NULL)
CONFIG_CHUNK(str, size, n, line->init_str, 1);
else n = chan_config_string(line, str, size, error_out);
else {
struct tty_struct *tty = tty_port_tty_get(&line->port);
if (tty == NULL) {
CONFIG_CHUNK(str, size, n, line->init_str, 1);
} else {
n = chan_config_string(line, str, size, error_out);
tty_kref_put(tty);
}
}
mutex_unlock(&line->count_lock);

return n;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/um/drivers/line.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ struct line_driver {

struct line {
struct tty_port port;
struct tty_struct *tty;
struct mutex count_lock;
int valid;

Expand Down

0 comments on commit 050aa35

Please sign in to comment.