commit a802dd0e breaks console keyboard input
Hi team,
commit a802dd0eb5fc97a50cf1abb1f788a8f6cc5db635
Author: Heiko Carstens <[email protected]> Date: Mon Oct 13 23:50:08 2008 +0200
Call init_workqueues before pre smp initcalls.
This commit causes the console login prompt to ignore my keystrokes so I'm unable to log in (though ssh works fine). Oddly, if I hit ctrl-alt-delete the machine does reboot, but no other keystrokes appear on the screen or have any effect that I can detect.
No surprise that this problem appears only on my dual-core amd64 machine, while the k7 single processor machine works normally.
I've not seen anyone else complaining on the linux list, so maybe this is a BIOS bug on the affected machine? It's an ECS mobo with a GeForce6100PM-M2 chipset, and I use a ps/2 keyboard.
Thanks.
Quoted 13 lines · walt
Hi team,
commit
a802dd0eb5fc97a50cf1abb1f788a8f6cc5db635Author: Heiko Carstens <[email protected]> Date: Mon Oct 13 23:50:08 2008 +0200Call
init_workqueuesbefore pre smp initcalls.This commit causes the console login prompt to ignore my keystrokes so I'm unable to log in (though ssh works fine). Oddly, if I hit ctrl-alt-delete the machine does reboot, but no other keystrokes appear on the screen or have any effect that I can detect.
Quoted 6 lines
No surprise that this problem appears only on my dual-core amd64 machine, while the k7 single processor machine works normally.
I've not seen anyone else complaining on the linux list, so maybe this is a BIOS bug on the affected machine? It's an ECS mobo with a GeForce6100PM-M2 chipset, and I use a ps/2 keyboard.
Uh? How did you get to this commit? I assume a git bisect? Strange.. I'm going to have a look at it.
Quoted 13 lines · walt
Hi team,
commit
a802dd0eb5fc97a50cf1abb1f788a8f6cc5db635Author: Heiko Carstens <[email protected]> Date: Mon Oct 13 23:50:08 2008 +0200Call
init_workqueuesbefore pre smp initcalls.This commit causes the console login prompt to ignore my keystrokes so I'm unable to log in (though ssh works fine). Oddly, if I hit ctrl-alt-delete the machine does reboot, but no other keystrokes appear on the screen or have any effect that I can detect.
Quoted 6 lines
No surprise that this problem appears only on my dual-core amd64 machine, while the k7 single processor machine works normally.
I've not seen anyone else complaining on the linux list, so maybe this is a BIOS bug on the affected machine? It's an ECS mobo with a GeForce6100PM-M2 chipset, and I use a ps/2 keyboard.
Could you try the patch below and see if it makes any difference? Thanks!
--- include/linux/stop_machine.h | 16 +++++++++++----- init/main.c | 3 +-- kernel/stop_machine.c | 8 ++++++++ 3 files changed, 20 insertions(+), 7 deletions(-)
include/linux/stop_machine.h +11 -5
@@ -8,6 +8,16 @@#include <linux/cpumask.h> #include <asm/system.h> +static inline int stop_machine_simple (int (*fn)(void *),void *data, +const cpumask_t *cpus) +{ +int ret; +local_irq_disable (); + ret =fn (data); +local_irq_enable (); +return ret; +} +#if defined(CONFIG_STOP_MACHINE ) && defined(CONFIG_SMP )/**
@@ -40,11 +50,7 @@ int __stop_machine(int (*fn)(void *), vostatic inline int stop_machine (int (*fn)(void *),void *data,const cpumask_t *cpus) { -int ret; -local_irq_disable (); - ret =fn (data); -local_irq_enable (); -return ret; +return stop_machine_simple (fn, data, cpus); }#endif /* CONFIG_SMP */ #endif /* _LINUX_STOP_MACHINE */
kernel/stop_machine.c +8 -0
@@ -43,6 +43,7 @@ static struct workqueue_struct *stop_macstatic struct stop_machine_data active, idle;static const cpumask_t *active_cpus;static void *stop_machine_work; +static int sm_initialized;static void set_state (enum stopmachine_state newstate) {
@@ -114,6 +115,10 @@ int __stop_machine(int (*fn)(void *), vostruct work_struct *sm_work;int i; +WARN_ON_ONCE (!sm_initialized); +if (num_online_cpus () ==1 ) +return stop_machine_simple (fn, data, cpus); +/* Set up initial state. */ mutex_lock (&lock); num_threads =num_online_cpus ();
@@ -157,7 +162,10 @@ EXPORT_SYMBOL_GPL(stop_machine);static int __init stop_machine_init (void ) { stop_machine_wq =create_rt_workqueue ("kstop" ); +BUG_ON (!stop_machine_wq); stop_machine_work = alloc_percpu(struct work_struct); +BUG_ON (!stop_machine_work); + sm_initialized =1 ;return 0 ; }early_initcall (stop_machine_init);
init/main.c +1 -2
@@ -851,10 +851,9 @@ static int __init kernel_init(void * unu cad_pid =task_pid (current); -init_workqueues (); -smp_prepare_cpus (setup_max_cpus); +init_workqueues ();do_pre_smp_initcalls ();start_boot_trace ();
Quoted 17 lines · Heiko Carstens
Quoted 16 lines · walt
Hi team,
commit
a802dd0eb5fc97a50cf1abb1f788a8f6cc5db635Author: Heiko Carstens <[email protected]> Date: Mon Oct 13 23:50:08 2008 +0200Call
init_workqueuesbefore pre smp initcalls.This commit causes the console login prompt to ignore my keystrokes so I'm unable to log in (though ssh works fine). Oddly, if I hit ctrl-alt-delete the machine does reboot, but no other keystrokes appear on the screen or have any effect that I can detect.
No surprise that this problem appears only on my dual-core amd64 machine, while the k7 single processor machine works normally.
Quoted 6 lines
Quoted 3 lines
I've not seen anyone else complaining on the linux list, so maybe this is a BIOS bug on the affected machine? It's an ECS mobo with a GeForce6100PM-M2 chipset, and I use a ps/2 keyboard.
Could you try the patch below and see if it makes any difference? Thanks!
<patch snipped for brevity>
No difference that I can detect, sorry. The login prompt still ignores my keystrokes. I'm happy to try any other ideas or patches. (Yes, I did use git bisect to find this commit.)
Thanks.
Quoted 22 lines · On Fri, Oct 24, 2008 at 05:52:57AM -0700, [email protected] wrote:
Quoted 21 lines · Heiko Carstens
Quoted 19 lines · walt
Hi team,
commit
a802dd0eb5fc97a50cf1abb1f788a8f6cc5db635Author: Heiko Carstens <[email protected]> Date: Mon Oct 13 23:50:08 2008 +0200Call
init_workqueuesbefore pre smp initcalls.This commit causes the console login prompt to ignore my keystrokes so I'm unable to log in (though ssh works fine). Oddly, if I hit ctrl-alt-delete the machine does reboot, but no other keystrokes appear on the screen or have any effect that I can detect.
No surprise that this problem appears only on my dual-core amd64 machine, while the k7 single processor machine works normally.
I've not seen anyone else complaining on the linux list, so maybe this is a BIOS bug on the affected machine? It's an ECS mobo with a GeForce6100PM-M2 chipset, and I use a ps/2 keyboard.
Quoted 8 lines
Quoted 2 lines
Could you try the patch below and see if it makes any difference? Thanks!
<patch snipped for brevity>
No difference that I can detect, sorry. The login prompt still ignores my keystrokes. I'm happy to try any other ideas or patches. (Yes, I did use git bisect to find this commit.)
Could you cc me on replies, please? Mails sent via vger.kernel.org reach me with a lag of several hours.. so I might miss your reply. :)
Please try the patch below. It basically reverts the whole stop_machine patches. That way we should know if it really comes from the moved init call or if it is some other weird bug. I would have expected more bug reports if the stop_machine patches would be broken. Hmmm...
include/linux/workqueue.h +8 -10
@@ -149,11 +149,11 @@ struct execute_work {extern struct workqueue_struct *__create_workqueue_key (const char *name,int singlethread, -int freezeable,int rt,struct lock_class_key *key, +int freezeable,struct lock_class_key *key,const char *lock_name);#ifdef CONFIG_LOCKDEP -#define __create_workqueue (name, singlethread, freezeable, rt) \ +#define __create_workqueue (name, singlethread, freezeable) \ ({ \ static struct lock_class_key __key; \ const char *__lock_name; \
@@ -164,19 +164,17 @@ __create_workqueue_key(const char *name, __lock_name = #name; \ \ __create_workqueue_key((name), (singlethread), \ - (freezeable), (rt), &__key, \ + (freezeable), &__key, \ __lock_name); \ })#else -#define __create_workqueue (name, singlethread, freezeable, rt) \ - __create_workqueue_key((name), (singlethread), (freezeable), (rt), \ - NULL, NULL) +#define __create_workqueue (name, singlethread, freezeable) \ + __create_workqueue_key((name), (singlethread), (freezeable), NULL, NULL)#endif -#define create_workqueue (name) __create_workqueue((name), 0, 0, 0) -#define create_rt_workqueue (name) __create_workqueue((name), 0, 0, 1) -#define create_freezeable_workqueue (name) __create_workqueue((name), 1, 1, 0) -#define create_singlethread_workqueue (name) __create_workqueue((name), 1, 0, 0) +#define create_workqueue (name) __create_workqueue((name), 0, 0) +#define create_freezeable_workqueue (name) __create_workqueue((name), 1, 1) +#define create_singlethread_workqueue (name) __create_workqueue((name), 1, 0)extern void destroy_workqueue (struct workqueue_struct *wq);
init/main.c +2 -2
@@ -768,6 +768,8 @@ static void __init do_initcalls(void)static void __init do_basic_setup (void ) {rcu_init_sched ();/* needed by module_init stage. */ +/* drivers will send hotplug events */ +init_workqueues ();usermodehelper_init ();driver_init ();init_irq_proc ();
@@ -851,8 +853,6 @@ static int __init kernel_init(void * unu cad_pid =task_pid (current); -init_workqueues (); -smp_prepare_cpus (setup_max_cpus);do_pre_smp_initcalls ();
kernel/stop_machine.c +73 -47
174 lines not on this page · raw message
kernel/workqueue.c +1 -6
@@ -62,7 +62,6 @@ struct workqueue_struct {const char *name;int singlethread;int freezeable;/* Freeze threads during suspend */ -int rt;#ifdef CONFIG_LOCKDEP struct lockdep_map lockdep_map;#endif
@@ -767,7 +766,6 @@ init_cpu_workqueue(struct workqueue_strustatic int create_workqueue_thread (struct cpu_workqueue_struct *cwq,int cpu) { -struct sched_param param = { .sched_priority =MAX_RT_PRIO -1 };struct workqueue_struct *wq = cwq->wq;const char *fmt =is_single_threaded (wq) ?"%s" :"%s/%d" ;struct task_struct *p;
@@ -783,8 +781,7 @@ static int create_workqueue_thread(struc*/ if (IS_ERR (p))return PTR_ERR (p); -if (cwq->wq->rt) -sched_setscheduler_nocheck (p,SCHED_FIFO , ¶m); + cwq->thread = p;return 0 ;
@@ -804,7 +801,6 @@ static void start_workqueue_thread(strucstruct workqueue_struct *__create_workqueue_key (const char *name,int singlethread,int freezeable, -int rt,struct lock_class_key *key,const char *lock_name) {
@@ -826,7 +822,6 @@ struct workqueue_struct *__create_workqulockdep_init_map (&wq->lockdep_map, lock_name, key,0 ); wq->singlethread = singlethread; wq->freezeable = freezeable; - wq->rt = rt;INIT_LIST_HEAD (&wq->list);if (singlethread) {
Quoted 16 lines · Heiko Carstens
Quoted 8 lines · On Fri, Oct 24, 2008 at 05:52:57AM -0700, [email protected] wrote:
Quoted 7 lines · Heiko Carstens
Quoted 6 lines · walt
Hi team,
commit
a802dd0eb5fc97a50cf1abb1f788a8f6cc5db635Author: Heiko Carstens<[email protected]> Date: Mon Oct 13 23:50:08 2008 +0200Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Call
init_workqueuesbefore pre smp initcalls.This commit causes the console login prompt to ignore my keystrokes so I'm unable to log in (though ssh works fine). Oddly, if I hit ctrl-alt-delete the machine does reboot, but no other keystrokes appear on the screen or have any effect that I can detect...
Quoted 4 lines
Please try the patch below. It basically reverts the whole
stop_machinepatches. That way we should know if it really comes from the moved init call or if it is some other weird bug. I would have expected more bug reports if thestop_machinepatches would be broken. Hmmm...
<second patch snipped for brevity>
Yes your second patch fixes the keyboard problem, thanks. The lack of other complainers is what made me think of a BIOS bug, but that's just wild guesswork on my part. I'm happy to keep trying patches if you can keep making them :-)
Quoted 11 lines · walt
Quoted 4 lines
Please try the patch below. It basically reverts the whole
stop_machinepatches. That way we should know if it really comes from the moved init call or if it is some other weird bug. I would have expected more bug reports if thestop_machinepatches would be broken. Hmmm...<second patch snipped for brevity>
Yes your second patch fixes the keyboard problem, thanks. The lack of other complainers is what made me think of a BIOS bug, but that's just wild guesswork on my part. I'm happy to keep trying patches if you can keep making them :-)
Thanks a lot for testing and your patience!
The patch below moves the init call to its old place but makes the stop_machine initialization happen later. I added a BUG_ON to catch possible early calls, but there shouldn't be any. I think the patch should solve the regression you are seeing. Could you give it a try please? The patch applies on top of latest Linus' git tree.
Thanks,
Heiko
--- include/linux/stop_machine.h | 6 ++++++ init/main.c | 5 +++-- kernel/stop_machine.c | 9 ++++++--- 3 files changed, 15 insertions(+), 5 deletions(-)
include/linux/stop_machine.h +6 -0
@@ -35,6 +35,9 @@ int stop_machine(int (*fn)(void *), void* won't come or go while it's being called. Used by hotplug cpu. */ int __stop_machine (int (*fn)(void *),void *data,const cpumask_t *cpus); + +void stop_machine_init (void ); +#else static inline int stop_machine(int (*fn)(void *), void *data,
@@ -46,5 +49,8 @@ static inline int stop_machine(int (*fn)local_irq_enable ();return ret; } + +static inline void stop_machine_init (void ) { } +#endif /* CONFIG_SMP */ #endif /* _LINUX_STOP_MACHINE */
init/main.c +3 -2
@@ -38,6 +38,7 @@#include <linux/moduleparam.h> #include <linux/kallsyms.h> #include <linux/writeback.h> +#include <linux/stop_machine.h> #include <linux/cpu.h> #include <linux/cpuset.h> #include <linux/cgroup.h>
@@ -768,6 +769,8 @@ static void __init do_initcalls(void)static void __init do_basic_setup (void ) {rcu_init_sched ();/* needed by module_init stage. */ +init_workqueues (); +stop_machine_init ();usermodehelper_init ();driver_init ();init_irq_proc ();
@@ -851,8 +854,6 @@ static int __init kernel_init(void * unu cad_pid =task_pid (current); -init_workqueues (); -smp_prepare_cpus (setup_max_cpus);do_pre_smp_initcalls ();
kernel/stop_machine.c +6 -3
@@ -43,6 +43,7 @@ static struct workqueue_struct *stop_macstatic struct stop_machine_data active, idle;static const cpumask_t *active_cpus;static void *stop_machine_work; +static int stop_machine_initialized;static void set_state (enum stopmachine_state newstate) {
@@ -114,6 +115,7 @@ int __stop_machine(int (*fn)(void *), vostruct work_struct *sm_work;int i; +BUG_ON (!stop_machine_initialized);/* Set up initial state. */ mutex_lock (&lock); num_threads =num_online_cpus ();
@@ -154,10 +156,11 @@ int stop_machine(int (*fn)(void *), void }EXPORT_SYMBOL_GPL (stop_machine); -static int __init stop_machine_init (void ) +void __init stop_machine_init (void ) { stop_machine_wq =create_rt_workqueue ("kstop" ); +BUG_ON (!stop_machine_wq); stop_machine_work = alloc_percpu(struct work_struct); -return 0 ; +BUG_ON (!stop_machine_work); + stop_machine_initialized =1 ; } -early_initcall (stop_machine_init);
Quoted 13 lines · Heiko Carstens
Quoted 11 lines · walt
Quoted 4 lines
Please try the patch below. It basically reverts the whole
stop_machinepatches. That way we should know if it really comes from the moved init call or if it is some other weird bug. I would have expected more bug reports if thestop_machinepatches would be broken. Hmmm...<second patch snipped for brevity>
Yes your second patch fixes the keyboard problem, thanks. The lack of other complainers is what made me think of a BIOS bug, but that's just wild guesswork on my part. I'm happy to keep trying patches if you can keep making them :-)
Quoted 6 lines
Thanks a lot for testing and your patience!
The patch below moves the init call to its old place but makes thestop_machineinitialization happen later. I added aBUG_ONto catch possible early calls, but there shouldn't be any. I think the patch should solve the regression you are seeing. Could you give it a try please? The patch applies on top of latest Linus' git tree.
Thanks, Heiko: this patch, or the revert before it, gets my PowerMac G5 working with 2.6.28-rc1. I had the same console keyboard issue as Walt (though USB not PS/2 here), and also the Broadcom tg3 appeared not to be initializing (to judge by bootup messages - but without a keyboard I didn't investigate, and forgot to try pinging from elsewhere). Either of your patches fix both issues (but I've not reviewed them or tried them on other machines which were having no problem).
Hugh
Quoted 98 lines
Thanks,
Heiko--- include/linux/stop_machine.h | 6 ++++++ init/main.c | 5 +++-- kernel/stop_machine.c | 9 ++++++--- 3 files changed, 15 insertions(+), 5 deletions(-)Index:
linux-2.6/include/linux/stop_machine.h
===================================================================include/linux/stop_machine.h +6
-0@@ -35,6 +35,9 @@ int stop_machine(int (*fn)(void *), void* won't come or go while it's being called. Used by hotplug cpu. */ int __stop_machine (int (*fn)(void *),void *data,const cpumask_t *cpus); + +void stop_machine_init (void ); +#else static inline int stop_machine(int (*fn)(void *), void *data,@@ -46,5 +49,8 @@ static inline int stop_machine(int (*fn)local_irq_enable ();return ret; } + +static inline void stop_machine_init (void ) { } +#endif /* CONFIG_SMP */ #endif /* _LINUX_STOP_MACHINE */ Index:
linux-2.6/init/main.c
===================================================================init/main.c +3
-2@@ -38,6 +38,7 @@#include <linux/moduleparam.h> #include <linux/kallsyms.h> #include <linux/writeback.h> +#include <linux/stop_machine.h> #include <linux/cpu.h> #include <linux/cpuset.h> #include <linux/cgroup.h> @@ -768,6 +769,8 @@ static void __init do_initcalls(void)static void __init do_basic_setup (void ) {rcu_init_sched ();/* needed by module_init stage. */ +init_workqueues (); +stop_machine_init ();usermodehelper_init ();driver_init ();init_irq_proc ();@@ -851,8 +854,6 @@ static int __init kernel_init(void * unu cad_pid =task_pid (current); -init_workqueues (); -smp_prepare_cpus (setup_max_cpus);do_pre_smp_initcalls ();Index:
linux-2.6/kernel/stop_machine.c
===================================================================kernel/stop_machine.c +6
-3@@ -43,6 +43,7 @@ static struct workqueue_struct *stop_macstatic struct stop_machine_data active, idle;static const cpumask_t *active_cpus;static void *stop_machine_work; +static int stop_machine_initialized;static void set_state (enum stopmachine_state newstate) {@@ -114,6 +115,7 @@ int __stop_machine(int (*fn)(void *), vostruct work_struct *sm_work;int i; +BUG_ON (!stop_machine_initialized);/* Set up initial state. */ mutex_lock (&lock); num_threads =num_online_cpus ();@@ -154,10 +156,11 @@ int stop_machine(int (*fn)(void *), void }EXPORT_SYMBOL_GPL (stop_machine); -static int __init stop_machine_init (void ) +void __init stop_machine_init (void ) { stop_machine_wq =create_rt_workqueue ("kstop" ); +BUG_ON (!stop_machine_wq); stop_machine_work = alloc_percpu(struct work_struct); -return 0 ; +BUG_ON (!stop_machine_work); + stop_machine_initialized =1 ; } -early_initcall (stop_machine_init);
Quoted 12 lines · Heiko Carstens
Quoted 10 lines · walt
Quoted 4 lines
Please try the patch below. It basically reverts the whole
stop_machinepatches. That way we should know if it really comes from the moved init call or if it is some other weird bug. I would have expected more bug reports if thestop_machinepatches would be broken. Hmmm...<second patch snipped for brevity>
Yes your second patch fixes the keyboard problem, thanks. The lack of other complainers is what made me think of a BIOS bug, but that's just wild guesswork on my part. I'm happy to keep trying patches if you can keep making them :-)
Quoted 6 lines
Thanks a lot for testing and your patience!
The patch below moves the init call to its old place but makes thestop_machineinitialization happen later. I added aBUG_ONto catch possible early calls, but there shouldn't be any. I think the patch should solve the regression you are seeing. Could you give it a try please? The patch applies on top of latest Linus' git tree...
<patch snipped for brevity>
Yes, everything seems back to normal with this patch, thanks.