Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3a131315 authored by Mathieu Poirier's avatar Mathieu Poirier Committed by Yabin Cui
Browse files

UPSTREAM: coresight: Move reference counting inside sink drivers



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: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
Tested-by: default avatarRobert Walker <robert.walker@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

(Upstream commit f973d88b75703719d39c4d5145079199aaf442b2).

Bug: 140266694
Change-Id: I6a2f92b2fcb9fbc8a1ccd991321fbdf649122f88
Signed-off-by: default avatarYabin Cui <yabinc@google.com>
parent c6b211cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment