diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2017-05-24 04:15:23 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-05-26 04:10:39 -0400 |
commit | e9f5d63f84febb7e9dfe4e0dc696adf88053fbf2 (patch) | |
tree | b38f9a2e0f948487806dc6800486e5a95883606b | |
parent | e560c89c8ac0baadf0da351f602c599016568fc7 (diff) |
hwtracing/coresight-etm4x: Use cpuhp_setup_state_nocalls_cpuslocked()
etm_probe4() holds get_online_cpus() while invoking
cpuhp_setup_state_nocalls().
cpuhp_setup_state_nocalls() invokes get_online_cpus() as well. This is
correct, but prevents the conversion of the hotplug locking to a percpu
rwsem.
Use cpuhp_setup_state_nocalls_cpuslocked() to avoid the nested
call. Convert *_online_cpus() to the new interfaces while at it.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20170524081547.983493849@linutronix.de
-rw-r--r-- | drivers/hwtracing/coresight/coresight-etm4x.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index d1340fb4e457..532adc9dd32a 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c | |||
@@ -371,7 +371,7 @@ static void etm4_disable_sysfs(struct coresight_device *csdev) | |||
371 | * after cpu online mask indicates the cpu is offline but before the | 371 | * after cpu online mask indicates the cpu is offline but before the |
372 | * DYING hotplug callback is serviced by the ETM driver. | 372 | * DYING hotplug callback is serviced by the ETM driver. |
373 | */ | 373 | */ |
374 | get_online_cpus(); | 374 | cpus_read_lock(); |
375 | spin_lock(&drvdata->spinlock); | 375 | spin_lock(&drvdata->spinlock); |
376 | 376 | ||
377 | /* | 377 | /* |
@@ -381,7 +381,7 @@ static void etm4_disable_sysfs(struct coresight_device *csdev) | |||
381 | smp_call_function_single(drvdata->cpu, etm4_disable_hw, drvdata, 1); | 381 | smp_call_function_single(drvdata->cpu, etm4_disable_hw, drvdata, 1); |
382 | 382 | ||
383 | spin_unlock(&drvdata->spinlock); | 383 | spin_unlock(&drvdata->spinlock); |
384 | put_online_cpus(); | 384 | cpus_read_unlock(); |
385 | 385 | ||
386 | dev_info(drvdata->dev, "ETM tracing disabled\n"); | 386 | dev_info(drvdata->dev, "ETM tracing disabled\n"); |
387 | } | 387 | } |
@@ -982,7 +982,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) | |||
982 | 982 | ||
983 | drvdata->cpu = pdata ? pdata->cpu : 0; | 983 | drvdata->cpu = pdata ? pdata->cpu : 0; |
984 | 984 | ||
985 | get_online_cpus(); | 985 | cpus_read_lock(); |
986 | etmdrvdata[drvdata->cpu] = drvdata; | 986 | etmdrvdata[drvdata->cpu] = drvdata; |
987 | 987 | ||
988 | if (smp_call_function_single(drvdata->cpu, | 988 | if (smp_call_function_single(drvdata->cpu, |
@@ -990,18 +990,18 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) | |||
990 | dev_err(dev, "ETM arch init failed\n"); | 990 | dev_err(dev, "ETM arch init failed\n"); |
991 | 991 | ||
992 | if (!etm4_count++) { | 992 | if (!etm4_count++) { |
993 | cpuhp_setup_state_nocalls(CPUHP_AP_ARM_CORESIGHT_STARTING, | 993 | cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING, |
994 | "arm/coresight4:starting", | 994 | "arm/coresight4:starting", |
995 | etm4_starting_cpu, etm4_dying_cpu); | 995 | etm4_starting_cpu, etm4_dying_cpu); |
996 | ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, | 996 | ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN, |
997 | "arm/coresight4:online", | 997 | "arm/coresight4:online", |
998 | etm4_online_cpu, NULL); | 998 | etm4_online_cpu, NULL); |
999 | if (ret < 0) | 999 | if (ret < 0) |
1000 | goto err_arch_supported; | 1000 | goto err_arch_supported; |
1001 | hp_online = ret; | 1001 | hp_online = ret; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | put_online_cpus(); | 1004 | cpus_read_unlock(); |
1005 | 1005 | ||
1006 | if (etm4_arch_supported(drvdata->arch) == false) { | 1006 | if (etm4_arch_supported(drvdata->arch) == false) { |
1007 | ret = -EINVAL; | 1007 | ret = -EINVAL; |