Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207907
b: refs/heads/master
c: ec79d60
h: refs/heads/master
i:
  207905: 388570f
  207903: c980b82
v: v3
  • Loading branch information
Arnd Bergmann authored and Greg Kroah-Hartman committed Aug 10, 2010
1 parent 87e5dfd commit 8e3ab4e
Show file tree
Hide file tree
Showing 18 changed files with 162 additions and 116 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: 3f582b8c11014e4ce310d9839fb335164195333f
refs/heads/master: ec79d6056de58511d8e46d9ae59d3878f958dc3e
16 changes: 8 additions & 8 deletions trunk/drivers/char/amiserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ static int get_serial_info(struct async_struct * info,
if (!retinfo)
return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
lock_kernel();
tty_lock();
tmp.type = state->type;
tmp.line = state->line;
tmp.port = state->port;
Expand All @@ -1083,7 +1083,7 @@ static int get_serial_info(struct async_struct * info,
tmp.close_delay = state->close_delay;
tmp.closing_wait = state->closing_wait;
tmp.custom_divisor = state->custom_divisor;
unlock_kernel();
tty_unlock();
if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
return -EFAULT;
return 0;
Expand All @@ -1100,14 +1100,14 @@ static int set_serial_info(struct async_struct * info,
if (copy_from_user(&new_serial,new_info,sizeof(new_serial)))
return -EFAULT;

lock_kernel();
tty_lock();
state = info->state;
old_state = *state;

change_irq = new_serial.irq != state->irq;
change_port = (new_serial.port != state->port);
if(change_irq || change_port || (new_serial.xmit_fifo_size != state->xmit_fifo_size)) {
unlock_kernel();
tty_unlock();
return -EINVAL;
}

Expand All @@ -1127,7 +1127,7 @@ static int set_serial_info(struct async_struct * info,
}

if (new_serial.baud_base < 9600) {
unlock_kernel();
tty_unlock();
return -EINVAL;
}

Expand Down Expand Up @@ -1163,7 +1163,7 @@ static int set_serial_info(struct async_struct * info,
}
} else
retval = startup(info);
unlock_kernel();
tty_unlock();
return retval;
}

Expand Down Expand Up @@ -1538,7 +1538,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)

orig_jiffies = jiffies;

lock_kernel();
tty_lock_nested(); /* tty_wait_until_sent is called from lots of places */
/*
* Set the check interval to be 1/5 of the estimated time to
* send a single character, and make it at least 1. The check
Expand Down Expand Up @@ -1579,7 +1579,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
break;
}
__set_current_state(TASK_RUNNING);
unlock_kernel();
tty_unlock();
#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies);
#endif
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/char/briq_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ static void set_led(char state)

static int briq_panel_open(struct inode *ino, struct file *filep)
{
lock_kernel();
tty_lock();
/* enforce single access, vfd_is_open is protected by BKL */
if (vfd_is_open) {
unlock_kernel();
tty_unlock();
return -EBUSY;
}
vfd_is_open = 1;

unlock_kernel();
tty_unlock();
return 0;
}

Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/char/n_hdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,18 +598,18 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
return -EFAULT;
}

lock_kernel();
tty_lock();

for (;;) {
if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
unlock_kernel();
tty_unlock();
return -EIO;
}

n_hdlc = tty2n_hdlc (tty);
if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC ||
tty != n_hdlc->tty) {
unlock_kernel();
tty_unlock();
return 0;
}

Expand All @@ -619,13 +619,13 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,

/* no data */
if (file->f_flags & O_NONBLOCK) {
unlock_kernel();
tty_unlock();
return -EAGAIN;
}

interruptible_sleep_on (&tty->read_wait);
if (signal_pending(current)) {
unlock_kernel();
tty_unlock();
return -EINTR;
}
}
Expand All @@ -648,7 +648,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
kfree(rbuf);
else
n_hdlc_buf_put(&n_hdlc->rx_free_buf_list,rbuf);
unlock_kernel();
tty_unlock();
return ret;

} /* end of n_hdlc_tty_read() */
Expand Down Expand Up @@ -691,7 +691,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
count = maxframe;
}

lock_kernel();
tty_lock();

