summaryrefslogtreecommitdiff
path: root/drivers/perf
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2021-12-03 14:44:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 13:03:36 +0300
commitf99f6ea71b55a09d344be9fb1d71a92560d6cb7b (patch)
tree7e35afbb1912b1dcb81c84adab8f8a707bcd66f9 /drivers/perf
parent70bf180fef8374e009b3d2164ab4fa3880330d5a (diff)
downloadlinux-f99f6ea71b55a09d344be9fb1d71a92560d6cb7b.tar.xz
perf/arm-cmn: Fix CPU hotplug unregistration
[ Upstream commit 56c7c6eaf3eb8ac1ec40d56096c0f2b27250da5f ] Attempting to migrate the PMU context after we've unregistered the PMU device, or especially if we never successfully registered it in the first place, is a woefully bad idea. It's also fundamentally pointless anyway. Make sure to unregister an instance from the hotplug handler *without* invoking the teardown callback. Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver") Signed-off-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/2c221d745544774e4b07583b65b5d4d94f7e0fe4.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/perf')
-rw-r--r--drivers/perf/arm-cmn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index bc3cba5f8c5d..400eb7f579dc 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -1561,7 +1561,8 @@ static int arm_cmn_probe(struct platform_device *pdev)
err = perf_pmu_register(&cmn->pmu, name, -1);
if (err)
- cpuhp_state_remove_instance(arm_cmn_hp_state, &cmn->cpuhp_node);
+ cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node);
+
return err;
}
@@ -1572,7 +1573,7 @@ static int arm_cmn_remove(struct platform_device *pdev)
writel_relaxed(0, cmn->dtc[0].base + CMN_DT_DTC_CTL);
perf_pmu_unregister(&cmn->pmu);
- cpuhp_state_remove_instance(arm_cmn_hp_state, &cmn->cpuhp_node);
+ cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node);
return 0;
}