When the platform-specific pmu->add function returns an error, it may have also changed the event's state. If so, do not override that new state. Signed-off-by: Neil Leeder <nleeder@xxxxxxxxxxxxxx> --- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index c0ded24..95c4cf3d3 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1952,7 +1952,8 @@ event_sched_in(struct perf_event *event, perf_log_itrace_start(event); if (event->pmu->add(event, PERF_EF_START)) { - event->state = PERF_EVENT_STATE_INACTIVE; + if (event->state == PERF_EVENT_STATE_ACTIVE) + event->state = PERF_EVENT_STATE_INACTIVE; event->oncpu = -1; ret = -EAGAIN; goto out; -- Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html