#include <layer1/mframe_sched.h>
+#if 0
+NOTE: Re-enabling interrupts causes an IRQ while processing the same IRQ.
+ Use local_firq_save and local_irq_restore instead!
+
/* When altering data structures used by L1 Sync part, we need to
* make sure to temporarily disable IRQ/FIQ to keep data consistent */
static inline void l1a_lock_sync(void)
{
arm_enable_interrupts();
}
+#endif
/* safely enable a message into the L1S TX queue */
void l1a_txq_msgb_enq(struct llist_head *queue, struct msgb *msg);
/* safely enable a message into the L1S TX queue */
void l1a_txq_msgb_enq(struct llist_head *queue, struct msgb *msg)
{
- l1a_lock_sync();
+ unsigned long flags;
+
+ local_firq_save(flags);
msgb_enqueue(queue, msg);
- l1a_unlock_sync();
+ local_irq_restore(flags);
}
/* Enable a repeating multiframe task */
#include <calypso/dsp.h>
#include <calypso/timer.h>
#include <comm/sercomm.h>
+#include <asm/system.h>
#include <layer1/sync.h>
#include <layer1/async.h>
void l1a_freq_req(uint32_t fn_sched)
{
int32_t diff;
+ unsigned long flags;
/* We must check here, if the time already elapsed.
* This is required, because we may have an undefined delay between
printf("Scheduling frequency change at fn=%u, currently fn=%u\n",
fn_sched, l1s.current_time.fn);
- l1a_lock_sync();
+ local_firq_save(flags);
sched_gsmtime(freq_sched_set, fn_sched, 0);
- l1a_unlock_sync();
+ local_irq_restore(flags);
}
#include <calypso/dsp.h>
#include <calypso/timer.h>
#include <comm/sercomm.h>
+#include <asm/system.h>
#include <layer1/sync.h>
#include <layer1/agc.h>
/* Schedule a power measurement test */
void l1s_pm_test(uint8_t base_fn, uint16_t arfcn)
{
+ unsigned long flags;
+
printd("l1s_pm_test(%u, %u)\n", base_fn, arfcn);
+
+ local_firq_save(flags);
tdma_schedule_set(base_fn, pm_sched_set, arfcn);
+ local_irq_restore(flags);
}
#include <calypso/dsp.h>
#include <calypso/timer.h>
#include <comm/sercomm.h>
+#include <asm/system.h>
#include <layer1/sync.h>
#include <layer1/async.h>
void l1a_rach_req(uint8_t fn51, uint8_t mf_off, uint8_t ra)
{
uint32_t fn_sched;
+ unsigned long flags;
- l1a_lock_sync();
+ local_firq_save(flags);
l1s.rach.ra = ra;
/* TODO: can we wrap here? I don't think so */
fn_sched = l1s.current_time.fn - l1s.current_time.t3;
fn_sched += mf_off * 51;
fn_sched += fn51;
sched_gsmtime(rach_sched_set_ul, fn_sched, 0);
- l1a_unlock_sync();
+ local_irq_restore(flags);
memset(&last_rach, 0, sizeof(last_rach));
}