]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
clockevents: prevent clockevent event_handler ending up handler_noop
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Wed, 3 Sep 2008 21:36:50 +0000 (21:36 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Oct 2008 03:23:03 +0000 (20:23 -0700)
commit2a2bac600a84eedf9d9dd6766232640876593856
tree426ae25c7f6b6736f37d35c5d1aeac21bdef1761
parent579b4b38460a47b3ba51c35412b960dafe3d0949
clockevents: prevent clockevent event_handler ending up handler_noop

commit 7c1e76897492d92b6a1c2d6892494d39ded9680c upstream

There is a ordering related problem with clockevents code, due to which
clockevents_register_device() called after tickless/highres switch
will not work. The new clockevent ends up with clockevents_handle_noop as
event handler, resulting in no timer activity.

The problematic path seems to be

* old device already has hrtimer_interrupt as the event_handler
* new clockevent device registers with a higher rating
* tick_check_new_device() is called
  * clockevents_exchange_device() gets called
    * old->event_handler is set to clockevents_handle_noop
  * tick_setup_device() is called for the new device
    * which sets new->event_handler using the old->event_handler which is noop.

Change the ordering so that new device inherits the proper handler.

This does not have any issue in normal case as most likely all the clockevent
devices are setup before the highres switch. But, can potentially be affecting
some corner case where HPET force detect happens after the highres switch.
This was a problem with HPET in MSI mode code that we have been experimenting
with.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/clockchips.h
kernel/time/clockevents.c
kernel/time/tick-common.c