Skip to content
Snippets Groups Projects
Commit aa219008 authored by Armin Luntzer's avatar Armin Luntzer
Browse files

CLOCKEVENT: disable scheduling when checking clock device and keep

            interrupts enabled
parent 05674a72
Branches
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <kernel/clockevent.h> #include <kernel/clockevent.h>
#include <kernel/export.h> #include <kernel/export.h>
#include <kernel/tick.h> #include <kernel/tick.h>
#include <kernel/sched.h>
#include <errno.h> #include <errno.h>
...@@ -242,9 +243,16 @@ void clockevents_register_device(struct clock_event_device *dev) ...@@ -242,9 +243,16 @@ void clockevents_register_device(struct clock_event_device *dev)
spin_lock(&clockevents_spinlock); spin_lock(&clockevents_spinlock);
list_add_tail(&dev->node, &clockevent_devices); list_add_tail(&dev->node, &clockevent_devices);
arch_local_irq_disable(); /* this should be safe without disabling interrupts, if not,
* we need a different strategy to calibrate the tick period of the
* device...
*
* XXX need long-time run-time testing for verifcation
*/
sched_disable();
tick_check_device(dev); tick_check_device(dev);
arch_local_irq_enable(); sched_enable();
spin_unlock(&clockevents_spinlock); spin_unlock(&clockevents_spinlock);
} }
...@@ -266,9 +274,16 @@ int clockevents_offer_device(void) ...@@ -266,9 +274,16 @@ int clockevents_offer_device(void)
if (dev->state != CLOCK_EVT_STATE_UNUSED) if (dev->state != CLOCK_EVT_STATE_UNUSED)
continue; continue;
arch_local_irq_disable(); /* this should be save without disabling interrupts, if not,
* we need a different strategy to calibrate the tick period of
* the device...
*
* XXX need long-time run-time testing for verifcation
*/
sched_disable();
tick_check_device(dev); tick_check_device(dev);
arch_local_irq_enable(); sched_enable();
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment