OSDN Git Service

coresight: Fix reference count for software sources
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 5 Jun 2017 20:15:03 +0000 (14:15 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2017 09:45:24 +0000 (11:45 +0200)
commit022aa1a81b778789ee7cf3124595854276a0330d
tree77060cba266b912af110bf256f60c1442d2479f0
parentf73f20e1fcc9fcdc7557fd1c4b1b72f924478688
coresight: Fix reference count for software sources

For software sources (i.e STM), there could be multiple agents
generating the trace data, unlike the ETMs. So we need to
properly do the accounting for the active number of users
to disable the device when the last user goes away. Right
now, the reference counting is broken for sources as we skip
the actions when we detect that the source is enabled.

This patch fixes the problem by adding the refcounting for
software sources, even when they are enabled.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Reported-by: Robert Walker <robert.walker@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight.c