ll_dequeue for PX only when not ready
This commit is contained in:
21
chopstx.c
21
chopstx.c
@@ -1857,23 +1857,26 @@ chopstx_poll (uint32_t *usec_p, int n, ...)
|
|||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
pd = va_arg (ap, struct chx_poll_head *);
|
pd = va_arg (ap, struct chx_poll_head *);
|
||||||
|
|
||||||
|
chx_cpu_sched_lock ();
|
||||||
|
chx_spin_lock (&px[i].lock);
|
||||||
if (pd->type == CHOPSTX_POLL_INTR)
|
if (pd->type == CHOPSTX_POLL_INTR)
|
||||||
{
|
{
|
||||||
struct chx_intr *intr = (struct chx_intr *)pd;
|
struct chx_intr *intr = (struct chx_intr *)pd;
|
||||||
|
|
||||||
chx_cpu_sched_lock ();
|
|
||||||
chx_spin_lock (&q_intr.lock);
|
|
||||||
if (intr->ready)
|
if (intr->ready)
|
||||||
chx_clr_intr (intr->irq_num);
|
chx_clr_intr (intr->irq_num);
|
||||||
else
|
else
|
||||||
chx_disable_intr (intr->irq_num);
|
{
|
||||||
chx_spin_unlock (&q_intr.lock);
|
ll_dequeue ((struct chx_pq *)&px[i]);
|
||||||
chx_cpu_sched_unlock ();
|
chx_disable_intr (intr->irq_num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (pd->ready == 0)
|
||||||
|
ll_dequeue ((struct chx_pq *)&px[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
chx_cpu_sched_lock ();
|
|
||||||
chx_spin_lock (&px[i].lock);
|
|
||||||
ll_dequeue ((struct chx_pq *)&px[i]);
|
|
||||||
chx_spin_unlock (&px[i].lock);
|
chx_spin_unlock (&px[i].lock);
|
||||||
chx_cpu_sched_unlock ();
|
chx_cpu_sched_unlock ();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user