linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Alt-arrow console switch sometimes dropped
@ 2004-01-03 13:37 Pavel Machek
  2004-01-07 23:55 ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2004-01-03 13:37 UTC (permalink / raw)
  To: Andrew Morton, kernel list, vojtech, Rusty trivial patch monkey Russell

Hi!

Alt-arrow console switch is routinely dropped under high load. This
patch fixes it: alt-arrow has to start from console _we want to switch
to_, if switch is already pending. Please apply,
								Pavel

Index: linux.new/drivers/char/keyboard.c
===================================================================
--- linux.new.orig/drivers/char/keyboard.c	2003-12-25 13:28:51.000000000 +0100
+++ linux.new/drivers/char/keyboard.c	2003-12-25 13:29:08.000000000 +0100
@@ -507,8 +528,12 @@
 static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs)
 {
 	int i;
+	int cur = fg_console;
 
-	for (i = fg_console+1; i != fg_console; i++) {
+	if (want_console != -1)
+		cur = want_console;
+
+	for (i = cur+1; i != cur; i++) {
 		if (i == MAX_NR_CONSOLES)
 			i = 0;
 		if (vc_cons_allocated(i))


-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Alt-arrow console switch sometimes dropped
  2004-01-03 13:37 Alt-arrow console switch sometimes dropped Pavel Machek
@ 2004-01-07 23:55 ` Rusty Russell
  2004-01-09 18:10   ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2004-01-07 23:55 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andrew Morton, kernel list, vojtech

In message <20040103133746.GA516@elf.ucw.cz> you write:
> Hi!
> 
> Alt-arrow console switch is routinely dropped under high load. This
> patch fixes it: alt-arrow has to start from console _we want to switch
> to_, if switch is already pending. Please apply,
> 								Pavel

Sure, but a comment would be nice:

	/* Currently switching?  Queue this next switch relative to that. */

Thanks,
Trivial Rusty.

> Index: linux.new/drivers/char/keyboard.c
> ===================================================================
> --- linux.new.orig/drivers/char/keyboard.c	2003-12-25 13:28:51.000000000 +0100
> +++ linux.new/drivers/char/keyboard.c	2003-12-25 13:29:08.000000000 +0100
> @@ -507,8 +528,12 @@
>  static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs)
>  {
>  	int i;
> +	int cur = fg_console;
>  
> -	for (i = fg_console+1; i != fg_console; i++) {
> +	if (want_console != -1)
> +		cur = want_console;
> +
> +	for (i = cur+1; i != cur; i++) {
>  		if (i == MAX_NR_CONSOLES)
>  			i = 0;
>  		if (vc_cons_allocated(i))
> 
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Alt-arrow console switch sometimes dropped
  2004-01-07 23:55 ` Rusty Russell
@ 2004-01-09 18:10   ` Pavel Machek
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2004-01-09 18:10 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Andrew Morton, kernel list, vojtech

Hi!

> > Alt-arrow console switch is routinely dropped under high load. This
> > patch fixes it: alt-arrow has to start from console _we want to switch
> > to_, if switch is already pending. Please apply,
> > 								Pavel
> 
> Sure, but a comment would be nice:
> 
> 	/* Currently switching?  Queue this next switch relative to
> > that. */

Oops, there was exactly the same problem in "fn_dec_console". Here's
incremental patch to add the comment and fix fn_dec_console,
too. I hope it is applicable.

								Pavel
--- tmp/linux/drivers/char/keyboard.c	2004-01-09 19:04:43.000000000 +0100
+++ linux/drivers/char/keyboard.c	2004-01-09 18:59:43.000000000 +0100
@@ -515,8 +515,13 @@
 static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs)
 {
 	int i;
+	int cur = fg_console;
+
+	/* Currently switching?  Queue this next switch relative to that. */
+	if (want_console != -1)
+		cur = want_console;
  
-	for (i = fg_console-1; i != fg_console; i--) {
+	for (i = cur-1; i != cur; i--) {
 		if (i == -1)
 			i = MAX_NR_CONSOLES-1;
 		if (vc_cons_allocated(i))
@@ -530,6 +535,7 @@
 	int i;
 	int cur = fg_console;
 
+	/* Currently switching?  Queue this next switch relative to that. */
 	if (want_console != -1)
 		cur = want_console;
 
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-09 18:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-03 13:37 Alt-arrow console switch sometimes dropped Pavel Machek
2004-01-07 23:55 ` Rusty Russell
2004-01-09 18:10   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).