All of lore.kernel.org
 help / color / mirror / Atom feed
* Raising an disabled tasklet / VC/KBD initialization bug.
@ 2002-03-04 16:56 Andi Kleen
  2002-03-04 17:35 ` James Simmons
  2002-03-04 17:41 ` Alan Cox
  0 siblings, 2 replies; 4+ messages in thread
From: Andi Kleen @ 2002-03-04 16:56 UTC (permalink / raw)
  To: linux-kernel


Hallo,

I just ran into the following situation on x86-64 on 2.4.17. I think
2.5 has the same problem. 

For some reason vc_init executed in init order after kbd_init
(they are both indirectly called via __initcall so it can happen) 
vc_init does a tasklet_schedule for the keyboard tasklet in 
set_leds.  The keyboard tasklet had not been enabled yet because kbd_init
didn't execute.
Result was an raised tasklet that wasn't enabled.  schedule was called
and ran the softirqs.  tasklet_action always tried to execute it, but 
returned on the non zero count. The tasklet was still active. ksoftirqd
noticed that and executed do_softirq again -> endless loop. 

For now I just removed the set_leds() call in reset_terminal to work around
it. The real fix would be either to add an mechanism to support raising
of disabled tasklets properly or make sure kbd_init and vc_init have defined
init order and the first always executes before the second. 

Comments? 

-Andi


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

* Re: Raising an disabled tasklet / VC/KBD initialization bug.
  2002-03-04 16:56 Raising an disabled tasklet / VC/KBD initialization bug Andi Kleen
@ 2002-03-04 17:35 ` James Simmons
  2002-03-04 17:41 ` Alan Cox
  1 sibling, 0 replies; 4+ messages in thread
From: James Simmons @ 2002-03-04 17:35 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel


> For some reason vc_init executed in init order after kbd_init
> (they are both indirectly called via __initcall so it can happen) 
> vc_init does a tasklet_schedule for the keyboard tasklet in 
> set_leds.  The keyboard tasklet had not been enabled yet because kbd_init
> didn't execute.
> Result was an raised tasklet that wasn't enabled.  schedule was called
> and ran the softirqs.  tasklet_action always tried to execute it, but 
> returned on the non zero count. The tasklet was still active. ksoftirqd
> noticed that and executed do_softirq again -> endless loop. 

Really good spotting. 

> For now I just removed the set_leds() call in reset_terminal to work around
> it. The real fix would be either to add an mechanism to support raising
> of disabled tasklets properly or make sure kbd_init and vc_init have defined
> init order and the first always executes before the second. 

I'm working on a fix right now. As gor calling kbd_init before vc_init
that is a bad idea as all keyboard drivers are being moved over to the
input api. Plus the console system will soon support hotplug of devices.
The proper fix is to test the kam flag in struct vc_data. Will send a
patch to be included in the dave jones tree.




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

* Re: Raising an disabled tasklet / VC/KBD initialization bug.
  2002-03-04 17:41 ` Alan Cox
@ 2002-03-04 17:35   ` James Simmons
  0 siblings, 0 replies; 4+ messages in thread
From: James Simmons @ 2002-03-04 17:35 UTC (permalink / raw)
  To: Alan Cox; +Cc: Andi Kleen, linux-kernel


> > of disabled tasklets properly or make sure kbd_init and vc_init have defined
> > init order and the first always executes before the second. 
> > 
> > Comments? 
> 
> Oh this explains several non x86 reports. Yes We need to fix the link order

Better fix is to test the kam flag in struct vc_data. Will send patch.


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

* Re: Raising an disabled tasklet / VC/KBD initialization bug.
  2002-03-04 16:56 Raising an disabled tasklet / VC/KBD initialization bug Andi Kleen
  2002-03-04 17:35 ` James Simmons
@ 2002-03-04 17:41 ` Alan Cox
  2002-03-04 17:35   ` James Simmons
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Cox @ 2002-03-04 17:41 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

> of disabled tasklets properly or make sure kbd_init and vc_init have defined
> init order and the first always executes before the second. 
> 
> Comments? 

Oh this explains several non x86 reports. Yes We need to fix the link order

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

end of thread, other threads:[~2002-03-04 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-04 16:56 Raising an disabled tasklet / VC/KBD initialization bug Andi Kleen
2002-03-04 17:35 ` James Simmons
2002-03-04 17:41 ` Alan Cox
2002-03-04 17:35   ` James Simmons

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.