From: Xu Yang <xu.yang_2@nxp.com> To: Frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v5 3/7] perf: imx_perf: fix counter start and config sequence Date: Thu, 7 Mar 2024 10:47:50 +0800 [thread overview] Message-ID: <20240307024754.3469810-3-xu.yang_2@nxp.com> (raw) In-Reply-To: <20240307024754.3469810-1-xu.yang_2@nxp.com> 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. Signed-off-by: Xu Yang <xu.yang_2@nxp.com> --- Changes in v5: - new patch --- drivers/perf/fsl_imx9_ddr_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index f4dca813b174..2cd5bcf1d3d1 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -498,12 +498,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, cfg, cfg1, cfg2); + if (flags & PERF_EF_START) + ddr_perf_event_start(event, flags); + return 0; } -- 2.34.1
WARNING: multiple messages have this Message-ID (diff)
From: Xu Yang <xu.yang_2@nxp.com> To: Frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v5 3/7] perf: imx_perf: fix counter start and config sequence Date: Thu, 7 Mar 2024 10:47:50 +0800 [thread overview] Message-ID: <20240307024754.3469810-3-xu.yang_2@nxp.com> (raw) In-Reply-To: <20240307024754.3469810-1-xu.yang_2@nxp.com> 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. Signed-off-by: Xu Yang <xu.yang_2@nxp.com> --- Changes in v5: - new patch --- drivers/perf/fsl_imx9_ddr_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index f4dca813b174..2cd5bcf1d3d1 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -498,12 +498,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, cfg, cfg1, cfg2); + if (flags & PERF_EF_START) + ddr_perf_event_start(event, flags); + return 0; } -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-07 2:48 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-07 2:47 [PATCH v5 1/7] dt-bindings: perf: fsl-imx-ddr: Add i.MX95 compatible Xu Yang 2024-03-07 2:47 ` Xu Yang 2024-03-07 2:47 ` [PATCH v5 2/7] perf: imx_perf: refactor driver for imx93 Xu Yang 2024-03-07 2:47 ` Xu Yang 2024-03-07 2:47 ` Xu Yang [this message] 2024-03-07 2:47 ` [PATCH v5 3/7] perf: imx_perf: fix counter start and config sequence Xu Yang 2024-03-07 2:47 ` [PATCH v5 4/7] perf: imx_perf: add macro definitions for parsing config attr Xu Yang 2024-03-07 2:47 ` Xu Yang 2024-03-07 2:47 ` [PATCH v5 5/7] perf: imx_perf: add support for i.MX95 platform Xu Yang 2024-03-07 2:47 ` Xu Yang 2024-03-07 3:11 ` Frank Li 2024-03-07 3:11 ` Frank Li 2024-03-07 2:47 ` [PATCH v5 6/7] perf: imx_perf: limit counter ID from user space and optimize counter usage Xu Yang 2024-03-07 2:47 ` Xu Yang 2024-03-07 2:47 ` [PATCH v5 7/7] perf vendor events arm64:: Add i.MX95 DDR Performance Monitor metrics Xu Yang 2024-03-07 2:47 ` Xu Yang
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240307024754.3469810-3-xu.yang_2@nxp.com \ --to=xu.yang_2@nxp.com \ --cc=Frank.li@nxp.com \ --cc=acme@kernel.org \ --cc=adrian.hunter@intel.com \ --cc=alexander.shishkin@linux.intel.com \ --cc=conor+dt@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=festevam@gmail.com \ --cc=imx@lists.linux.dev \ --cc=irogers@google.com \ --cc=john.g.garry@oracle.com \ --cc=jolsa@kernel.org \ --cc=kernel@pengutronix.de \ --cc=krzysztof.kozlowski+dt@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-perf-users@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=mike.leach@linaro.org \ --cc=mingo@redhat.com \ --cc=namhyung@kernel.org \ --cc=peterz@infradead.org \ --cc=robh+dt@kernel.org \ --cc=s.hauer@pengutronix.de \ --cc=shawnguo@kernel.org \ --cc=will@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.