From 3c2dd59f9050cf874dcee994b110dd1c54a26a6d Mon Sep 17 00:00:00 2001 From: Devin Kim Date: Mon, 14 Jan 2013 09:40:05 -0800 Subject: [PATCH] coresight: do not probe if cpu is not online If you use the parameter 'maxcpus=n', restrict boot time cpus to n. To initialize the ETM on cpu, the cpus should be online. So if you restrict boot time cpus, you can not enable the ETM on cpu which is rectriced(not enabled). Skip the initialization of the ETM. Change-Id: Idccf537ff4dce0ae5d1b60ecc1631180ad323fb8 --- drivers/coresight/coresight-etm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/coresight/coresight-etm.c b/drivers/coresight/coresight-etm.c index 73c14996cace..ffbc6e7f65b0 100644 --- a/drivers/coresight/coresight-etm.c +++ b/drivers/coresight/coresight-etm.c @@ -2045,6 +2045,11 @@ static int __devinit etm_probe(struct platform_device *pdev) pdev->dev.platform_data = pdata; } +#ifdef CONFIG_SMP + if (count >= setup_max_cpus) + return -ENODEV; +#endif + drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); if (!drvdata) return -ENOMEM;