From patchwork Thu Mar 7 02:47:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13584989 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 4E029C5475B for ; Thu, 7 Mar 2024 02:48:38 +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=bJPIjaCCV48OJlBAkRLtUkoi8pb/YUKFCnjMjCD6cco=; b=XDrSIaUKRL7CGq +gfOlL8MW0F4SlDOApHGx6fVdwyq0pVsq8bfeG8jMDrZ9+JzLyA3yhBy1qohaJqtSfKx+EXS+KoSI xOibU/aZtEW6YBco1CFWZMst2x8QfPUUPG/I/as+wPmEcG1rxBMfaqjn0r70s9YkvCzsOG0ZhpcLM vjmH83+VAXtOdAwWqXCS8hI1iQBi+qA2WT5/Z+i29irx8cTE86gC/oMrT/+nKan6khfyCEnWEfapc zR3oLV4DOUPl5CX40avdXjaPbs7IQeI5Lpew+uN68EaRoEJ17H1cha6Kyoeh4CfBqyV3UVJJWrKq+ 0rkHic67d+aFvBGetKTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ri3nz-00000002i8D-1zFT; Thu, 07 Mar 2024 02:48:23 +0000 Received: from mail-am6eur05on20601.outbound.protection.outlook.com ([2a01:111:f403:2612::601] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ri3nv-00000002i3s-3VnZ for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 02:48:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m+AxlLci8CGK0OcC2uwEKTTwkYwR9WzPx3RNheEcIe5f0MUlAASH6UpZs7NQnpfWImiUBlwjELYHRiqcinDAjON68b/U8w4AGsb619gf/TW5MFVkJcBDHJPpEjsHrK2vYXxISkeqsaPUjFyKQGruPEcFOqcXRhvnO7I/NuMRRH4Dt2y3HyuXi2MiDxUJBH3lhbUBbF4I0pYcW3Z+Zdrb+/IepS6Xjk3ZTkxBo0ZpQE5ScD/MhXZWqXcPASPJc83B5dSX1lRXYQXJswF+FHfaFDJzovQwD/oUD6T4Zme8V0kVVJGjqnfIhwxdAGRkwWGJ0oCpmacMqdRU880/GvgwQw== 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=xjn0r2xSo029Zmy14r8gIc/JC8/9MJtPMeZbHgmftPE=; b=UOAjj75kuG9/PBtBP2ozZc/jJDAEtHMSATmUc5CphkfTWJX/TAr+IAQQpOJD69Ky4evtyUkkgGNrVIzcbWTAtCyOZD30GDQihMRDVCHnVCigKSKRBtrvZ5IMmWbpxkD6+ee3l7dhwHhfR4SBV1/g/9IVqHw9OmRg0XGXfSjskI8pvZvC1KbOMbqebwSI3qtQTcrgvGYlx7swt2yHxZ5563XqWDHHbJkCZTwLSN/OprFRKcbbtrUHxq5ve/Ghil/kiQREtlnz1yuvGCF5EXln1pjquYhbUyUBwCxS7IwYx+vN4bP4zPbuoTQCQDAgoaG7uBKNgIy+FxpLutpKq8DzTg== 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=xjn0r2xSo029Zmy14r8gIc/JC8/9MJtPMeZbHgmftPE=; b=ntSXa0apI21CtnS9q2Y4MFOGoKaaleI3rG+p+QmYvUOtI1E0AnsZ4dx3QkuzqZCL1dJCxp3tb3KhYij83eQ5S1AMdBAcbDyS9pO6TTwI93Dous/QmBqh4w+YQ86UdMlk+FuOvWYXEWHeqkO/5uw1h88yJeCrwRLVilJTjOAplfs= 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 AS8PR04MB8022.eurprd04.prod.outlook.com (2603:10a6:20b:28a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Thu, 7 Mar 2024 02:48:12 +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.7339.035; Thu, 7 Mar 2024 02:48:12 +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 v5 3/7] perf: imx_perf: fix counter start and config sequence Date: Thu, 7 Mar 2024 10:47:50 +0800 Message-Id: <20240307024754.3469810-3-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307024754.3469810-1-xu.yang_2@nxp.com> References: <20240307024754.3469810-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0037.apcprd02.prod.outlook.com (2603:1096:4:196::8) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS8PR04MB8022:EE_ X-MS-Office365-Filtering-Correlation-Id: 86b8975d-2181-4048-bbff-08dc3e5107ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /DzDqGw8/rblGlA6x8L9sjIkGyqzZaqwuK4n8ejSpZVC4YiSOqb91TJedBBAM/Pq8Qc6p620wnd09Ek50psj4OcTwenuuUUFA1VR0OmL69ktyTaO6Hr9u1lVWp1R6o9Qj/K6TgoF0gOPXvrPKO4W78C+pPa1PtRtQP50KezAiWYDjgDYvRkGp1OfrZH5qIvOyHFFcDmSK9fTBQBw0vRjmNljLT7A5q9BXzVmpTApSeouP6MpYhD0BBHT3QvJQzFAWbdjCjFH7fgo616NJk+WOcoixdmacTpBu5jcUhg78l51hhYLu/m+FJnaxq0Sx7cE57tEIWcuHFSjTrf6EfDdpswyE9bSvWhDsHP7b/nEJslH4IQFL5gPnfqXNeJVEzMwBJnOqswWL9+OecDya2QLEx+X3T1wXLNmSWXIzQBYchD8SJNd9AAhH4QS+VmjKRL9pdQw7kKbmjx3qaIBb3dvPIFZM62dHDt2AVJHkABBE5uWsr7e0hjZfpD38ysZSFU19nCBpayx+n0+8syc2VEK9vmDMjBLl+BBawW4majffW/1Eh6jK6XbpyzJerLRn42QanlUQaulHtZNrZxAoherbAs1RQA0Q1WKj1i6SZ1ON8UTyePOr35y1gdOMKoXHS2pYcz5lW17TCOBebfPCkTxZ1YlRIszJPVlSdK1M9/rQwxdWylI0VdffWMzksp1PvDs9TVKgF3PIuSUaBhq2uY2GfdC1ZzMawJN77SylgEsJOE= 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)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y54yp5D+vL3DLjAvuV24y1RiRqZWnszndQKwHWBd9Zr4ATGjckvNGOuSOcDqAlg7G6aEE1BUUbQ9QvUzvpOVwWfDLU15aguOli0H5tNzqBidZnpPzeFq4dJDvqCQJA2+Gxk54dEtG+iOw3m2D/UxZhArcHHI7lmOpqJIpCSC684mtrrgMGhVHVkzNZ1dhxPctMGBsUVNuKoE45zl4+WSMqsQn29W/fxlyABz1Qfh2vpA6pXFzVT5JuhOFh9xU4iFu6pVV8JSU01cdb0mUmqzFC2qaolGo7ubgl3g5UgDjtHEMQMCR2j57bM+dBm/XW1VUgMX3vzVtIFqcWdpmSW4I0nS0TZ8bdab2ENMt+gSRE48FyTahxjj/eSXxNw2+4lretL1/aIibofCaTwkKqJWClNGynWzujmYXFyerMzh7+ltbT3YNtmcFNfI1DFOTuqPoMGhZd/R4M8i7C5lD0rA4qPYmr2eG7THN3zuZVixEtvy321IWxFZR1hrGc+dMVjtr307B8EvbFGgSFBA4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OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86b8975d-2181-4048-bbff-08dc3e5107ac X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 02:48:12.6513 (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: etX9nxNN738f3Q5fcO2kuyYhfdN1u2Vkiz2SBoKQNXHE0QiuwQoZaLjl+88zA3Vw6Pz49Dz/5mrfxPgj6VnI0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8022 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_184819_905866_8FBC70F4 X-CRM114-Status: GOOD ( 12.34 ) 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 --- 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; }