aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/coresight/coresight-cpu-debug.c
diff options
context:
space:
mode:
authorSai Prakash Ranjan <[email protected]>2019-07-04 09:53:05 +0000
committerGreg Kroah-Hartman <[email protected]>2019-07-04 10:23:26 +0000
commit996cdfaf538f159f822f2619d55449c587b86cb6 (patch)
treecd76d7c44f00b1462753abdc98f371611acafc0f /drivers/hwtracing/coresight/coresight-cpu-debug.c
parentdt-bindings: coresight: Change CPU phandle to required property (diff)
downloadkernel-996cdfaf538f159f822f2619d55449c587b86cb6.tar.gz
kernel-996cdfaf538f159f822f2619d55449c587b86cb6.zip
coresight: Do not default to CPU0 for missing CPU phandle
Coresight platform support assumes that a missing "cpu" phandle defaults to CPU0. This could be problematic and unnecessarily binds components to CPU0, where they may not be. In coresight etm and cpu-debug drivers, abort the probe for such cases. Signed-off-by: Sai Prakash Ranjan <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Tested-by: Mathieu Poirier <[email protected]> Reviewed-by: Mathieu Poirier <[email protected]> Link: https://lore.kernel.org/r/f1955ea19c714cf64ea54ec356a9aa85f3cd17b8.1562229018.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-cpu-debug.c')
-rw-r--r--drivers/hwtracing/coresight/coresight-cpu-debug.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hwtracing/coresight/coresight-cpu-debug.c
index 07a1367c733f..58bfd6319f65 100644
--- a/drivers/hwtracing/coresight/coresight-cpu-debug.c
+++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c
@@ -579,6 +579,9 @@ static int debug_probe(struct amba_device *adev, const struct amba_id *id)
return -ENOMEM;
drvdata->cpu = coresight_get_cpu(dev);
+ if (drvdata->cpu < 0)
+ return drvdata->cpu;
+
if (per_cpu(debug_drvdata, drvdata->cpu)) {
dev_err(dev, "CPU%d drvdata has already been initialized\n",
drvdata->cpu);