Skip to content

Commit 9054142

Browse files
KAGA-KOKOghaskins
authored andcommitted
Subject: tty: Do not disable interrupts in put_ldisc on -rt
Fixes the following on PREEMPT_RT: BUG: sleeping function called from invalid context at kernel/rtmutex.c:684 in_atomic(): 0, irqs_disabled(): 1, pid: 9116, name: sshd Pid: 9116, comm: sshd Not tainted 2.6.31-rc6-rt2 raspberrypi#6 Call Trace: [<ffffffff81034a4f>] __might_sleep+0xec/0xee [<ffffffff812fbc6d>] rt_spin_lock+0x34/0x75 [ffffffff81064a83>] atomic_dec_and_spin_lock+0x36/0x54 [<ffffffff811df7c7>] put_ldisc+0x57/0xa6 [<ffffffff811dfb87>] tty_ldisc_hangup+0xe7/0x19f [<ffffffff811d9224>] do_tty_hangup+0xff/0x319 [<ffffffff811d9453>] tty_vhangup+0x15/0x17 [<ffffffff811e1263>] pty_close+0x127/0x12b [<ffffffff811dac41>] tty_release_dev+0x1ad/0x4c0 .... Signed-off-by: Thomas Gleixner <[email protected]>
1 parent cd883fe commit 9054142

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/tty_ldisc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static void put_ldisc(struct tty_ldisc *ld)
5252
* We really want an "atomic_dec_and_lock_irqsave()",
5353
* but we don't have it, so this does it by hand.
5454
*/
55-
local_irq_save(flags);
55+
local_irq_save_nort(flags);
5656
if (atomic_dec_and_lock(&ld->users, &tty_ldisc_lock)) {
5757
struct tty_ldisc_ops *ldo = ld->ops;
5858

@@ -63,7 +63,7 @@ static void put_ldisc(struct tty_ldisc *ld)
6363
kfree(ld);
6464
return;
6565
}
66-
local_irq_restore(flags);
66+
local_irq_restore_nort(flags);
6767
wake_up(&ld->wq_idle);
6868
}
6969

0 commit comments

Comments
 (0)