Commit 7b130c0e authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

cyclades: Prepare for relaxed locking in callers

Basically wrap it in lock_kernel where it is hard to prove the locking is
ok.
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Cc: "John Stoffel" <john@stoffel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e18ce49b
...@@ -3464,6 +3464,8 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file) ...@@ -3464,6 +3464,8 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
if (serial_paranoia_check(info, tty->name, __FUNCTION__)) if (serial_paranoia_check(info, tty->name, __FUNCTION__))
return -ENODEV; return -ENODEV;
lock_kernel();
card = info->card; card = info->card;
channel = info->line - card->first_line; channel = info->line - card->first_line;
if (!IS_CYC_Z(*card)) { if (!IS_CYC_Z(*card)) {
...@@ -3506,10 +3508,12 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file) ...@@ -3506,10 +3508,12 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
((lstatus & C_RS_CTS) ? TIOCM_CTS : 0); ((lstatus & C_RS_CTS) ? TIOCM_CTS : 0);
} else { } else {
result = 0; result = 0;
unlock_kernel();
return -ENODEV; return -ENODEV;
} }
} }
unlock_kernel();
return result; return result;
} /* cy_tiomget */ } /* cy_tiomget */
...@@ -3880,6 +3884,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file, ...@@ -3880,6 +3884,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
printk(KERN_DEBUG "cyc:cy_ioctl ttyC%d, cmd = %x arg = %lx\n", printk(KERN_DEBUG "cyc:cy_ioctl ttyC%d, cmd = %x arg = %lx\n",
info->line, cmd, arg); info->line, cmd, arg);
#endif #endif
lock_kernel();
switch (cmd) { switch (cmd) {
case CYGETMON: case CYGETMON:
...@@ -3988,47 +3993,47 @@ cy_ioctl(struct tty_struct *tty, struct file *file, ...@@ -3988,47 +3993,47 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
p_cuser = argp; p_cuser = argp;
ret_val = put_user(cnow.cts, &p_cuser->cts); ret_val = put_user(cnow.cts, &p_cuser->cts);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.dsr, &p_cuser->dsr); ret_val = put_user(cnow.dsr, &p_cuser->dsr);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.rng, &p_cuser->rng); ret_val = put_user(cnow.rng, &p_cuser->rng);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.dcd, &p_cuser->dcd); ret_val = put_user(cnow.dcd, &p_cuser->dcd);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.rx, &p_cuser->rx); ret_val = put_user(cnow.rx, &p_cuser->rx);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.tx, &p_cuser->tx); ret_val = put_user(cnow.tx, &p_cuser->tx);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.frame, &p_cuser->frame); ret_val = put_user(cnow.frame, &p_cuser->frame);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.overrun, &p_cuser->overrun); ret_val = put_user(cnow.overrun, &p_cuser->overrun);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.parity, &p_cuser->parity); ret_val = put_user(cnow.parity, &p_cuser->parity);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.brk, &p_cuser->brk); ret_val = put_user(cnow.brk, &p_cuser->brk);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = put_user(cnow.buf_overrun, &p_cuser->buf_overrun); ret_val = put_user(cnow.buf_overrun, &p_cuser->buf_overrun);
if (ret_val) if (ret_val)
return ret_val; break;
ret_val = 0; ret_val = 0;
break; break;
default: default:
ret_val = -ENOIOCTLCMD; ret_val = -ENOIOCTLCMD;
} }
unlock_kernel();
#ifdef CY_DEBUG_OTHER #ifdef CY_DEBUG_OTHER
printk(KERN_DEBUG "cyc:cy_ioctl done\n"); printk(KERN_DEBUG "cyc:cy_ioctl done\n");
#endif #endif
return ret_val; return ret_val;
} /* cy_ioctl */ } /* cy_ioctl */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment