|
@@ -45,17 +45,12 @@ static void xen_qlock_wait(u8 *byte, u8 val)
|
|
|
if (irq == -1)
|
|
|
return;
|
|
|
|
|
|
- /* clear pending */
|
|
|
- xen_clear_irq_pending(irq);
|
|
|
- barrier();
|
|
|
+ /* If irq pending already clear it and return. */
|
|
|
+ if (xen_test_irq_pending(irq)) {
|
|
|
+ xen_clear_irq_pending(irq);
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- /*
|
|
|
- * We check the byte value after clearing pending IRQ to make sure
|
|
|
- * that we won't miss a wakeup event because of the clearing.
|
|
|
- *
|
|
|
- * The sync_clear_bit() call in xen_clear_irq_pending() is atomic.
|
|
|
- * So it is effectively a memory barrier for x86.
|
|
|
- */
|
|
|
if (READ_ONCE(*byte) != val)
|
|
|
return;
|
|
|
|