Skip to contentSkip to conversation

tty: fix switching consoles during suspend

PATCH Arnd Bergmann 2 participants 2 messages Jun 23, 2010 Char and misc drivers

lore
Share & tools
lore

Arnd Bergmann

author maintainer
#0 lore raw

vt_waitactive now expects to be called with the big tty mutex, which it tries to release before going to sleep.

This fixes the only caller that does not hold the BTM already.
---

Greg, please apply to the tty series or fold into "tty: introduce wait_event_interruptible_tty", which introduces the problem.

drivers/char/vt_ioctl.c +3 -0
index 45410c8..2bbeaae 100644
@@ -1761,10 +1761,13 @@ int vt_move_to_console(unsigned int vt, int alloc)
 		return -EIO;
 	}
 	release_console_sem();
+	tty_lock();
 	if (vt_waitactive(vt + 1)) {
 		pr_debug("Suspend: Can't switch VCs.");
+		tty_unlock();
 		return -EINTR;
 	}
+	tty_unlock();
 	return prev;
 }
 
#1 lore raw
Quoted 9 lines · Arnd Bergmann

vt_waitactive now expects to be called with the big tty mutex, which it tries to release before going to sleep.

This fixes the only caller that does not hold the BTM already.
---

Greg, please apply to the tty series or fold into "tty: introduce wait_event_interruptible_tty", which introduces the problem.

Now folded in and pushed out.

thanks,

greg k-h