]> git.baikalelectronics.ru Git - kernel.git/commit
coresight: etmv4: Fix CPU power management setup in probe() function
authorMike Leach <mike.leach@linaro.org>
Wed, 1 Jul 2020 16:08:52 +0000 (10:08 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Jul 2020 16:45:34 +0000 (18:45 +0200)
commitbee539e0828b970287585e9037362819c807d3e3
tree53c6f285cb8b67184857fa2bbdaac7079dc509a5
parent6d4805466009b75166bd78df462e28472546d4ca
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: ae0761b2bf59 ("coresight: etm4x: Save/restore state across CPU low power states")
Fixes: ec8e613fc528 ("hwtracing/coresight-etm4x: Use cpuhp_setup_state_nocalls_cpuslocked()")
Fixes: b230349f3b35 ("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>
drivers/hwtracing/coresight/coresight-etm4x.c