blob: c84446ed0d468f5b6ef01bb6c76cd59ae6a0c407 [file] [log] [blame]
From 65c1f7a08b0753df70e85543a6f5bbb899064720 Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Sun, 16 Jan 2011 19:42:30 -0500
Subject: [PATCH] printk: convert console_sem to console_mutex
Convert console_sem to console_mutex, and all related code.
Once done with printk.c you can get the others with:
for i in `git grep -l acquire_console_sem` ; do
mv $i $i~
cat $i~ |sed 's/acquire_console_sem/acquire_console_mutex/' > $i
done
There are also several instances of console_sem in comments that
need to be sedified accordingly.
This is one of several extractions from the merge up to 33-rc8.
You can find the origin of this change in the tip merge commit:
commit 5f854cfc024622e4aae14d7cf422f6ff86278688
Merge: cc24da0 4ec62b2
Author: Thomas Gleixner <tglx@linutronix.de>
Date: Sun Feb 21 20:17:22 2010 +0100
Forward to 2.6.33-rc8
Merge branch 'linus' into rt/head with a pile of conflicts.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Normally there are not significant changes/additions in a merge commit that
are not from any other "normal" commit. But in this case there are, so
break them out into separate explicit commits.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/drivers/char/bfin_jtag_comm.c b/drivers/char/bfin_jtag_comm.c
index 2628c74..6de1f8e 100644
--- a/drivers/char/bfin_jtag_comm.c
+++ b/drivers/char/bfin_jtag_comm.c
@@ -182,16 +182,16 @@ bfin_jc_circ_write(const unsigned char *buf, int count)
}
#ifndef CONFIG_BFIN_JTAG_COMM_CONSOLE
-# define acquire_console_sem()
-# define release_console_sem()
+# define acquire_console_mutex()
+# define release_console_mutex()
#endif
static int
bfin_jc_write(struct tty_struct *tty, const unsigned char *buf, int count)
{
int i;
- acquire_console_sem();
+ acquire_console_mutex();
i = bfin_jc_circ_write(buf, count);
- release_console_sem();
+ release_console_mutex();
wake_up_process(bfin_jc_kthread);
return i;
}
diff --git a/drivers/char/selection.c b/drivers/char/selection.c
index f97b9e8..a382302 100644
--- a/drivers/char/selection.c
+++ b/drivers/char/selection.c
@@ -312,9 +312,9 @@ int paste_selection(struct tty_struct *tty)
struct tty_ldisc *ld;
DECLARE_WAITQUEUE(wait, current);
- acquire_console_sem();
+ acquire_console_mutex();
poke_blanked_console();
- release_console_sem();
+ release_console_mutex();
ld = tty_ldisc_ref_wait(tty);
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index c1791a6..3e92ac2 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -115,7 +115,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
/* Select the proper current console and verify
* sanity of the situation under the console lock.
*/
- acquire_console_sem();
+ acquire_console_mutex();
attr = (currcons & 128);
currcons = (currcons & 127);
@@ -246,9 +246,9 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
* the pagefault handling code may want to call printk().
*/
- release_console_sem();
+ release_console_mutex();
ret = copy_to_user(buf, con_buf_start, orig_count);
- acquire_console_sem();
+ acquire_console_mutex();
if (ret) {
read += (orig_count - ret);
@@ -264,7 +264,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
if (read)
ret = read;
unlock_out:
- release_console_sem();
+ release_console_mutex();
mutex_unlock(&con_buf_mtx);
return ret;
}
@@ -289,7 +289,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
/* Select the proper current console and verify
* sanity of the situation under the console lock.
*/
- acquire_console_sem();
+ acquire_console_mutex();
attr = (currcons & 128);
currcons = (currcons & 127);
@@ -324,9 +324,9 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
/* Temporarily drop the console lock so that we can read
* in the write data from userspace safely.
*/
- release_console_sem();
+ release_console_mutex();
ret = copy_from_user(con_buf, buf, this_round);
- acquire_console_sem();
+ acquire_console_mutex();
if (ret) {
this_round -= ret;
@@ -450,7 +450,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
ret = written;
unlock_out:
- release_console_sem();
+ release_console_mutex();
mutex_unlock(&con_buf_mtx);
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index e87aed9..223476e 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -981,9 +981,9 @@ static int vt_resize(struct tty_struct *tty, struct winsize *ws)
struct vc_data *vc = tty->driver_data;
int ret;
- acquire_console_sem();
+ acquire_console_mutex();
ret = vc_do_resize(tty, vc, ws->ws_col, ws->ws_row);
- release_console_sem();
+ release_console_mutex();
return ret;
}
@@ -1249,7 +1249,7 @@ static void default_attr(struct vc_data *vc)
vc->vc_color = vc->vc_def_color;
}
-/* console_sem is held */
+/* console_mutex is held */
static void csi_m(struct vc_data *vc)
{
int i;
@@ -1393,7 +1393,7 @@ int mouse_reporting(void)
return vc_cons[fg_console].d->vc_report_mouse;
}
-/* console_sem is held */
+/* console_mutex is held */
static void set_mode(struct vc_data *vc, int on_off)
{
int i;
@@ -1463,7 +1463,7 @@ static void set_mode(struct vc_data *vc, int on_off)
}
}
-/* console_sem is held */
+/* console_mutex is held */
static void setterm_command(struct vc_data *vc)
{
switch(vc->vc_par[0]) {
@@ -1523,7 +1523,7 @@ static void setterm_command(struct vc_data *vc)
}
}
-/* console_sem is held */
+/* console_mutex is held */
static void csi_at(struct vc_data *vc, unsigned int nr)
{
if (nr > vc->vc_cols - vc->vc_x)
@@ -1533,7 +1533,7 @@ static void csi_at(struct vc_data *vc, unsigned int nr)
insert_char(vc, nr);
}
-/* console_sem is held */
+/* console_mutex is held */
static void csi_L(struct vc_data *vc, unsigned int nr)
{
if (nr > vc->vc_rows - vc->vc_y)
@@ -1544,7 +1544,7 @@ static void csi_L(struct vc_data *vc, unsigned int nr)
vc->vc_need_wrap = 0;
}
-/* console_sem is held */
+/* console_mutex is held */
static void csi_P(struct vc_data *vc, unsigned int nr)
{
if (nr > vc->vc_cols - vc->vc_x)
@@ -1554,7 +1554,7 @@ static void csi_P(struct vc_data *vc, unsigned int nr)
delete_char(vc, nr);
}
-/* console_sem is held */
+/* console_mutex is held */
static void csi_M(struct vc_data *vc, unsigned int nr)
{
if (nr > vc->vc_rows - vc->vc_y)
@@ -1565,7 +1565,7 @@ static void csi_M(struct vc_data *vc, unsigned int nr)
vc->vc_need_wrap = 0;
}
-/* console_sem is held (except via vc_init->reset_terminal */
+/* console_mutex is held (except via vc_init->reset_terminal */
static void save_cur(struct vc_data *vc)
{
vc->vc_saved_x = vc->vc_x;
@@ -1581,7 +1581,7 @@ static void save_cur(struct vc_data *vc)
vc->vc_saved_G1 = vc->vc_G1_charset;
}
-/* console_sem is held */
+/* console_mutex is held */
static void restore_cur(struct vc_data *vc)
{
gotoxy(vc, vc->vc_saved_x, vc->vc_saved_y);
@@ -1603,7 +1603,7 @@ enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey,
EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd,
ESpalette };
-/* console_sem is held (except via vc_init()) */
+/* console_mutex is held (except via vc_init()) */
static void reset_terminal(struct vc_data *vc, int do_clear)
{
vc->vc_top = 0;
@@ -1663,7 +1663,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear)
csi_J(vc, 2);
}
-/* console_sem is held */
+/* console_mutex is held */
static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
{
/*
@@ -2097,7 +2097,7 @@ static int is_double_width(uint32_t ucs)
return bisearch(ucs, double_width, ARRAY_SIZE(double_width) - 1);
}
-/* acquires console_sem */
+/* acquires console_mutex */
static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int count)
{
#ifdef VT_BUF_VRAM_ONLY
@@ -2125,11 +2125,11 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
might_sleep();
- acquire_console_sem();
+ acquire_console_mutex();
vc = tty->driver_data;
if (vc == NULL) {
printk(KERN_ERR "vt: argh, driver_data is NULL !\n");
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -2137,7 +2137,7 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
if (!vc_cons_allocated(currcons)) {
/* could this happen? */
printk_once("con_write: tty %d not allocated\n", currcons+1);
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -2353,7 +2353,7 @@ rescan_last_byte:
}
FLUSH
console_conditional_schedule();
- release_console_sem();
+ release_console_mutex();
notify_update(vc);
return n;
#undef FLUSH
@@ -2366,11 +2366,11 @@ rescan_last_byte:
* us to do the switches asynchronously (needed when we want
* to switch due to a keyboard interrupt). Synchronization
* with other console code and prevention of re-entrancy is
- * ensured with console_sem.
+ * ensured with console_mutex.
*/
static void console_callback(struct work_struct *ignored)
{
- acquire_console_sem();
+ acquire_console_mutex();
if (want_console >= 0) {
if (want_console != fg_console &&
@@ -2400,7 +2400,7 @@ static void console_callback(struct work_struct *ignored)
}
notify_update(vc_cons[fg_console].d);
- release_console_sem();
+ release_console_mutex();
}
int set_console(int nr)
@@ -2581,7 +2581,7 @@ static struct console vt_console_driver = {
*/
/*
- * Generally a bit racy with respect to console_sem().
+ * Generally a bit racy with respect to console_mutex().
*
* There are some functions which don't need it.
*
@@ -2609,17 +2609,17 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
switch (type)
{
case TIOCL_SETSEL:
- acquire_console_sem();
+ acquire_console_mutex();
ret = set_selection((struct tiocl_selection __user *)(p+1), tty);
- release_console_sem();
+ release_console_mutex();
break;
case TIOCL_PASTESEL:
ret = paste_selection(tty);
break;
case TIOCL_UNBLANKSCREEN:
- acquire_console_sem();
+ acquire_console_mutex();
unblank_screen();
- release_console_sem();
+ release_console_mutex();
break;
case TIOCL_SELLOADLUT:
ret = sel_loadlut(p);
@@ -2668,10 +2668,10 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
}
break;
case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */
- acquire_console_sem();
+ acquire_console_mutex();
ignore_poke = 1;
do_blank_screen(0);
- release_console_sem();
+ release_console_mutex();
break;
case TIOCL_BLANKEDSCREEN:
ret = console_blanked;
@@ -2771,11 +2771,11 @@ static void con_flush_chars(struct tty_struct *tty)
return;
/* if we race with con_close(), vt may be null */
- acquire_console_sem();
+ acquire_console_mutex();
vc = tty->driver_data;
if (vc)
set_cursor(vc);
- release_console_sem();
+ release_console_mutex();
}
/*
@@ -2786,7 +2786,7 @@ static int con_open(struct tty_struct *tty, struct file *filp)
unsigned int currcons = tty->index;
int ret = 0;
- acquire_console_sem();
+ acquire_console_mutex();
if (tty->driver_data == NULL) {
ret = vc_allocate(currcons);
if (ret == 0) {
@@ -2794,7 +2794,7 @@ static int con_open(struct tty_struct *tty, struct file *filp)
/* Still being freed */
if (vc->vc_tty) {
- release_console_sem();
+ release_console_mutex();
return -ERESTARTSYS;
}
tty->driver_data = vc;
@@ -2808,11 +2808,11 @@ static int con_open(struct tty_struct *tty, struct file *filp)
tty->termios->c_iflag |= IUTF8;
else
tty->termios->c_iflag &= ~IUTF8;
- release_console_sem();
+ release_console_mutex();
return ret;
}
}
- release_console_sem();
+ release_console_mutex();
return ret;
}
@@ -2825,9 +2825,9 @@ static void con_shutdown(struct tty_struct *tty)
{
struct vc_data *vc = tty->driver_data;
BUG_ON(vc == NULL);
- acquire_console_sem();
+ acquire_console_mutex();
vc->vc_tty = NULL;
- release_console_sem();
+ release_console_mutex();
tty_shutdown(tty);
}
@@ -2874,13 +2874,13 @@ static int __init con_init(void)
struct vc_data *vc;
unsigned int currcons = 0, i;
- acquire_console_sem();
+ acquire_console_mutex();
if (conswitchp)
display_desc = conswitchp->con_startup();
if (!display_desc) {
fg_console = 0;
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -2926,7 +2926,7 @@ static int __init con_init(void)
printable = 1;
printk("\n");
- release_console_sem();
+ release_console_mutex();
#ifdef CONFIG_VT_CONSOLE
register_console(&vt_console_driver);
@@ -3006,7 +3006,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last,
if (!try_module_get(owner))
return -ENODEV;
- acquire_console_sem();
+ acquire_console_mutex();
/* check if driver is registered */
for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
@@ -3091,7 +3091,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last,
retval = 0;
err:
- release_console_sem();
+ release_console_mutex();
module_put(owner);
return retval;
};
@@ -3140,7 +3140,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
if (!try_module_get(owner))
return -ENODEV;
- acquire_console_sem();
+ acquire_console_mutex();
/* check if driver is registered and if it is unbindable */
for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
@@ -3154,7 +3154,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
}
if (retval) {
- release_console_sem();
+ release_console_mutex();
goto err;
}
@@ -3173,12 +3173,12 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
}
if (retval) {
- release_console_sem();
+ release_console_mutex();
goto err;
}
if (!con_is_bound(csw)) {
- release_console_sem();
+ release_console_mutex();
goto err;
}
@@ -3207,7 +3207,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
if (!con_is_bound(csw))
con_driver->flag &= ~CON_DRIVER_FLAG_INIT;
- release_console_sem();
+ release_console_mutex();
/* ignore return value, binding should not fail */
bind_con_driver(defcsw, first, last, deflt);
err:
@@ -3433,7 +3433,7 @@ int register_con_driver(const struct consw *csw, int first, int last)
if (!try_module_get(owner))
return -ENODEV;
- acquire_console_sem();
+ acquire_console_mutex();
for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
con_driver = &registered_con_driver[i];
@@ -3487,7 +3487,7 @@ int register_con_driver(const struct consw *csw, int first, int last)
}
err:
- release_console_sem();
+ release_console_mutex();
module_put(owner);
return retval;
}
@@ -3508,7 +3508,7 @@ int unregister_con_driver(const struct consw *csw)
{
int i, retval = -ENODEV;
- acquire_console_sem();
+ acquire_console_mutex();
/* cannot unregister a bound driver */
if (con_is_bound(csw))
@@ -3534,7 +3534,7 @@ int unregister_con_driver(const struct consw *csw)
}
}
err:
- release_console_sem();
+ release_console_mutex();
return retval;
}
EXPORT_SYMBOL(unregister_con_driver);
@@ -3828,9 +3828,9 @@ int con_set_cmap(unsigned char __user *arg)
{
int rc;
- acquire_console_sem();
+ acquire_console_mutex();
rc = set_get_cmap (arg,1);
- release_console_sem();
+ release_console_mutex();
return rc;
}
@@ -3839,9 +3839,9 @@ int con_get_cmap(unsigned char __user *arg)
{
int rc;
- acquire_console_sem();
+ acquire_console_mutex();
rc = set_get_cmap (arg,0);
- release_console_sem();
+ release_console_mutex();
return rc;
}
@@ -3888,12 +3888,12 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)
} else
font.data = NULL;
- acquire_console_sem();
+ acquire_console_mutex();
if (vc->vc_sw->con_font_get)
rc = vc->vc_sw->con_font_get(vc, &font);
else
rc = -ENOSYS;
- release_console_sem();
+ release_console_mutex();
if (rc)
goto out;
@@ -3974,12 +3974,12 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op)
kfree(font.data);
return -EFAULT;
}
- acquire_console_sem();
+ acquire_console_mutex();
if (vc->vc_sw->con_font_set)
rc = vc->vc_sw->con_font_set(vc, &font, op->flags);
else
rc = -ENOSYS;
- release_console_sem();
+ release_console_mutex();
kfree(font.data);
return rc;
}
@@ -4001,12 +4001,12 @@ static int con_font_default(struct vc_data *vc, struct console_font_op *op)
else
name[MAX_FONT_NAME - 1] = 0;
- acquire_console_sem();
+ acquire_console_mutex();
if (vc->vc_sw->con_font_default)
rc = vc->vc_sw->con_font_default(vc, &font, s);
else
rc = -ENOSYS;
- release_console_sem();
+ release_console_mutex();
if (!rc) {
op->width = font.width;
op->height = font.height;
@@ -4022,7 +4022,7 @@ static int con_font_copy(struct vc_data *vc, struct console_font_op *op)
if (vc->vc_mode != KD_TEXT)
return -EINVAL;
- acquire_console_sem();
+ acquire_console_mutex();
if (!vc->vc_sw->con_font_copy)
rc = -ENOSYS;
else if (con < 0 || !vc_cons_allocated(con))
@@ -4031,7 +4031,7 @@ static int con_font_copy(struct vc_data *vc, struct console_font_op *op)
rc = 0;
else
rc = vc->vc_sw->con_font_copy(vc, con);
- release_console_sem();
+ release_console_mutex();
return rc;
}
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 87778dc..5efa434 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -648,12 +648,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
/*
* explicitly blank/unblank the screen if switching modes
*/
- acquire_console_sem();
+ acquire_console_mutex();
if (arg == KD_TEXT)
do_unblank_screen(1);
else
do_blank_screen(1);
- release_console_sem();
+ release_console_mutex();
break;
case KDGETMODE:
@@ -892,7 +892,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
ret = -EINVAL;
goto out;
}
- acquire_console_sem();
+ acquire_console_mutex();
vc->vt_mode = tmp;
/* the frsig is ignored, so we set it to 0 */
vc->vt_mode.frsig = 0;
@@ -900,7 +900,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
vc->vt_pid = get_pid(task_pid(current));
/* no switch is required -- saw@shade.msu.ru */
vc->vt_newvt = -1;
- release_console_sem();
+ release_console_mutex();
break;
}
@@ -909,9 +909,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
struct vt_mode tmp;
int rc;
- acquire_console_sem();
+ acquire_console_mutex();
memcpy(&tmp, &vc->vt_mode, sizeof(struct vt_mode));
- release_console_sem();
+ release_console_mutex();
rc = copy_to_user(up, &tmp, sizeof(struct vt_mode));
if (rc)
@@ -964,9 +964,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
ret = -ENXIO;
else {
arg--;
- acquire_console_sem();
+ acquire_console_mutex();
ret = vc_allocate(arg);
- release_console_sem();
+ release_console_mutex();
if (ret)
break;
set_console(arg);
@@ -989,7 +989,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
ret = -ENXIO;
else {
vsa.console--;
- acquire_console_sem();
+ acquire_console_mutex();
ret = vc_allocate(vsa.console);
if (ret == 0) {
struct vc_data *nvc;
@@ -1002,7 +1002,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
put_pid(nvc->vt_pid);
nvc->vt_pid = get_pid(task_pid(current));
}
- release_console_sem();
+ release_console_mutex();
if (ret)
break;
/* Commence switch and lock */
@@ -1043,7 +1043,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
/*
* Switching-from response
*/
- acquire_console_sem();
+ acquire_console_mutex();
if (vc->vt_newvt >= 0) {
if (arg == 0)
/*
@@ -1062,7 +1062,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
vc->vt_newvt = -1;
ret = vc_allocate(newvt);
if (ret) {
- release_console_sem();
+ release_console_mutex();
break;
}
/*
@@ -1082,7 +1082,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
if (arg != VT_ACKACQ)
ret = -EINVAL;
}
- release_console_sem();
+ release_console_mutex();
break;
/*
@@ -1095,20 +1095,20 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
}
if (arg == 0) {
/* deallocate all unused consoles, but leave 0 */
- acquire_console_sem();
+ acquire_console_mutex();
for (i=1; i<MAX_NR_CONSOLES; i++)
if (! VT_BUSY(i))
vc_deallocate(i);
- release_console_sem();
+ release_console_mutex();
} else {
/* deallocate a single console, if possible */
arg--;
if (VT_BUSY(arg))
ret = -EBUSY;
else if (arg) { /* leave 0 */
- acquire_console_sem();
+ acquire_console_mutex();
vc_deallocate(arg);
- release_console_sem();
+ release_console_mutex();
}
}
break;
@@ -1125,7 +1125,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
get_user(cc, &vtsizes->v_cols))
ret = -EFAULT;
else {
- acquire_console_sem();
+ acquire_console_mutex();
for (i = 0; i < MAX_NR_CONSOLES; i++) {
vc = vc_cons[i].d;
@@ -1134,7 +1134,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
vc_resize(vc_cons[i].d, cc, ll);
}
}
- release_console_sem();
+ release_console_mutex();
}
break;
}
@@ -1186,14 +1186,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
for (i = 0; i < MAX_NR_CONSOLES; i++) {
if (!vc_cons[i].d)
continue;
- acquire_console_sem();
+ acquire_console_mutex();
if (vlin)
vc_cons[i].d->vc_scan_lines = vlin;
if (clin)
vc_cons[i].d->vc_font.height = clin;
vc_cons[i].d->vc_resize_user = 1;
vc_resize(vc_cons[i].d, cc, ll);
- release_console_sem();
+ release_console_mutex();
}
break;
}
@@ -1364,7 +1364,7 @@ void vc_SAK(struct work_struct *work)
struct vc_data *vc;
struct tty_struct *tty;
- acquire_console_sem();
+ acquire_console_mutex();
vc = vc_con->d;
if (vc) {
tty = vc->vc_tty;
@@ -1376,7 +1376,7 @@ void vc_SAK(struct work_struct *work)
__do_SAK(tty);
reset_vc(vc);
}
- release_console_sem();
+ release_console_mutex();
}
#ifdef CONFIG_COMPAT
@@ -1735,10 +1735,10 @@ int vt_move_to_console(unsigned int vt, int alloc)
{
int prev;
- acquire_console_sem();
+ acquire_console_mutex();
/* Graphics mode - up to X */
if (disable_vt_switch) {
- release_console_sem();
+ release_console_mutex();
return 0;
}
prev = fg_console;
@@ -1746,7 +1746,7 @@ int vt_move_to_console(unsigned int vt, int alloc)
if (alloc && vc_allocate(vt)) {
/* we can't have a free VC for now. Too bad,
* we don't want to mess the screen for now. */
- release_console_sem();
+ release_console_mutex();
return -ENOSPC;
}
@@ -1756,10 +1756,10 @@ int vt_move_to_console(unsigned int vt, int alloc)
* Let the calling function know so it can decide
* what to do.
*/
- release_console_sem();
+ release_console_mutex();
return -EIO;
}
- release_console_sem();
+ release_console_mutex();
if (vt_waitactive(vt + 1)) {
pr_debug("Suspend: Can't switch VCs.");
return -EINTR;
@@ -1776,8 +1776,8 @@ int vt_move_to_console(unsigned int vt, int alloc)
*/
void pm_set_vt_switch(int do_switch)
{
- acquire_console_sem();
+ acquire_console_mutex();
disable_vt_switch = !do_switch;
- release_console_sem();
+ release_console_mutex();
}
EXPORT_SYMBOL(pm_set_vt_switch);
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index 30cc09e..0dd56b3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -219,9 +219,9 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state)
pci_set_power_state(pdev, PCI_D3hot);
}
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(dev_priv->fbdev_info, 1);
- release_console_sem();
+ release_console_mutex();
dev_priv->fbdev_info->flags = fbdev_flags;
return 0;
@@ -321,9 +321,9 @@ nouveau_pci_resume(struct pci_dev *pdev)
nv_crtc->lut.depth = 0;
}
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(dev_priv->fbdev_info, 0);
- release_console_sem();
+ release_console_mutex();
nouveau_fbcon_zfill(dev);
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index e28e4ed..10dcc5a 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -863,9 +863,9 @@ int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
pci_disable_device(dev->pdev);
pci_set_power_state(dev->pdev, PCI_D3hot);
}
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(rdev->fbdev_info, 1);
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -876,11 +876,11 @@ int radeon_resume_kms(struct drm_device *dev)
if (rdev->powered_down)
return 0;
- acquire_console_sem();
+ acquire_console_mutex();
pci_set_power_state(dev->pdev, PCI_D0);
pci_restore_state(dev->pdev);
if (pci_enable_device(dev->pdev)) {
- release_console_sem();
+ release_console_mutex();
return -1;
}
pci_set_master(dev->pdev);
@@ -889,7 +889,7 @@ int radeon_resume_kms(struct drm_device *dev)
radeon_resume(rdev);
radeon_restore_bios_scratch_regs(rdev);
fb_set_suspend(rdev->fbdev_info, 0);
- release_console_sem();
+ release_console_mutex();
/* reset hpd state */
radeon_hpd_init(rdev);
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c
index a2f2b32..499962e 100644
--- a/drivers/serial/sb1250-duart.c
+++ b/drivers/serial/sb1250-duart.c
@@ -829,7 +829,7 @@ static void __init sbd_probe_duarts(void)
#ifdef CONFIG_SERIAL_SB1250_DUART_CONSOLE
/*
* Serial console stuff. Very basic, polling driver for doing serial
- * console output. The console_sem is held by the caller, so we
+ * console output. The console_mutex is held by the caller, so we
* shouldn't be interrupted for more console activity.
*/
static void sbd_console_putchar(struct uart_port *uport, int ch)
diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c
index 9c82a1a..1a76456 100644
--- a/drivers/staging/sm7xx/smtcfb.c
+++ b/drivers/staging/sm7xx/smtcfb.c
@@ -1042,9 +1042,9 @@ static int __maybe_unused smtcfb_suspend(struct pci_dev *pdev, pm_message_t msg)
/* when doing suspend, call fb apis and pci apis */
if (msg.event == PM_EVENT_SUSPEND) {
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(&sfb->fb, 1);
- release_console_sem();
+ release_console_mutex();
retv = pci_save_state(pdev);
pci_disable_device(pdev);
retv = pci_choose_state(pdev, msg);
@@ -1103,9 +1103,9 @@ static int __maybe_unused smtcfb_resume(struct pci_dev *pdev)
smtcfb_setmode(sfb);
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(&sfb->fb, 0);
- release_console_sem();
+ release_console_mutex();
return 0;
}
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index d583bea..de7b771 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -23,7 +23,7 @@
#include <linux/svga.h>
#include <linux/init.h>
#include <linux/pci.h>
-#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */
+#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_mutex() */
#include <video/vga.h>
#ifdef CONFIG_MTRR
@@ -1091,12 +1091,12 @@ static int ark_pci_suspend (struct pci_dev* dev, pm_message_t state)
dev_info(info->device, "suspend\n");
- acquire_console_sem();
+ acquire_console_mutex();
mutex_lock(&(par->open_lock));
if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) {
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -1107,7 +1107,7 @@ static int ark_pci_suspend (struct pci_dev* dev, pm_message_t state)
pci_set_power_state(dev, pci_choose_state(dev, state));
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -1122,7 +1122,7 @@ static int ark_pci_resume (struct pci_dev* dev)
dev_info(info->device, "resume\n");
- acquire_console_sem();
+ acquire_console_mutex();
mutex_lock(&(par->open_lock));
if (par->ref_count == 0)
@@ -1141,7 +1141,7 @@ static int ark_pci_resume (struct pci_dev* dev)
fail:
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
#else
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 9ee67d6..ee087fe 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1858,11 +1858,11 @@ static void aty128_early_resume(void *data)
{
struct aty128fb_par *par = data;
- if (try_acquire_console_sem())
+ if (try_acquire_console_mutex())
return;
pci_restore_state(par->pdev);
aty128_do_resume(par->pdev);
- release_console_sem();
+ release_console_mutex();
}
#endif /* CONFIG_PPC_PMAC */
@@ -2436,7 +2436,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state)
printk(KERN_DEBUG "aty128fb: suspending...\n");
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(info, 1);
@@ -2468,7 +2468,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state)
if (state.event != PM_EVENT_ON)
aty128_set_suspend(par, 1);
- release_console_sem();
+ release_console_mutex();
pdev->dev.power.power_state = state;
@@ -2525,9 +2525,9 @@ static int aty128_pci_resume(struct pci_dev *pdev)
{
int rc;
- acquire_console_sem();
+ acquire_console_mutex();
rc = aty128_do_resume(pdev);
- release_console_sem();
+ release_console_mutex();
return rc;
}
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index e45ab8d..82360ba 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2073,7 +2073,7 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state)
if (state.event == pdev->dev.power.power_state.event)
return 0;
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(info, 1);
@@ -2101,14 +2101,14 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state)
par->lock_blank = 0;
atyfb_blank(FB_BLANK_UNBLANK, info);
fb_set_suspend(info, 0);
- release_console_sem();
+ release_console_mutex();
return -EIO;
}
#else
pci_set_power_state(pdev, pci_choose_state(pdev, state));
#endif
- release_console_sem();
+ release_console_mutex();
pdev->dev.power.power_state = state;
@@ -2137,7 +2137,7 @@ static int atyfb_pci_resume(struct pci_dev *pdev)
if (pdev->dev.power.power_state.event == PM_EVENT_ON)
return 0;
- acquire_console_sem();
+ acquire_console_mutex();
/*
* PCI state will have been restored by the core, so
@@ -2165,7 +2165,7 @@ static int atyfb_pci_resume(struct pci_dev *pdev)
par->lock_blank = 0;
atyfb_blank(FB_BLANK_UNBLANK, info);
- release_console_sem();
+ release_console_mutex();
pdev->dev.power.power_state = PMSG_ON;
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index 515cf19..5490e21 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -2626,7 +2626,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
goto done;
}
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(info, 1);
@@ -2690,7 +2690,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
if (rinfo->pm_mode & radeon_pm_d2)
radeon_set_suspend(rinfo, 1);
- release_console_sem();
+ release_console_mutex();
done:
pdev->dev.power.power_state = mesg;
@@ -2715,10 +2715,10 @@ int radeonfb_pci_resume(struct pci_dev *pdev)
return 0;
if (rinfo->no_schedule) {
- if (try_acquire_console_sem())
+ if (try_acquire_console_mutex())
return 0;
} else
- acquire_console_sem();
+ acquire_console_mutex();
printk(KERN_DEBUG "radeonfb (%s): resuming from state: %d...\n",
pci_name(pdev), pdev->dev.power.power_state.event);
@@ -2783,7 +2783,7 @@ int radeonfb_pci_resume(struct pci_dev *pdev)
pdev->dev.power.power_state = PMSG_ON;
bail:
- release_console_sem();
+ release_console_mutex();
return rc;
}
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index 57b9d27..fda91e4 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -461,10 +461,10 @@ static int chipsfb_pci_suspend(struct pci_dev *pdev, pm_message_t state)
if (!(state.event & PM_EVENT_SLEEP))
goto done;
- acquire_console_sem();
+ acquire_console_mutex();
chipsfb_blank(1, p);
fb_set_suspend(p, 1);
- release_console_sem();
+ release_console_mutex();
done:
pdev->dev.power.power_state = state;
return 0;
@@ -474,10 +474,10 @@ static int chipsfb_pci_resume(struct pci_dev *pdev)
{
struct fb_info *p = pci_get_drvdata(pdev);
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(p, 0);
chipsfb_blank(0, p);
- release_console_sem();
+ release_console_mutex();
pdev->dev.power.power_state = PMSG_ON;
return 0;
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 5050cba..ccd0ad3 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -374,14 +374,14 @@ static void fb_flashcursor(struct work_struct *work)
int c;
int mode;
- acquire_console_sem();
+ acquire_console_mutex();
if (ops && ops->currcon != -1)
vc = vc_cons[ops->currcon].d;
if (!vc || !CON_IS_VISIBLE(vc) ||
registered_fb[con2fb_map[vc->vc_num]] != info ||
vc->vc_deccm != 1) {
- release_console_sem();
+ release_console_mutex();
return;
}
@@ -391,7 +391,7 @@ static void fb_flashcursor(struct work_struct *work)
CM_ERASE : CM_DRAW;
ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1),
get_color(vc, info, c, 0));
- release_console_sem();
+ release_console_mutex();
}
static void cursor_timer_handler(unsigned long dev_addr)
@@ -835,7 +835,7 @@ static int set_con2fb_map(int unit, int newidx, int user)
found = search_fb_in_map(newidx);
- acquire_console_sem();
+ acquire_console_mutex();
con2fb_map[unit] = newidx;
if (!err && !found)
err = con2fb_acquire_newinfo(vc, info, unit, oldidx);
@@ -862,7 +862,7 @@ static int set_con2fb_map(int unit, int newidx, int user)
if (!search_fb_in_map(info_idx))
info_idx = newidx;
- release_console_sem();
+ release_console_mutex();
return err;
}
@@ -3294,7 +3294,7 @@ static ssize_t store_rotate(struct device *device,
if (fbcon_has_exited)
return count;
- acquire_console_sem();
+ acquire_console_mutex();
idx = con2fb_map[fg_console];
if (idx == -1 || registered_fb[idx] == NULL)
@@ -3304,7 +3304,7 @@ static ssize_t store_rotate(struct device *device,
rotate = simple_strtoul(buf, last, 0);
fbcon_rotate(info, rotate);
err:
- release_console_sem();
+ release_console_mutex();
return count;
}
@@ -3319,7 +3319,7 @@ static ssize_t store_rotate_all(struct device *device,
if (fbcon_has_exited)
return count;
- acquire_console_sem();
+ acquire_console_mutex();
idx = con2fb_map[fg_console];
if (idx == -1 || registered_fb[idx] == NULL)
@@ -3329,7 +3329,7 @@ static ssize_t store_rotate_all(struct device *device,
rotate = simple_strtoul(buf, last, 0);
fbcon_rotate_all(info, rotate);
err:
- release_console_sem();
+ release_console_mutex();
return count;
}
@@ -3342,7 +3342,7 @@ static ssize_t show_rotate(struct device *device,
if (fbcon_has_exited)
return 0;
- acquire_console_sem();
+ acquire_console_mutex();
idx = con2fb_map[fg_console];
if (idx == -1 || registered_fb[idx] == NULL)
@@ -3351,7 +3351,7 @@ static ssize_t show_rotate(struct device *device,
info = registered_fb[idx];
rotate = fbcon_get_rotate(info);
err:
- release_console_sem();
+ release_console_mutex();
return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
}
@@ -3365,7 +3365,7 @@ static ssize_t show_cursor_blink(struct device *device,
if (fbcon_has_exited)
return 0;
- acquire_console_sem();
+ acquire_console_mutex();
idx = con2fb_map[fg_console];
if (idx == -1 || registered_fb[idx] == NULL)
@@ -3379,7 +3379,7 @@ static ssize_t show_cursor_blink(struct device *device,
blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
err:
- release_console_sem();
+ release_console_mutex();
return snprintf(buf, PAGE_SIZE, "%d\n", blink);
}
@@ -3394,7 +3394,7 @@ static ssize_t store_cursor_blink(struct device *device,
if (fbcon_has_exited)
return count;
- acquire_console_sem();
+ acquire_console_mutex();
idx = con2fb_map[fg_console];
if (idx == -1 || registered_fb[idx] == NULL)
@@ -3416,7 +3416,7 @@ static ssize_t store_cursor_blink(struct device *device,
}
err:
- release_console_sem();
+ release_console_mutex();
return count;
}
@@ -3455,7 +3455,7 @@ static void fbcon_start(void)
if (num_registered_fb) {
int i;
- acquire_console_sem();
+ acquire_console_mutex();
for (i = 0; i < FB_MAX; i++) {
if (registered_fb[i] != NULL) {
@@ -3464,7 +3464,7 @@ static void fbcon_start(void)
}
}
- release_console_sem();
+ release_console_mutex();
fbcon_takeover(0);
}
}
@@ -3524,7 +3524,7 @@ static int __init fb_console_init(void)
{
int i;
- acquire_console_sem();
+ acquire_console_mutex();
fb_register_client(&fbcon_event_notifier);
fbcon_device = device_create(fb_class, NULL, MKDEV(0, 0), NULL,
"fbcon");
@@ -3540,7 +3540,7 @@ static int __init fb_console_init(void)
for (i = 0; i < MAX_NR_CONSOLES; i++)
con2fb_map[i] = -1;
- release_console_sem();
+ release_console_mutex();
fbcon_start();
return 0;
}
@@ -3563,12 +3563,12 @@ static void __exit fbcon_deinit_device(void)
static void __exit fb_console_exit(void)
{
- acquire_console_sem();
+ acquire_console_mutex();
fb_unregister_client(&fbcon_event_notifier);
fbcon_deinit_device();
device_destroy(fb_class, MKDEV(0, 0));
fbcon_exit();
- release_console_sem();
+ release_console_mutex();
unregister_con_driver(&fb_con);
}
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 369a5b3..d7a4419 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -964,14 +964,14 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state)
struct fb_info *info = platform_get_drvdata(dev);
struct da8xx_fb_par *par = info->par;
- acquire_console_sem();
+ acquire_console_mutex();
if (par->panel_power_ctrl)
par->panel_power_ctrl(0);
fb_set_suspend(info, 1);
lcd_disable_raster();
clk_disable(par->lcdc_clk);
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -980,14 +980,14 @@ static int fb_resume(struct platform_device *dev)
struct fb_info *info = platform_get_drvdata(dev);
struct da8xx_fb_par *par = info->par;
- acquire_console_sem();
+ acquire_console_mutex();
if (par->panel_power_ctrl)
par->panel_power_ctrl(1);
clk_enable(par->lcdc_clk);
lcd_enable_raster();
fb_set_suspend(info, 0);
- release_console_sem();
+ release_console_mutex();
return 0;
}
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index a15b44e..ad2e7ad 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1054,11 +1054,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
return -EFAULT;
if (!lock_fb_info(info))
return -ENODEV;
- acquire_console_sem();
+ acquire_console_mutex();
info->flags |= FBINFO_MISC_USEREVENT;
ret = fb_set_var(info, &var);
info->flags &= ~FBINFO_MISC_USEREVENT;
- release_console_sem();
+ release_console_mutex();
unlock_fb_info(info);
if (!ret && copy_to_user(argp, &var, sizeof(var)))
ret = -EFAULT;
@@ -1090,9 +1090,9 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
return -EFAULT;
if (!lock_fb_info(info))
return -ENODEV;
- acquire_console_sem();
+ acquire_console_mutex();
ret = fb_pan_display(info, &var);
- release_console_sem();
+ release_console_mutex();
unlock_fb_info(info);
if (ret == 0 && copy_to_user(argp, &var, sizeof(var)))
return -EFAULT;
@@ -1137,11 +1137,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
case FBIOBLANK:
if (!lock_fb_info(info))
return -ENODEV;
- acquire_console_sem();
+ acquire_console_mutex();
info->flags |= FBINFO_MISC_USEREVENT;
ret = fb_blank(info, arg);
info->flags &= ~FBINFO_MISC_USEREVENT;
- release_console_sem();
+ release_console_mutex();
unlock_fb_info(info);
break;
default:
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
index d4a2c11..daf2d6d 100644
--- a/drivers/video/fbsysfs.c
+++ b/drivers/video/fbsysfs.c
@@ -88,11 +88,11 @@ static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var)
int err;
var->activate |= FB_ACTIVATE_FORCE;
- acquire_console_sem();
+ acquire_console_mutex();
fb_info->flags |= FBINFO_MISC_USEREVENT;
err = fb_set_var(fb_info, var);
fb_info->flags &= ~FBINFO_MISC_USEREVENT;
- release_console_sem();
+ release_console_mutex();
if (err)
return err;
return 0;
@@ -173,7 +173,7 @@ static ssize_t store_modes(struct device *device,
if (i * sizeof(struct fb_videomode) != count)
return -EINVAL;
- acquire_console_sem();
+ acquire_console_mutex();
list_splice(&fb_info->modelist, &old_list);
fb_videomode_to_modelist((const struct fb_videomode *)buf, i,
&fb_info->modelist);
@@ -183,7 +183,7 @@ static ssize_t store_modes(struct device *device,
} else
fb_destroy_modelist(&old_list);
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -299,11 +299,11 @@ static ssize_t store_blank(struct device *device,
char *last = NULL;
int err;
- acquire_console_sem();
+ acquire_console_mutex();
fb_info->flags |= FBINFO_MISC_USEREVENT;
err = fb_blank(fb_info, simple_strtoul(buf, &last, 0));
fb_info->flags &= ~FBINFO_MISC_USEREVENT;
- release_console_sem();
+ release_console_mutex();
if (err < 0)
return err;
return count;
@@ -362,9 +362,9 @@ static ssize_t store_pan(struct device *device,
return -EINVAL;
var.yoffset = simple_strtoul(last, &last, 0);
- acquire_console_sem();
+ acquire_console_mutex();
err = fb_pan_display(fb_info, &var);
- release_console_sem();
+ release_console_mutex();
if (err < 0)
return err;
@@ -397,9 +397,9 @@ static ssize_t store_fbstate(struct device *device,
state = simple_strtoul(buf, &last, 0);
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(fb_info, (int)state);
- release_console_sem();
+ release_console_mutex();
return count;
}
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index b3e639d..8fcad99 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -342,10 +342,10 @@ static int gxfb_suspend(struct pci_dev *pdev, pm_message_t state)
struct fb_info *info = pci_get_drvdata(pdev);
if (state.event == PM_EVENT_SUSPEND) {
- acquire_console_sem();
+ acquire_console_mutex();
gx_powerdown(info);
fb_set_suspend(info, 1);
- release_console_sem();
+ release_console_mutex();
}
/* there's no point in setting PCI states; we emulate PCI, so
@@ -359,7 +359,7 @@ static int gxfb_resume(struct pci_dev *pdev)
struct fb_info *info = pci_get_drvdata(pdev);
int ret;
- acquire_console_sem();
+ acquire_console_mutex();
ret = gx_powerup(info);
if (ret) {
printk(KERN_ERR "gxfb: power up failed!\n");
@@ -367,7 +367,7 @@ static int gxfb_resume(struct pci_dev *pdev)
}
fb_set_suspend(info, 0);
- release_console_sem();
+ release_console_mutex();
return 0;
}
#endif
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c
index 889cbe3..63fe664 100644
--- a/drivers/video/geode/lxfb_core.c
+++ b/drivers/video/geode/lxfb_core.c
@@ -464,10 +464,10 @@ static int lxfb_suspend(struct pci_dev *pdev, pm_message_t state)
struct fb_info *info = pci_get_drvdata(pdev);
if (state.event == PM_EVENT_SUSPEND) {
- acquire_console_sem();
+ acquire_console_mutex();
lx_powerdown(info);
fb_set_suspend(info, 1);
- release_console_sem();
+ release_console_mutex();
}
/* there's no point in setting PCI states; we emulate PCI, so
@@ -481,7 +481,7 @@ static int lxfb_resume(struct pci_dev *pdev)
struct fb_info *info = pci_get_drvdata(pdev);
int ret;
- acquire_console_sem();
+ acquire_console_mutex();
ret = lx_powerup(info);
if (ret) {
printk(KERN_ERR "lxfb: power up failed!\n");
@@ -489,7 +489,7 @@ static int lxfb_resume(struct pci_dev *pdev)
}
fb_set_suspend(info, 0);
- release_console_sem();
+ release_console_mutex();
return 0;
}
#else
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 5743ea2..7105d0a 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -1574,7 +1574,7 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t mesg)
return 0;
}
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(info, 1);
if (info->fbops->fb_sync)
@@ -1587,7 +1587,7 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t mesg)
pci_save_state(dev);
pci_disable_device(dev);
pci_set_power_state(dev, pci_choose_state(dev, mesg));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -1605,7 +1605,7 @@ static int i810fb_resume(struct pci_dev *dev)
return 0;
}
- acquire_console_sem();
+ acquire_console_mutex();
pci_set_power_state(dev, PCI_D0);
pci_restore_state(dev);
@@ -1621,7 +1621,7 @@ static int i810fb_resume(struct pci_dev *dev)
fb_set_suspend (info, 0);
info->fbops->fb_blank(VESA_NO_BLANKING, info);
fail:
- release_console_sem();
+ release_console_mutex();
return 0;
}
/***********************************************************************
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 772ba3f..9271c37 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -1175,9 +1175,9 @@ static int mx3fb_suspend(struct platform_device *pdev, pm_message_t state)
struct mx3fb_data *mx3fb = platform_get_drvdata(pdev);
struct mx3fb_info *mx3_fbi = mx3fb->fbi->par;
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(mx3fb->fbi, 1);
- release_console_sem();
+ release_console_mutex();
if (mx3_fbi->blank == FB_BLANK_UNBLANK) {
sdc_disable_channel(mx3_fbi);
@@ -1200,9 +1200,9 @@ static int mx3fb_resume(struct platform_device *pdev)
sdc_set_brightness(mx3fb, mx3fb->backlight_level);
}
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(mx3fb->fbi, 0);
- release_console_sem();
+ release_console_mutex();
return 0;
}
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index efe10ff..faaaaf2 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -1057,7 +1057,7 @@ static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t mesg)
if (mesg.event == PM_EVENT_PRETHAW)
mesg.event = PM_EVENT_FREEZE;
- acquire_console_sem();
+ acquire_console_mutex();
par->pm_state = mesg.event;
if (mesg.event & PM_EVENT_SLEEP) {
@@ -1070,7 +1070,7 @@ static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t mesg)
}
dev->dev.power.power_state = mesg;
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -1079,7 +1079,7 @@ static int nvidiafb_resume(struct pci_dev *dev)
struct fb_info *info = pci_get_drvdata(dev);
struct nvidia_par *par = info->par;
- acquire_console_sem();
+ acquire_console_mutex();
pci_set_power_state(dev, PCI_D0);
if (par->pm_state != PM_EVENT_FREEZE) {
@@ -1097,7 +1097,7 @@ static int nvidiafb_resume(struct pci_dev *dev)
nvidiafb_blank(FB_BLANK_UNBLANK, info);
fail:
- release_console_sem();
+ release_console_mutex();
return 0;
}
#else
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 9c0144e..3023ebd 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -513,9 +513,9 @@ static int ps3fb_release(struct fb_info *info, int user)
if (atomic_dec_and_test(&ps3fb.f_count)) {
if (atomic_read(&ps3fb.ext_flip)) {
atomic_set(&ps3fb.ext_flip, 0);
- if (!try_acquire_console_sem()) {
+ if (!try_acquire_console_mutex()) {
ps3fb_sync(info, 0); /* single buffer */
- release_console_sem();
+ release_console_mutex();
}
}
}
@@ -830,14 +830,14 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
if (vmode) {
var = info->var;
fb_videomode_to_var(&var, vmode);
- acquire_console_sem();
+ acquire_console_mutex();
info->flags |= FBINFO_MISC_USEREVENT;
/* Force, in case only special bits changed */
var.activate |= FB_ACTIVATE_FORCE;
par->new_mode_id = val;
retval = fb_set_var(info, &var);
info->flags &= ~FBINFO_MISC_USEREVENT;
- release_console_sem();
+ release_console_mutex();
}
break;
}
@@ -881,9 +881,9 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
break;
dev_dbg(info->device, "PS3FB_IOCTL_FSEL:%d\n", val);
- acquire_console_sem();
+ acquire_console_mutex();
retval = ps3fb_sync(info, val);
- release_console_sem();
+ release_console_mutex();
break;
default:
@@ -903,9 +903,9 @@ static int ps3fbd(void *arg)
set_current_state(TASK_INTERRUPTIBLE);
if (ps3fb.is_kicked) {
ps3fb.is_kicked = 0;
- acquire_console_sem();
+ acquire_console_mutex();
ps3fb_sync(info, 0); /* single buffer */
- release_console_sem();
+ release_console_mutex();
}
schedule();
}
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index c3fad34..fcd948a 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -23,7 +23,7 @@
#include <linux/svga.h>
#include <linux/init.h>
#include <linux/pci.h>
-#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */
+#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_mutex() */
#include <video/vga.h>
#ifdef CONFIG_MTRR
@@ -1054,12 +1054,12 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state)
dev_info(info->device, "suspend\n");
- acquire_console_sem();
+ acquire_console_mutex();
mutex_lock(&(par->open_lock));
if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) {
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -1070,7 +1070,7 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state)
pci_set_power_state(dev, pci_choose_state(dev, state));
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -1086,12 +1086,12 @@ static int s3_pci_resume(struct pci_dev* dev)
dev_info(info->device, "resume\n");
- acquire_console_sem();
+ acquire_console_mutex();
mutex_lock(&(par->open_lock));
if (par->ref_count == 0) {
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -1100,7 +1100,7 @@ static int s3_pci_resume(struct pci_dev* dev)
err = pci_enable_device(dev);
if (err) {
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
dev_err(info->device, "error %d enabling device for resume\n", err);
return err;
}
@@ -1110,7 +1110,7 @@ static int s3_pci_resume(struct pci_dev* dev)
fb_set_suspend(info, 0);
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 842d157..d4dc4eb 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -2373,7 +2373,7 @@ static int savagefb_suspend(struct pci_dev *dev, pm_message_t mesg)
if (mesg.event == PM_EVENT_FREEZE)
return 0;
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(info, 1);
if (info->fbops->fb_sync)
@@ -2385,7 +2385,7 @@ static int savagefb_suspend(struct pci_dev *dev, pm_message_t mesg)
pci_save_state(dev);
pci_disable_device(dev);
pci_set_power_state(dev, pci_choose_state(dev, mesg));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -2409,7 +2409,7 @@ static int savagefb_resume(struct pci_dev* dev)
return 0;
}
- acquire_console_sem();
+ acquire_console_mutex();
pci_set_power_state(dev, PCI_D0);
pci_restore_state(dev);
@@ -2423,7 +2423,7 @@ static int savagefb_resume(struct pci_dev* dev)
savagefb_set_par(info);
fb_set_suspend(info, 0);
savagefb_blank(FB_BLANK_UNBLANK, info);
- release_console_sem();
+ release_console_mutex();
return 0;
}
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index b7dc180..0b0da8b 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -2010,9 +2010,9 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info,
/* tell console/fb driver we are suspending */
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(fbi, 1);
- release_console_sem();
+ release_console_mutex();
/* backup copies in case chip is powered down over suspend */
@@ -2069,9 +2069,9 @@ static void sm501fb_resume_fb(struct sm501fb_info *info,
memcpy_toio(par->cursor.k_addr, par->store_cursor,
par->cursor.size);
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(fbi, 0);
- release_console_sem();
+ release_console_mutex();
vfree(par->store_fb);
vfree(par->store_cursor);
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
index 6913fe1..77843ed 100644
--- a/drivers/video/tmiofb.c
+++ b/drivers/video/tmiofb.c
@@ -25,7 +25,7 @@
#include <linux/fb.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-/* Why should fb driver call console functions? because acquire_console_sem() */
+/* Why should fb driver call console functions? because acquire_console_mutex() */
#include <linux/console.h>
#include <linux/mfd/core.h>
#include <linux/mfd/tmio.h>
@@ -944,7 +944,7 @@ static int tmiofb_suspend(struct platform_device *dev, pm_message_t state)
struct mfd_cell *cell = dev->dev.platform_data;
int retval = 0;
- acquire_console_sem();
+ acquire_console_mutex();
fb_set_suspend(info, 1);
@@ -965,7 +965,7 @@ static int tmiofb_suspend(struct platform_device *dev, pm_message_t state)
if (cell->suspend)
retval = cell->suspend(dev);
- release_console_sem();
+ release_console_mutex();
return retval;
}
@@ -976,7 +976,7 @@ static int tmiofb_resume(struct platform_device *dev)
struct mfd_cell *cell = dev->dev.platform_data;
int retval = 0;
- acquire_console_sem();
+ acquire_console_mutex();
if (cell->resume) {
retval = cell->resume(dev);
@@ -992,7 +992,7 @@ static int tmiofb_resume(struct platform_device *dev)
fb_set_suspend(info, 0);
out:
- release_console_sem();
+ release_console_mutex();
return retval;
}
#else
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c
index 65ccd21..ba4ae70 100644
--- a/drivers/video/vt8623fb.c
+++ b/drivers/video/vt8623fb.c
@@ -24,7 +24,7 @@
#include <linux/svga.h>
#include <linux/init.h>
#include <linux/pci.h>
-#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */
+#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_mutex() */
#include <video/vga.h>
#ifdef CONFIG_MTRR
@@ -818,12 +818,12 @@ static int vt8623_pci_suspend(struct pci_dev* dev, pm_message_t state)
dev_info(info->device, "suspend\n");
- acquire_console_sem();
+ acquire_console_mutex();
mutex_lock(&(par->open_lock));
if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) {
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -834,7 +834,7 @@ static int vt8623_pci_suspend(struct pci_dev* dev, pm_message_t state)
pci_set_power_state(dev, pci_choose_state(dev, state));
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
@@ -849,7 +849,7 @@ static int vt8623_pci_resume(struct pci_dev* dev)
dev_info(info->device, "resume\n");
- acquire_console_sem();
+ acquire_console_mutex();
mutex_lock(&(par->open_lock));
if (par->ref_count == 0)
@@ -868,7 +868,7 @@ static int vt8623_pci_resume(struct pci_dev* dev)
fail:
mutex_unlock(&(par->open_lock));
- release_console_sem();
+ release_console_mutex();
return 0;
}
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 603598f..dd22e0c 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -490,12 +490,12 @@ xenfb_make_preferred_console(void)
if (console_set_on_cmdline)
return;
- acquire_console_sem();
+ acquire_console_mutex();
for (c = console_drivers; c; c = c->next) {
if (!strcmp(c->name, "tty") && c->index == 0)
break;
}
- release_console_sem();
+ release_console_mutex();
if (c) {
unregister_console(c);
c->flags |= CON_CONSDEV;
diff --git a/include/linux/console.h b/include/linux/console.h
index 81651ad..cc87d8f 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -127,9 +127,9 @@ extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_n
extern void register_console(struct console *);
extern int unregister_console(struct console *);
extern struct console *console_drivers;
-extern void acquire_console_sem(void);
-extern int try_acquire_console_sem(void);
-extern void release_console_sem(void);
+extern void acquire_console_mutex(void);
+extern int try_acquire_console_mutex(void);
+extern void release_console_mutex(void);
extern void console_conditional_schedule(void);
extern void console_unblank(void);
extern struct tty_driver *console_device(int *);
diff --git a/kernel/printk.c b/kernel/printk.c
index de0f29c..c486561 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -79,17 +79,17 @@ int oops_in_progress;
EXPORT_SYMBOL(oops_in_progress);
/*
- * console_sem protects the console_drivers list, and also
+ * console_mutex protects the console_drivers list, and also
* provides serialisation for access to the entire console
* driver system.
*/
-static DEFINE_SEMAPHORE(console_sem);
+static DEFINE_MUTEX(console_mutex);
struct console *console_drivers;
EXPORT_SYMBOL_GPL(console_drivers);
/*
* This is used for debugging the mess that is the VT code by
- * keeping track if we have the console semaphore held. It's
+ * keeping track if we have the console mutex held. It's
* definitely not the perfect debug tool (we don't know if _WE_
* hold it are racing, but it helps tracking those weird code
* path in the console code where we end up in places I want
@@ -100,7 +100,7 @@ static int console_locked, console_suspended;
/*
* logbuf_lock protects log_buf, log_start, log_end, con_start and logged_chars
* It is also used in interesting ways to provide interlocking in
- * release_console_sem().
+ * release_console_mutex().
*/
static DEFINE_RAW_SPINLOCK(logbuf_lock);
@@ -467,7 +467,7 @@ static void _call_console_drivers(unsigned start,
/*
* Call the console drivers, asking them to write out
* log_buf[start] to log_buf[end - 1].
- * The console_sem must be held.
+ * The console_mutex must be held.
*/
static void call_console_drivers(unsigned start, unsigned end)
{
@@ -542,7 +542,7 @@ static void zap_locks(void)
/* If a crash is occurring, make sure we can't deadlock */
raw_spin_lock_init(&logbuf_lock);
/* And make sure that we print immediately */
- semaphore_init(&console_sem);
+ mutex_init(&console_mutex);
zap_rt_locks();
}
@@ -571,11 +571,11 @@ static int have_callable_console(void)
*
* This is printk(). It can be called from any context. We want it to work.
*
- * We try to grab the console_sem. If we succeed, it's easy - we log the output and
- * call the console drivers. If we fail to get the semaphore we place the output
- * into the log buffer and return. The current holder of the console_sem will
- * notice the new output in release_console_sem() and will send it to the
- * consoles before releasing the semaphore.
+ * We try to grab the console_mutex. If we succeed, it's easy - we log the output and
+ * call the console drivers. If we fail to get the mutex we place the output
+ * into the log buffer and return. The current holder of the console_mutex will
+ * notice the new output in release_console_mutex() and will send it to the
+ * consoles before releasing the mutex.
*
* One effect of this deferred printing is that code which calls printk() and
* then changes console_loglevel may break. This is because console_loglevel
@@ -618,29 +618,29 @@ static inline int can_use_console(unsigned int cpu)
/*
* Try to get console ownership to actually show the kernel
* messages from a 'printk'. Return true (and with the
- * console_semaphore held, and 'console_locked' set) if it
+ * console_mutex held, and 'console_locked' set) if it
* is successful, false otherwise.
*
* This gets called with the 'logbuf_lock' spinlock held and
* interrupts disabled. It should return with 'lockbuf_lock'
* released but interrupts still disabled.
*/
-static int acquire_console_semaphore_for_printk(unsigned int cpu)
+static int acquire_console_mutex_for_printk(unsigned int cpu)
{
int retval = 0;
- if (!try_acquire_console_sem()) {
+ if (!try_acquire_console_mutex()) {
retval = 1;
/*
* If we can't use the console, we need to release
- * the console semaphore by hand to avoid flushing
- * the buffer. We need to hold the console semaphore
+ * the console mutex by hand to avoid flushing
+ * the buffer. We need to hold the console mutex
* in order to do this test safely.
*/
if (!can_use_console(cpu)) {
console_locked = 0;
- up(&console_sem);
+ mutex_unlock(&console_mutex);
retval = 0;
}
}
@@ -680,7 +680,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
printk_delay();
preempt_disable();
- /* This stops the holder of console_sem just where we want him */
+ /* This stops the holder of console_mutex just where we want him */
raw_local_irq_save(flags);
this_cpu = raw_smp_processor_id();
@@ -782,16 +782,16 @@ asmlinkage int vprintk(const char *fmt, va_list args)
/*
* Try to acquire and then immediately release the
- * console semaphore. The release will do all the
+ * console mutex. The release will do all the
* actual magic (print out buffers, wake up klogd,
* etc).
*
- * The acquire_console_semaphore_for_printk() function
+ * The acquire_console_mutex_for_printk() function
* will release 'logbuf_lock' regardless of whether it
- * actually gets the semaphore or not.
+ * actually gets the mutex or not.
*/
- if (acquire_console_semaphore_for_printk(this_cpu))
- release_console_sem();
+ if (acquire_console_mutex_for_printk(this_cpu))
+ release_console_mutex();
lockdep_on();
out:
@@ -950,52 +950,52 @@ void suspend_console(void)
if (!console_suspend_enabled)
return;
printk("Suspending console(s) (use no_console_suspend to debug)\n");
- acquire_console_sem();
+ acquire_console_mutex();
console_suspended = 1;
- up(&console_sem);
+ mutex_unlock(&console_mutex);
}
void resume_console(void)
{
if (!console_suspend_enabled)
return;
- down(&console_sem);
+ mutex_lock(&console_mutex);
console_suspended = 0;
- release_console_sem();
+ release_console_mutex();
}
/**
- * acquire_console_sem - lock the console system for exclusive use.
+ * acquire_console_mutex - lock the console system for exclusive use.
*
- * Acquires a semaphore which guarantees that the caller has
+ * Acquires a mutex which guarantees that the caller has
* exclusive access to the console system and the console_drivers list.
*
* Can sleep, returns nothing.
*/
-void acquire_console_sem(void)
+void acquire_console_mutex(void)
{
BUG_ON(in_interrupt());
- down(&console_sem);
+ mutex_lock(&console_mutex);
if (console_suspended)
return;
console_locked = 1;
console_may_schedule = 1;
}
-EXPORT_SYMBOL(acquire_console_sem);
+EXPORT_SYMBOL(acquire_console_mutex);
-int try_acquire_console_sem(void)
+int try_acquire_console_mutex(void)
{
- if (down_trylock(&console_sem))
+ if (!mutex_trylock(&console_mutex))
return -1;
if (console_suspended) {
- up(&console_sem);
+ mutex_unlock(&console_mutex);
return -1;
}
console_locked = 1;
console_may_schedule = 0;
return 0;
}
-EXPORT_SYMBOL(try_acquire_console_sem);
+EXPORT_SYMBOL(try_acquire_console_mutex);
int is_console_locked(void)
{
@@ -1024,27 +1024,27 @@ void wake_up_klogd(void)
}
/**
- * release_console_sem - unlock the console system
+ * release_console_mutex - unlock the console system
*
- * Releases the semaphore which the caller holds on the console system
+ * Releases the mutex which the caller holds on the console system
* and the console driver list.
*
- * While the semaphore was held, console output may have been buffered
- * by printk(). If this is the case, release_console_sem() emits
- * the output prior to releasing the semaphore.
+ * While the mutex was held, console output may have been buffered
+ * by printk(). If this is the case, release_console_mutex() emits
+ * the output prior to releasing the mutex.
*
* If there is output waiting for klogd, we wake it up.
*
- * release_console_sem() may be called from any context.
+ * release_console_mutex() may be called from any context.
*/
-void release_console_sem(void)
+void release_console_mutex(void)
{
unsigned long flags;
unsigned _con_start, _log_end;
unsigned wake_klogd = 0;
if (console_suspended) {
- up(&console_sem);
+ mutex_unlock(&console_mutex);
return;
}
@@ -1078,7 +1078,7 @@ void release_console_sem(void)
}
console_locked = 0;
raw_spin_unlock_irqrestore(&logbuf_lock, flags);
- up(&console_sem);
+ mutex_unlock(&console_mutex);
/*
* On PREEMPT_RT kernels __wake_up may sleep, so wake syslogd
@@ -1092,7 +1092,7 @@ void release_console_sem(void)
if (wake_klogd)
wake_up_klogd();
}
-EXPORT_SYMBOL(release_console_sem);
+EXPORT_SYMBOL(release_console_mutex);
/**
* console_conditional_schedule - yield the CPU if required
@@ -1101,7 +1101,7 @@ EXPORT_SYMBOL(release_console_sem);
* if this CPU should yield the CPU to another task, do
* so here.
*
- * Must be called within acquire_console_sem().
+ * Must be called within acquire_console_mutex().
*/
void __sched console_conditional_schedule(void)
{
@@ -1119,17 +1119,17 @@ void console_unblank(void)
* oops_in_progress is set to 1..
*/
if (oops_in_progress) {
- if (down_trylock(&console_sem) != 0)
+ if (!mutex_trylock(&console_mutex))
return;
} else
- acquire_console_sem();
+ acquire_console_mutex();
console_locked = 1;
console_may_schedule = 0;
for_each_console(c)
if ((c->flags & CON_ENABLED) && c->unblank)
c->unblank();
- release_console_sem();
+ release_console_mutex();
}
/*
@@ -1140,7 +1140,7 @@ struct tty_driver *console_device(int *index)
struct console *c;
struct tty_driver *driver = NULL;
- acquire_console_sem();
+ acquire_console_mutex();
for_each_console(c) {
if (!c->device)
continue;
@@ -1148,7 +1148,7 @@ struct tty_driver *console_device(int *index)
if (driver)
break;
}
- release_console_sem();
+ release_console_mutex();
return driver;
}
@@ -1159,17 +1159,17 @@ struct tty_driver *console_device(int *index)
*/
void console_stop(struct console *console)
{
- acquire_console_sem();
+ acquire_console_mutex();
console->flags &= ~CON_ENABLED;
- release_console_sem();
+ release_console_mutex();
}
EXPORT_SYMBOL(console_stop);
void console_start(struct console *console)
{
- acquire_console_sem();
+ acquire_console_mutex();
console->flags |= CON_ENABLED;
- release_console_sem();
+ release_console_mutex();
}
EXPORT_SYMBOL(console_start);
@@ -1291,7 +1291,7 @@ void register_console(struct console *newcon)
* Put this console in the list - keep the
* preferred driver at the head of the list.
*/
- acquire_console_sem();
+ acquire_console_mutex();
if ((newcon->flags & CON_CONSDEV) || console_drivers == NULL) {
newcon->next = console_drivers;
console_drivers = newcon;
@@ -1303,14 +1303,14 @@ void register_console(struct console *newcon)
}
if (newcon->flags & CON_PRINTBUFFER) {
/*
- * release_console_sem() will print out the buffered messages
+ * release_console_mutex() will print out the buffered messages
* for us.
*/
raw_spin_lock_irqsave(&logbuf_lock, flags);
con_start = log_start;
raw_spin_unlock_irqrestore(&logbuf_lock, flags);
}
- release_console_sem();
+ release_console_mutex();
/*
* By unregistering the bootconsoles after we enable the real console
@@ -1346,7 +1346,7 @@ int unregister_console(struct console *console)
return braille_unregister_console(console);
#endif
- acquire_console_sem();
+ acquire_console_mutex();
if (console_drivers == console) {
console_drivers=console->next;
res = 0;
@@ -1368,7 +1368,7 @@ int unregister_console(struct console *console)
if (console_drivers != NULL && console->flags & CON_CONSDEV)
console_drivers->flags |= CON_CONSDEV;
- release_console_sem();
+ release_console_mutex();
return res;
}
EXPORT_SYMBOL(unregister_console);
--
1.7.0.4