From patchwork Fri Mar 15 09:55:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13593218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49CF3C54E69 for ; Fri, 15 Mar 2024 09:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3SP+2bQFAo9WB6QONaO4pZ0eGKLUXNDeWgsA8DklCbo=; b=1IZNQe4Bq5zC36 T4Qn7j6bRBwLZxflbUsuwCx8n/H1/ONZpw1kt/NvMafpP4uA85SjDXHeGkxYNVRz39t9sPfqqyR8c jPywTTWAzCvzRvQlYNjc4I0Asb9jjlYmSJ9sdtCUFuIwn7ybl6aECF6pVypyN85LbqqBdvqxgGRIn Ai3mcmcjsLtVeEZy8oO2ro/qO3VIGrUKhARdeaIFLinX97JDSfbhmQDxpluaqrnQJnp4BYENprysg zW+gVLr0X3F1x2i79ALPJ3OVzHCoB6QbCRNsWP5N67eR2uoSBZnN+RxzNVT67DOIlqLNKzcre+pAS 4eH8e0PWanQ7ql7FU/CQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rl4IZ-0000000HMaB-1rEZ; Fri, 15 Mar 2024 09:56:23 +0000 Received: from mail-vi1eur05on20600.outbound.protection.outlook.com ([2a01:111:f403:2613::600] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rl4IR-0000000HMUH-0zBn for linux-arm-kernel@lists.infradead.org; Fri, 15 Mar 2024 09:56:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QTX2RGj/bDewt3NzPnqM7IxqnmN9MBAy69gEk4ZHbl/pz9Sts8ushth43jc+l4/xMcdLeorPbYmHXa0zJx6HjlxQLPag66Hw0tuopuQlXACWsS34dPLbvBpcgBRgi6Sf5vnWHhmX86prrDns8Qkp+XBegn8ylseQJBd9S1I3yTD4Tj+0y7r8Ir5CDHWV4Vd8CL2jm2fEvFXR77/L/yWJ9yBsP+Ug9jwrs9BZHfmbORtnBd9+eqe5bBRBYFES7n8rWXiJ2rLyNPUBUUpH0Oaa0Em+e+B+nwvehhnugSD2LuVw8BbLzcREQVtLe2FCrt16H5KxU9S0AOTD1/hL12kZyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yL6RRzoOpjMPWZWxX+J9jbiV3rDuEHCpScBVuM4mkUk=; b=kFdXC+FLqfse8Qjhf3U9IX92E14z7mGnIiD48w0CluRD/xd3vgYVHHpOiED3jm2IWLEXQulp7Z9aDaTPC6odA//yU2LZFKME7H+1ldCR0JHCWtGEkNXYbLb5WHhxuwxjCIQNqQDxpGX500yYGEaL4e8+5s7SkmLnoCJgyLuQdGoYRnQ4mFuzD6mkBUrmsuakY9WxSwbf8W/SdPXATNdXFv8rMjw5Dumg2+LG2RI267bbaujoQNpWHPinpTGPwokAAUvsDUc7MwqgZGL/CEuYpNbhyFpVwCW+ClMY4MgaL51dgWsf4wL8dhxCAn0CnaVtv5gvDWD7DGi6pjl8RBRMBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yL6RRzoOpjMPWZWxX+J9jbiV3rDuEHCpScBVuM4mkUk=; b=jEfyroPDZzd0G3jqC8+lKGdH+CEdVT2znm2OsA6S0T8L36u2w6xlKqpzy6taDnwrQJGl85MeRwbL/u14OmL+IvZPipMnQaK3NluUqK2TBeswGFDE9WVar9F4v8uhJJ+t8apuM9zvouU14l//6SSBEVssZTcDIEch7DVaqa1j+l0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AM8PR04MB7444.eurprd04.prod.outlook.com (2603:10a6:20b:1de::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Fri, 15 Mar 2024 09:56:11 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0%7]) with mapi id 15.20.7386.021; Fri, 15 Mar 2024 09:56:11 +0000 From: Xu Yang 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 v7 5/8] perf: imx_perf: fix counter start and config sequence Date: Fri, 15 Mar 2024 17:55:52 +0800 Message-Id: <20240315095555.2628684-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240315095555.2628684-1-xu.yang_2@nxp.com> References: <20240315095555.2628684-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0029.apcprd02.prod.outlook.com (2603:1096:4:195::6) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AM8PR04MB7444:EE_ X-MS-Office365-Filtering-Correlation-Id: a3dea5f9-a52a-4bee-7f58-08dc44d6249d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QcjS/BJ7eAUCZmbEgGjPdbO9kOJpbeMX/FfVt63vf5NumjMQ1j/gvUapYBkAQ2jw/oh+mVd0Hi25f0r/B8wOMfruXnllVJ+kQZVDdBIiqP6+4Q53MRwRQO3TfO1rHahe691UQxSo1E445FKVEyfAzk16l3pBaKEArcQf+en4pT5/FZoP0IzbvV825vH4m19bdIvqEkhSnJgTX3tmaVjd1ke2obiRLtjtsL9dusUbXRqbrnzMrHCikAJI7sk3FEOdlvzfCAHP8k2snkGuynR8nWoLlNwijdytWHYjM70In+lh684V7UyiNAKxmuHuPsnOPweMsOZnupzE91HgWb6qckDPSOspC+qYeD57GM3uTU40MPfYJKBXzheHioMXYoWH/DLY2LjtjXE0zLPs26Bs9te6wMvOJ8h+ePvgk9bDdC8BQtjgwvvwgYC5zaGnx6XSh/FQa7FL2lvN9th3IqDQtjwgjRneFZFnTshlgMGsn9603vZLrTb9B6vIFqrEWZom227LrVYxLMcfkJSKyrhCcN3xSgs2AQ7lcEiYsdGhe5AdWvMJxm9CqqaK7kDcsgBZ5nrU2fCqc88MbyoW38Cw88iIHM+SwjD3VlR8qxYtFCaLwbmhEfp5TxFit9l1uS7bdCkhwpgwZktwua9iE+rOCOGuQdi7f/SNRGEZuGjpPZa2/FRsOByMUU0f5PVQhV6lT1R0im0bC0dHk21myMuaPwsDu7oU/ATANnrZPNGBs5o= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005)(7416005)(52116005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: or0MEic+zaLUwPBTk9ypcJTEg+jIusZMoTY6cnivkSHfOlll8jWn+SEbzFCVWBzJl3H4Zrh5b8QndPdD00OEBnOwh5e06L+uz8+AtG5FvU6QOIbwoFXVgsD5/tBZN74Zj4b41SxkBxbYsMVE7KFm53AqANtevxSnB0hF4yU5MTH2GdBAsplICZuP3ddpjoZVwXy0Bjb3Kh76166Ak9kJjvpr2Xa+pSGDEEdhVmLbDsU4O7r4/njwj64xAijkGOsoq8ob0RMY9+z9QrWGmEGPIjNdQdLiQBvUgwFbKgneU5T9uRiSl0+9u3qEZ6zmyWqoeLaPA7NVD1vfeCyXEqhQtEF4weRJvNVCCbncDijYIRBs4ZL6OSG/wPA1ptFDnaKf/CMB0QyR+dePS16Iw/5Lh+xcgbsf0eEFmWXQY+4L+SC/j/zV15dcdIALFhLG/l2sK7C7hBVb4ozL/EDLxgftsnWN5UKg30HgCaT9PHrCS1eA8AOjS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GeK4pZYQZZcvsWyJY0188w X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3dea5f9-a52a-4bee-7f58-08dc44d6249d X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 09:56:11.0562 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tDyDUqf9MU9HPj82dB3t8p3B0EbAUSQDOE85hg57FLhjkNj2PbrI5fYhg0ftxrt+LteNQDgzuPPKunRYt0hUpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7444 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240315_025615_368992_93CF5930 X-CRM114-Status: GOOD ( 12.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- Changes in v5: - new patch Changes in v6: - no changes Changes in v7: - no changes --- 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 5537f4e07852..c99c43b214cb 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -523,12 +523,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; }