add_wait_queue(&tty->write_wait, &wait);
set_current_state(TASK_INTERRUPTIBLE);
Expand Down Expand Up @@ -731,7 +731,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
n_hdlc_buf_put(&n_hdlc->tx_buf_list,tbuf);
n_hdlc_send_frames(n_hdlc,tty);
}
unlock_kernel();
tty_unlock();
return error;

} /* end of n_hdlc_tty_write() */
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/char/n_r3964.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,

TRACE_L("read()");

lock_kernel();
tty_lock();

pClient = findClient(pInfo, task_pid(current));
if (pClient) {
Expand Down Expand Up @@ -1109,7 +1109,7 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
}
ret = -EPERM;
unlock:
unlock_kernel();
tty_unlock();
return ret;
}

Expand Down Expand Up @@ -1158,7 +1158,7 @@ static ssize_t r3964_write(struct tty_struct *tty, struct file *file,
pHeader->locks = 0;
pHeader->owner = NULL;

lock_kernel();
tty_lock();

pClient = findClient(pInfo, task_pid(current));
if (pClient) {
Expand All @@ -1177,7 +1177,7 @@ static ssize_t r3964_write(struct tty_struct *tty, struct file *file,
add_tx_queue(pInfo, pHeader);
trigger_transmit(pInfo);

unlock_kernel();
tty_unlock();

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/char/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,9 @@ static int ptmx_open(struct inode *inode, struct file *filp)
{
int ret;

lock_kernel();
tty_lock();
ret = __ptmx_open(inode, filp);
unlock_kernel();
tty_unlock();
return ret;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/char/selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ int paste_selection(struct tty_struct *tty)
struct tty_ldisc *ld;
DECLARE_WAITQUEUE(wait, current);

lock_kernel();
tty_lock_nested(); /* always called with BTM from vt_ioctl */

acquire_console_sem();
poke_blanked_console();
Expand All @@ -338,6 +338,6 @@ int paste_selection(struct tty_struct *tty)
__set_current_state(TASK_RUNNING);

tty_ldisc_deref(ld);
unlock_kernel();
tty_unlock();
return 0;
}
4 changes: 2 additions & 2 deletions trunk/drivers/char/serial167.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
printk("cy_ioctl %s, cmd = %x arg = %lx\n", tty->name, cmd, arg); /* */
#endif

lock_kernel();
tty_lock();

switch (cmd) {
case CYGETMON:
Expand Down Expand Up @@ -1561,7 +1561,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
default:
ret_val = -ENOIOCTLCMD;
}
unlock_kernel();
tty_unlock();

#ifdef SERIAL_DEBUG_OTHER
printk("cy_ioctl done\n");
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/char/sx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
if (!capable(CAP_SYS_RAWIO))
return -EPERM;

lock_kernel();
tty_lock();

sx_dprintk(SX_DEBUG_FIRMWARE, "IOCTL %x: %lx\n", cmd, arg);

Expand Down Expand Up @@ -1848,7 +1848,7 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
break;
}
out:
unlock_kernel();
tty_unlock();
func_exit();
return rc;
}
Expand All @@ -1859,7 +1859,7 @@ static int sx_break(struct tty_struct *tty, int flag)
int rv;

func_enter();
lock_kernel();
tty_lock();

if (flag)
rv = sx_send_command(port, HS_START, -1, HS_IDLE_BREAK);
Expand All @@ -1868,7 +1868,7 @@ static int sx_break(struct tty_struct *tty, int flag)
if (rv != 1)
printk(KERN_ERR "sx: couldn't send break (%x).\n",
read_sx_byte(port->board, CHAN_OFFSET(port, hi_hstat)));
unlock_kernel();
tty_unlock();
func_exit();
return 0;
}
Expand Down Expand Up @@ -1909,7 +1909,7 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp,
/* func_enter2(); */

rc = 0;
lock_kernel();
tty_lock();
switch (cmd) {
case TIOCGSERIAL:
rc = gs_getserial(&port->gs, argp);
Expand All @@ -1921,7 +1921,7 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp,
rc = -ENOIOCTLCMD;
break;
}
unlock_kernel();
tty_unlock();

/* func_exit(); */
return rc;
Expand Down
Loading

0 comments on commit 8e3ab4e

Please sign in to comment.