diff options
author | Robin Murphy <robin.murphy@arm.com> | 2018-05-14 09:34:52 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-05-21 13:12:53 -0400 |
commit | 28c01dc9d85e4cd744f254c45d3c894bca168ed6 (patch) | |
tree | a91e9031e6abce0166d3a2d43cdaf9855312b160 /drivers | |
parent | 75dc344145190bf53aed7a28dbc27c11180d94e5 (diff) |
perf/arm-cci: Remove pointless PMU disabling
The CCI PMU driver bears some legacy remnants of the arm_pmu framework
from when it was split in c6f85cb4305b ("bus: cci: move away from
arm_pmu framework"). In particular this perf_pmu_{dis,en}able() dance
around pmu->add which was fixed for arm_pmu in a9e469d1c89b
("drivers/perf: arm_pmu: remove pointless PMU disabling").
For the exact same reasons (i.e. perf core already does this around the
call anyway), give cci_pmu_add() the exact same change, which also
prevents having to export those core functions to build it as a module.
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/perf/arm-cci.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c index 7d916dc2214d..33b47c292d79 100644 --- a/drivers/perf/arm-cci.c +++ b/drivers/perf/arm-cci.c | |||
@@ -1184,16 +1184,11 @@ static int cci_pmu_add(struct perf_event *event, int flags) | |||
1184 | struct cci_pmu_hw_events *hw_events = &cci_pmu->hw_events; | 1184 | struct cci_pmu_hw_events *hw_events = &cci_pmu->hw_events; |
1185 | struct hw_perf_event *hwc = &event->hw; | 1185 | struct hw_perf_event *hwc = &event->hw; |
1186 | int idx; | 1186 | int idx; |
1187 | int err = 0; | ||
1188 | |||
1189 | perf_pmu_disable(event->pmu); | ||
1190 | 1187 | ||
1191 | /* If we don't have a space for the counter then finish early. */ | 1188 | /* If we don't have a space for the counter then finish early. */ |
1192 | idx = pmu_get_event_idx(hw_events, event); | 1189 | idx = pmu_get_event_idx(hw_events, event); |
1193 | if (idx < 0) { | 1190 | if (idx < 0) |
1194 | err = idx; | 1191 | return idx; |
1195 | goto out; | ||
1196 | } | ||
1197 | 1192 | ||
1198 | event->hw.idx = idx; | 1193 | event->hw.idx = idx; |
1199 | hw_events->events[idx] = event; | 1194 | hw_events->events[idx] = event; |
@@ -1205,9 +1200,7 @@ static int cci_pmu_add(struct perf_event *event, int flags) | |||
1205 | /* Propagate our changes to the userspace mapping. */ | 1200 | /* Propagate our changes to the userspace mapping. */ |
1206 | perf_event_update_userpage(event); | 1201 | perf_event_update_userpage(event); |
1207 | 1202 | ||
1208 | out: | 1203 | return 0; |
1209 | perf_pmu_enable(event->pmu); | ||
1210 | return err; | ||
1211 | } | 1204 | } |
1212 | 1205 | ||
1213 | static void cci_pmu_del(struct perf_event *event, int flags) | 1206 | static void cci_pmu_del(struct perf_event *event, int flags) |