coresight: tmc: getting rid of multiple read access
authorMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 3 May 2016 17:33:53 +0000 (11:33 -0600)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Wed, 1 Jun 2016 21:46:37 +0000 (15:46 -0600)
commit09c5cf1702bf498bd5d30e94eda0d855dbb301df
tree60258ee4299a188b684e2bac9da59a3c5fc65403
parent17c61c32ab5a2e0ff67e00e4d562ba0a97b999f2
coresight: tmc: getting rid of multiple read access

Allowing multiple readers to access the trace data simultaniously
via sysFS provides no shortage of opportunity for race condition,
mandates two variable to be maintained (drvdata::read_count and
drvdata::reading), makes the code complex and provide little
advantages, if any.

This patch streamlines the read process by restricting trace data
access to a single user.  That way drvdata::read_count can
be eliminated and race conditions (along with faulty error handling)
in function tmc_open() and tmc_release() eliminated.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f74debbea0885ebb65fb3fa4e598323f40b03f5f)
drivers/hwtracing/coresight/coresight-tmc-etf.c
drivers/hwtracing/coresight/coresight-tmc-etr.c
drivers/hwtracing/coresight/coresight-tmc.c
drivers/hwtracing/coresight/coresight-tmc.h