On Wed, 2018-03-14 at 17:58 +0100, Frederic Barrat wrote:
> + if (irq == hw_irq) {
> + cur &= 1 << 31;
> + cur |= XIVE_BAD_IRQ;
> + *(q->qpage + idx) = cpu_to_be32(cur);
> + }
> +
> + idx = (idx + 1) & q->msk;
> + if (idx == 0)
> + toggle ^= 1;
> + } while (irq && (count < q->msk));Safer to make the replacement an atomic with cmpxhg just in case you found an old one trailing the queue that's just getting updated by HW. Cheers, Ben.
