drivers/perf: arm_pmu: Fix failure path in PM notifier
authorWill Deacon <will@kernel.org>
Mon, 29 Jul 2019 10:43:48 +0000 (11:43 +0100)
committerWill Deacon <will@kernel.org>
Mon, 29 Jul 2019 10:43:48 +0000 (11:43 +0100)
Handling of the CPU_PM_ENTER_FAILED transition in the Arm PMU PM
notifier code incorrectly skips restoration of the counters. Fix the
logic so that CPU_PM_ENTER_FAILED follows the same path as CPU_PM_EXIT.

Cc: <stable@vger.kernel.org>
Fixes: da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
Reported-by: Anders Roxell <anders.roxell@linaro.org>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm_pmu.c

index 2d06b8095a19cf92f9d5dcd2dc93375c5d27ea2a..df352b334ea77ab20f9ba7b400fca3e27321f129 100644 (file)
@@ -723,8 +723,8 @@ static int cpu_pm_pmu_notify(struct notifier_block *b, unsigned long cmd,
                cpu_pm_pmu_setup(armpmu, cmd);
                break;
        case CPU_PM_EXIT:
-               cpu_pm_pmu_setup(armpmu, cmd);
        case CPU_PM_ENTER_FAILED:
+               cpu_pm_pmu_setup(armpmu, cmd);
                armpmu->start(armpmu);
                break;
        default: