Re: [RFC PATCH 1/2] debug: Convert dbg_slave_lock to an atomic

From: Peter Zijlstra
Date: Fri May 22 2020 - 12:27:26 EST


On Fri, May 22, 2020 at 03:55:09PM +0100, Daniel Thompson wrote:

> +static atomic_t slaves_must_spin;

> + if (!atomic_read(&slaves_must_spin))

> + atomic_set(&slaves_must_spin, 1);

> + atomic_set(&slaves_must_spin, 0);

There is no atomic operation there; this is pointless use of atomic_t.