On 03/25/2019 09:56 PM, Mathieu Poirier wrote:
When operating in CPU-wide mode with an N:1 source/sink HW topology, multiple CPUs can access a sink concurrently. As such reference counting needs to happen when the device's spinlock is held to avoid racing with other operations (start(), update(), stop()), such as:
session A Session B
enable_sink atomic_inc(refcount) = 1
...
atomic_dec(refcount) = 0 enable_sink if (refcount == 0) disable_sink atomic_inc()
Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org
Reviewed-by: Suzuki K Poulose suzuki.poulose@arm.com