[PATCH 37/68] tty: fix console_sem lock order

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg Kroah-Hartman
Date: Tuesday, August 10, 2010 - 2:58 pm

From: Arnd Bergmann <arnd@arndb.de>

vgacon_do_font_op releases and reacquires the BTM while holding
console_sem. This violates the rule that BTM has to be the
outer lock whenever we hold both.

There does not seem to be any reason to give up the BTM here,
so just stop doing that.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/video/console/vgacon.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 7197005..54e32c5 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -1108,7 +1108,6 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)
 		charmap += 4 * cmapsz;
 #endif
 
-	tty_unlock();
 	spin_lock_irq(&vga_lock);
 	/* First, the Sequencer */
 	vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
@@ -1192,7 +1191,6 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)
 		vga_wattr(state->vgabase, VGA_AR_ENABLE_DISPLAY, 0);	
 	}
 	spin_unlock_irq(&vga_lock);
-	tty_lock();
 	return 0;
 }
 
-- 
1.7.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] TTY patches for 2.6.36, try 2, Greg KH, (Tue Aug 10, 2:44 pm)
[PATCH 01/68] n_gsm.c: removed duplicated #includes, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 02/68] serial: There's no config CONSOLE, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 03/68] vt: clean up the code - use kernel library, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 04/68] serial: add UART_CAP_EFR and UART_CAP_SLEEP ..., Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 05/68] mrst_max3110: add UART driver for Max3110 on ..., Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 06/68] max3110 sanity check a register, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 07/68] serial: replace open coded mutex with a real ..., Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 08/68] serial: fix wakup races in the mrst_max3110 ..., Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 09/68] tty: Remove Hayes ESP ioctls, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 10/68] tty: remove remaining Hayes ESP ioctls, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 11/68] tty: Add EXTPROC support for LINEMODE, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 12/68] vt/console: try harder to print output when ..., Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 13/68] stallion: prune lock_kernel calls, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 14/68] istallion: use bit ops for the board flags, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 15/68] riscom8: kill use of lock_kernel, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 16/68] isicom: kill off the BKL, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 17/68] rocket: kill BKL, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 18/68] synclink: kill the big kernel lock, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 19/68] cyclades: Kill off BKL usage, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 20/68] epca: Kill the big kernel lock, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 21/68] specialix: Kill the BKL, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 22/68] tty: Fix the digi acceleport driver NULL checks, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 23/68] synclink: reworking locking a bit, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 24/68] tty: serial - fix various misuses/mishandlin ..., Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 25/68] tty: serial - fix tty back references in termios, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 26/68] tty: serial - fix tty referencing in set_ldisc, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 27/68] vc: Locking clean up, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 28/68] tty: Make vt's have a tty_port, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 29/68] tty: Move the vt_tty field from the vc_data ..., Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 30/68] serial: Change the wait for carrier locking, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 31/68] serial: add port helpers, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 32/68] serial: trim locking on the helpers, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 33/68] serial: Use block_til_ready helper, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 34/68] serial: fix termios settings in open, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 35/68] tty: replace BKL with a new tty_lock, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 36/68] tty: never hold BTM while getting tty_mutex, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 37/68] tty: fix console_sem lock order, Greg Kroah-Hartman, (Tue Aug 10, 2:58 pm)
[PATCH 38/68] cdc-acm: remove dead code, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 39/68] tty: introduce wait_event_interruptible_tty, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 40/68] tty: reorder ldisc locking, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 41/68] tty: untangle locking of wait_until_sent, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 42/68] tty: remove tty_lock_nested, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 43/68] tty: implement BTM as mutex instead of BKL, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 44/68] tty: release BTM while sleeping in block_til ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 45/68] 8250: fix set_ldisc operation, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 46/68] tty: avoid recursive BTM in pty_close, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 47/68] serial: max3107: introduce a max3107 driver, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 48/68] serial: max3107: Abstract out the platform s ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 49/68] tty_io: remove casts from void*, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 50/68] vt: Fix warning: statement with no effect du ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 51/68] serial: crisv10: formatting of pointers in p ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 53/68] serial: fix missing bit coverage of ASYNC_FLAGS, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 54/68] serial: general fixes in the serial_rs485 st ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 55/68] serial: mcf: don't take spinlocks in already ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 56/68] serial: MMIO32 support for 8250_early.c, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 57/68] timbuart: use __devinit and __devexit macros ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 58/68] serial: 68328serial.c: remove dead (ALMA_ANS ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 59/68] serial: add support for OX16PCI958 card, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 60/68] mxser: remove unnesesary NULL check, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 61/68] hsu: driver for Medfield High Speed UART device, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 62/68] hsu: add a periodic timer to check dma rx ch ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 63/68] hsu: some code cleanup, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 64/68] hsu: call PCI pm hooks in suspend/resume fun ..., Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 65/68] serial: max3107: Fix gpiolib support, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)
[PATCH 68/68] U6715 16550A serial driver support, Greg Kroah-Hartman, (Tue Aug 10, 2:59 pm)