From: Thomas Richter Date: Thu, 29 Apr 2021 13:04:30 +0000 (+0200) Subject: s390/cpumf: remove WARN_ON_ONCE in counter start handler X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=15e5b53ff4c92c8ea79094871f91d077bfc60526;p=linux.git s390/cpumf: remove WARN_ON_ONCE in counter start handler Remove some WARN_ON_ONCE() warnings when a counter is started. Each counter is installed function calls event_sched_in() --> cpumf_pmu_add(..., PERF_EF_START). This is done after the event has been created using perf_pmu_event_init() which verifies the counter is valid. Member hwc->config must be valid at this point. Function cpumf_pmu_start(..., PERF_EF_RELOAD) is called from function cpumf_pmu_add() for counter events. All other invocations of cpumf_pmu_start(..., PERF_EF_RELOAD) are from the performance subsystem for sampling events. Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Signed-off-by: Vasily Gorbik --- diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 91ee0f399aae4..1b7a0525fbedc 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -362,15 +362,9 @@ static void cpumf_pmu_start(struct perf_event *event, int flags) struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events); struct hw_perf_event *hwc = &event->hw; - if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED))) + if (!(hwc->state & PERF_HES_STOPPED)) return; - if (WARN_ON_ONCE(hwc->config == -1)) - return; - - if (flags & PERF_EF_RELOAD) - WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE)); - hwc->state = 0; /* (Re-)enable and activate the counter set */