Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 1 | From 249304c3517a38863c8e45e63d509d01bd67dead Mon Sep 17 00:00:00 2001 |
| 2 | From: Robin Murphy <robin.murphy@arm.com> |
| 3 | Date: Fri, 3 Dec 2021 11:44:50 +0000 |
| 4 | Subject: [PATCH 02/14] perf/arm-cmn: Fix CPU hotplug unregistration |
| 5 | |
| 6 | Attempting to migrate the PMU context after we've unregistered the PMU |
| 7 | device, or especially if we never successfully registered it in the |
| 8 | first place, is a woefully bad idea. It's also fundamentally pointless |
| 9 | anyway. Make sure to unregister an instance from the hotplug handler |
| 10 | *without* invoking the teardown callback. |
| 11 | |
| 12 | Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver") |
| 13 | Signed-off-by: Robin Murphy <robin.murphy@arm.com> |
| 14 | |
| 15 | Upstream-Status: Backport [https://lore.kernel.org/r/2c221d745544774e4b07583b65b5d4d94f7e0fe4.1638530442.git.robin.murphy@arm.com] |
| 16 | Signed-off-by: Rupinderjit Singh <rupinderjit.singh@arm.com> |
| 17 | --- |
| 18 | drivers/perf/arm-cmn.c | 5 +++-- |
| 19 | 1 file changed, 3 insertions(+), 2 deletions(-) |
| 20 | |
| 21 | diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c |
| 22 | index 38fa6f89d0bc..fe7f3e945481 100644 |
| 23 | --- a/drivers/perf/arm-cmn.c |
| 24 | +++ b/drivers/perf/arm-cmn.c |
| 25 | @@ -1561,7 +1561,8 @@ static int arm_cmn_probe(struct platform_device *pdev) |
| 26 | |
| 27 | err = perf_pmu_register(&cmn->pmu, name, -1); |
| 28 | if (err) |
| 29 | - cpuhp_state_remove_instance(arm_cmn_hp_state, &cmn->cpuhp_node); |
| 30 | + cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node); |
| 31 | + |
| 32 | return err; |
| 33 | } |
| 34 | |
| 35 | @@ -1572,7 +1573,7 @@ static int arm_cmn_remove(struct platform_device *pdev) |
| 36 | writel_relaxed(0, cmn->dtc[0].base + CMN_DT_DTC_CTL); |
| 37 | |
| 38 | perf_pmu_unregister(&cmn->pmu); |
| 39 | - cpuhp_state_remove_instance(arm_cmn_hp_state, &cmn->cpuhp_node); |
| 40 | + cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node); |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | -- |
| 45 | 2.25.1 |
| 46 | |