diff options
| author | Satyajit Desai <sadesai@codeaurora.org> | 2016-07-08 12:33:38 -0700 |
|---|---|---|
| committer | Satyajit Desai <sadesai@codeaurora.org> | 2016-07-20 17:14:31 -0700 |
| commit | 8624f4eca5cb0bbd3869255d37849ee5f69d0078 (patch) | |
| tree | d4ba0997e35f78e33f5d8ef427818e8ec714311e | |
| parent | 9e4b3ba4afcff08bce320513610955391ab95806 (diff) | |
coresight-etm4x: avoid reading trace-id from ETM hardware block
I/O read of trace-id when the CPU is in power collapse can result
in undefined behavior and system crash. Trace-id is set during
ETM init and not modified thereafter. So, there is no real need
to read the value from I/O.
Change-Id: I83029c721f7b90c65fcc8a958c7a82e65d005ed5
Signed-off-by: Satyajit Desai <sadesai@codeaurora.org>
| -rw-r--r-- | drivers/hwtracing/coresight/coresight-etm4x.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 7e93f7654347..617c766f032e 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -68,24 +68,8 @@ static bool etm4_arch_supported(u8 arch) static int etm4_trace_id(struct coresight_device *csdev) { struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); - unsigned long flags; - int trace_id = -1; - if (!drvdata->enable) - return drvdata->trcid; - - pm_runtime_get_sync(drvdata->dev); - spin_lock_irqsave(&drvdata->spinlock, flags); - - CS_UNLOCK(drvdata->base); - trace_id = readl_relaxed(drvdata->base + TRCTRACEIDR); - trace_id &= ETM_TRACEID_MASK; - CS_LOCK(drvdata->base); - - spin_unlock_irqrestore(&drvdata->spinlock, flags); - pm_runtime_put(drvdata->dev); - - return trace_id; + return drvdata->trcid; } static void etm4_enable_hw(void *info) |
