linux-stable/drivers/hwtracing/coresight
Mike Leach 9b6a3f3633 coresight: etmv4: Fix CPU power management setup in probe() function
The current probe() function calls a pair of cpuhp_xxx API functions to
setup CPU hotplug handling. The hotplug lock is held for the duration of
the two calls and other CPU related code using cpus_read_lock() /
cpus_read_unlock() calls.

The problem is that on error states, goto: statements bypass the
cpus_read_unlock() call. This code has increased in complexity as the
driver has developed.

This patch introduces a pair of helper functions etm4_pm_setup_cpuslocked()
and etm4_pm_clear() which correct the issues above and group the PM code a
little better.

The two functions etm4_cpu_pm_register() and etm4_cpu_pm_unregister() are
dropped as these call cpu_pm_register_notifier() / ..unregister_notifier()
dependent on CONFIG_CPU_PM - but this define is used to nop these functions
out in the pm headers - so the wrapper functions are superfluous.

Fixes: f188b5e76a ("coresight: etm4x: Save/restore state across CPU low power states")
Fixes: e9f5d63f84 ("hwtracing/coresight-etm4x: Use cpuhp_setup_state_nocalls_cpuslocked()")
Fixes: 58eb457be0 ("hwtracing/coresight-etm4x: Convert to hotplug state machine")
Signed-off-by: Mike Leach <mike.leach@linaro.org>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200701160852.2782823-3-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 18:45:34 +02:00
..
coresight-catu.c coresight: Use platform agnostic names 2019-06-20 07:56:13 +02:00
coresight-catu.h coresight: catu: Cleanup device specific data 2019-06-19 20:29:14 +02:00
coresight-cpu-debug.c coresight: cpu-debug: Add support for Qualcomm Kryo 2019-09-03 22:01:15 +02:00
coresight-cti-platform.c Char/Misc driver patches for 5.8-rc1 2020-06-07 10:59:32 -07:00
coresight-cti-sysfs.c coresight: Include required headers in C files 2020-05-19 16:31:18 +02:00
coresight-cti.c coresight: cti: Fix error handling in probe 2020-07-01 18:44:07 +02:00
coresight-cti.h coresight: Include required headers in C files 2020-05-19 16:31:18 +02:00
coresight-etb10.c coresight: etb10: Make coresight_etb_groups static 2020-05-19 16:31:16 +02:00
coresight-etm-cp14.c
coresight-etm-perf.c coresight: Fix DEBUG_LOCKS_WARN_ON for uninitialized attribute 2019-08-01 20:51:34 +02:00
coresight-etm-perf.h coresight: perf: Add "sinks" group to PMU directory 2019-02-08 12:27:36 +01:00
coresight-etm.h coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-etm3x-sysfs.c coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-etm3x.c coresight: Initialize arg in sparse friendly way 2020-05-19 16:31:17 +02:00
coresight-etm4x-sysfs.c coresight: etmv4: Update default filter and initialisation 2020-05-19 16:31:17 +02:00
coresight-etm4x.c coresight: etmv4: Fix CPU power management setup in probe() function 2020-07-01 18:45:34 +02:00
coresight-etm4x.h coresight: etm4x: Add missing single-shot control API to sysfs 2019-11-04 21:57:56 +01:00
coresight-funnel.c coresight: funnel: Fix missing spin_lock_init() 2019-11-19 19:18:15 +01:00
coresight-platform.c coresight: Mark some functions static 2020-05-19 16:31:17 +02:00
coresight-priv.h coresight: Avoid casting void pointers 2020-05-19 16:31:18 +02:00
coresight-replicator.c coresight: replicator: Fix missing spin_lock_init() 2019-11-19 19:18:15 +01:00
coresight-stm.c coresight: stm: ACPI support for parsing stimulus base 2019-06-20 07:56:14 +02:00
coresight-sysfs.c coresight: Expose device connections via sysfs 2020-05-19 16:31:15 +02:00
coresight-tmc-etf.c coresight: tmc: Fix TMC mode read in tmc_read_prepare_etb() 2020-05-19 16:31:17 +02:00
coresight-tmc-etr.c coresight: tmc-etr: Add barrier packets when moving offset forward 2019-09-03 22:01:18 +02:00
coresight-tmc.c coresight: Mark some functions static 2020-05-19 16:31:17 +02:00
coresight-tmc.h coresight: tmc: Make memory width mask computation into a function 2019-09-03 22:01:18 +02:00
coresight-tpiu.c coresight: Use platform agnostic names 2019-06-20 07:56:13 +02:00
coresight.c coresight: Fix support for sparsely populated ports 2020-05-19 16:31:16 +02:00
Kconfig docs: fix broken references to text files 2020-04-20 15:35:59 -06:00
Makefile coresight: Add generic sysfs link creation functions 2020-05-19 16:31:15 +02:00