diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2016-05-16 20:37:33 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2016-05-16 20:37:33 +0900 |
commit | 3651aa64b48d46fa8572a94b23c291d81e9d84ea (patch) | |
tree | aba2c498ff79fc5ba78b568511faf6b6361c24c7 | |
parent | 98977937cba9a4964151ed195d4cc1cd9f7966dd (diff) |
ll_dequeue for PX only when not ready
-rw-r--r-- | chopstx.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -1857,23 +1857,26 @@ chopstx_poll (uint32_t *usec_p, int n, ...) for (i = 0; i < n; i++) { pd = va_arg (ap, struct chx_poll_head *); + + chx_cpu_sched_lock (); + chx_spin_lock (&px[i].lock); if (pd->type == CHOPSTX_POLL_INTR) { struct chx_intr *intr = (struct chx_intr *)pd; - chx_cpu_sched_lock (); - chx_spin_lock (&q_intr.lock); if (intr->ready) chx_clr_intr (intr->irq_num); else - chx_disable_intr (intr->irq_num); - chx_spin_unlock (&q_intr.lock); - chx_cpu_sched_unlock (); + { + ll_dequeue ((struct chx_pq *)&px[i]); + 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_cpu_sched_unlock (); } |