Commit 87edcca1 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski Committed by Federico Vaga

wrtd:rt: forgot to initialize the loop queue. Counter should be also atomic

parent c783633d
......@@ -41,7 +41,7 @@ void loop_queue_push(struct wrtd_trig_id *id, uint32_t seq, struct wr_timestamp
if (head == LOOP_QUEUE_SIZE)
head = 0;
count++;
smem_atomic_add(&count, 1);
}
struct wrtd_trigger_entry *loop_queue_pop()
......@@ -55,7 +55,8 @@ struct wrtd_trigger_entry *loop_queue_pop()
if(tail == LOOP_QUEUE_SIZE)
tail = 0;
count--;
smem_atomic_sub(&count, 1);
return rv;
}
......@@ -727,7 +727,6 @@ void do_rx()
rx_ebone++;
}
struct wrtd_trigger_entry *ent = loop_queue_pop();
if (ent) {
......
......@@ -654,6 +654,8 @@ void init()
{
int i;
loop_queue_init();
wr_state = WR_LINK_OFFLINE;
wr_enable_lock(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment