diff options
| author | Xu Yang <[email protected]> | 2024-05-29 08:03:55 +0000 |
|---|---|---|
| committer | Will Deacon <[email protected]> | 2024-07-01 14:42:59 +0000 |
| commit | ac9aa295f7a89d38656739628796f086f0b160e2 (patch) | |
| tree | 87e10838f0baa8d0532eb5fcd236ca4c1bd84f15 /drivers/perf/fsl_imx9_ddr_perf.c | |
| parent | perf: imx_perf: refactor driver for imx93 (diff) | |
| download | kernel-ac9aa295f7a89d38656739628796f086f0b160e2.tar.gz kernel-ac9aa295f7a89d38656739628796f086f0b160e2.zip | |
perf: imx_perf: fix counter start and config sequence
In current driver, the counter will start firstly and then be configured.
This sequence is not correct for AXI filter events since the correct
AXI_MASK and AXI_ID are not set yet. Then the results may be inaccurate.
Reviewed-by: Frank Li <[email protected]>
Fixes: 55691f99d417 ("drivers/perf: imx_ddr: Add support for NXP i.MX9 SoC DDRC PMU driver")
cc: [email protected]
Signed-off-by: Xu Yang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
Diffstat (limited to 'drivers/perf/fsl_imx9_ddr_perf.c')
| -rw-r--r-- | drivers/perf/fsl_imx9_ddr_perf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 5433c52a9872..7b43b54920da 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -541,12 +541,12 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) hwc->idx = counter; hwc->state |= PERF_HES_STOPPED; - if (flags & PERF_EF_START) - ddr_perf_event_start(event, flags); - /* read trans, write trans, read beat */ imx93_ddr_perf_monitor_config(pmu, event_id, counter, cfg1, cfg2); + if (flags & PERF_EF_START) + ddr_perf_event_start(event, flags); + return 0; } |
