From patchwork Mon Apr 15 06:13:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629444 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 A4BACC4345F for ; Mon, 15 Apr 2024 06:13:48 +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=AHlCw3QuT02Gs7Lldxt2lyKeZZqnEfu9uA//Gkm2FB4=; b=ndbphoH/rduCq0 DMI9SCfVONUFffr0K13Bihk5j5jrcH3ws7v2lrQicaQxsgMDWgpGEZzRajWImmVUE5BMegVfZ5Ye2 148FUTUyaRwfB1D5XzAV9iwQar7uL1qLAWRfn5D0tK7DocU3Dlc887qFxTUAnFMimaz+HmZjtYsZp oyYcnaDc6JQItS7AsYJDlP1fCaaNBohgq+jw2uxDEgpFZ1qEtFA4DwkbFUsfX2yJbe00g14C+eQEj gBzQIsz2FoSzMK3NcHnkg7Ad8m0tzI4ViANM5lTyI/CGQQDpdg1EeWv0txUd5jmPolc5A4GEKGnEw d/4UXN03RDy3Zi7wK5ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFay-000000077Ph-0446; Mon, 15 Apr 2024 06:13:36 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFam-000000077H9-0Fjz for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZOFLaIaf6Q2PvFuzI+1DLRe4xJCHt8GphHV0Up4m/HXHFJIBTHhOlNDexclfgzTw1fGu+cBe1jzTFjZViWBHuRv9wmJNSx/XkVnLdfFc48nsSLDbC0ufIEr3ZhAfXX/X5G0Jr7eBJSFLEh78+K5QttEKEL8pLiYBOWxBT2/yd1FE/tbeUw1EuBdleP5yUjxowCiDi1LHW7DUO61MBzS/r5wtbmwRbgPr6gwGxhuHkJm/sYTHmgmVkY5n062WGGipGVGlMnvCxaYmehm7rX11nCJCD03K5D35uvpIuTN4hwvQ1khJtmWqiZpjXIuso/C9JA09jSDUxrOvGaSIU0JCw== 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=Jf9LqYACnhBC27tNhtlzyMC4brhwEzNKeAmPlcHa2t0=; b=R+b/YGR9P43Sor2ltP6yEUC4AsZ6c649lC4l54SxeeKdceFUfILLI47qSdldBkrjcZkMiqjGrXmzop7YR8p2Cxe0vSvRA96TETL5yRvKmQeZLl8bdslqbgrqmrSLae/yC6wQgZoQS5uTr/lnpXnXAk3VcQttKB6D3zzavC2ydhgP2RYchrOkCJAb4r/3hpGJB0GZLYyH7LhSU/9Y8wUIwoanfh5zYIZJQcEfQ/029ZYdmHh8JoVEiEwoFHg1P1xdpRzLZuoxbt+n4nQ3QeqMKA3eL10xioYyAo1gSHVnBkzb1l6xRCRig/mvmSZlExEwrWp2t7YrTRDj9gjgFDcwJA== 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=Jf9LqYACnhBC27tNhtlzyMC4brhwEzNKeAmPlcHa2t0=; b=Qp7ojtgeX/Zxg2d1n/65tc0xmiYoDNBrTP9sAE8xrcsgTHOk/ayxM+ViV7+8BldM1gpR0UCh3RTGQLJNdUCAFCdFlSAUVpqRJxV+qnnr/z92VRmLUJRXa9dXpD954DFeI0xdnijjPvH/kHQVPlo6rTEtMdiBJY9sBLbx+WYJnKk= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:13:14 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 06:13:14 +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 v10 5/8] perf: imx_perf: fix counter start and config sequence Date: Mon, 15 Apr 2024 14:13:17 +0800 Message-Id: <20240415061320.3948707-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415061320.3948707-1-xu.yang_2@nxp.com> References: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: b0bc4ca4-5bc6-41f9-7ce2-08dc5d1321fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YXXrMacHjHiRfNLUaS/rX6tLyH0EE+pzCyM3SI2dRJFF+qbZ25nCu+7R1hLGaFEynDT0AWvOvbFz9ONvwz6a/Xw3wS1ZMUmuockbODFbmHvbDc22vEU2Ykl2b5Cvg0aCmNsDKmbn8kDwz71DGaZOSe/UBpLkZdp+Tr9yeVWrrDpkT2b4urYjfHPbAWfnQ2HtCi311/F5kxRXKSgHrYAJXUL9pmfQSVii82vW+iIxbEmXo7Zedhtfdtv7k30k1QdThKWRenW1fwMN6hApRYWosB4aFSA/1WdjVEVgPNyRYqRfx4QKAcbe1/RwjER0mCQesyciBxsdWxGAmQsbbiXFAK/3l9Yoe0nMjABZeRutm92nQbOBvz/D7PSTKxLQ035gR5iJeBL4IUQ8p/kQseL1UrMpRFjveTAKrsUe/0xg83W2WhzFuxC03X3CIsh6XcecPclEsEkMdq3TLDJC+TcH3x/+nt5BchekErrX355OkLYDUUib0VLQ2Lu1yfdHhB6zrHDk452GX8ewCj/rYfeplOTypkudUwNaWzEd16m2rjYbjCBmM82KaKlCBmq5UPxWjpdo82AZo7H5n5pOCH24UR3NM/h/RhPP6S52RHND+/57r519xuIYKmzO6Q0xaN2PBcO72Oua8XkNiu0MuCcBxIxcft9dvlXLuMAGem8vTPpXsugOsK7pHjzA1a9IhzaaBbggPZ2d+cEdAf/kjYCwcg4Nn8Q6tTXH9pw2XTZA0CQ= 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)(52116005)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +PIOVpIH8BPpl82MPlHR23qY26nglsO3/xz28XvBJcLrDVrI4xuINw7vEmX2Jyu6qWgq3LeL1f1aNV1rHxz9Av4/MK9xZC3A+2ToiaoJgY5xFkyCaySDFQ2rr0vF4SmrGV3drkGAY0OpBQmV+pGJRIS+nWU1uinHPmNTJG30gO0+m+KD1JWnOhH1VxjIRG6BNkanPAPwJPosanN8wWr5v22oPXesLoA8ABGDmkWWeV74vpLQctUwnKLzwLiXHkhhpxZOmsfxEf10qZ/OcugSjLod+eV4UknzGgwNYMSXEzT4rEcJ/el9xwTzY0VCpoHpwJdV5qLbJ7POFhD1KDgBzPsgwuImLTjttFn7cnt47ctwqDD8AZvY+iU9v/oBCYIc0HWOwcjHYy/iVmLsGjDOHO/yfVMyWwYFJKI7KzcHjJg3PYGjBMIRVzD5wWxbzrcpuxEtTBeNj4OpSOZ7wXcq3fQiPIFC+14EdCyeeyVl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ZsPwJ9dxJw5bMJZN+M8lX/EP++G X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0bc4ca4-5bc6-41f9-7ce2-08dc5d1321fd X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:13:14.1051 (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: Pzxq7IRI/wiFEqFqn9RMj1JIt7LFFbozl+jc5d1j5BZoDFXbwPlsWLRf2tk/zrUNJ8eKSpEzxMb6VJOrTsgeSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231324_116155_F1EB60DF X-CRM114-Status: GOOD ( 13.33 ) 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. Reviewed-by: Frank Li Fixes: 55691f99d417 ("drivers/perf: imx_ddr: Add support for NXP i.MX9 SoC DDRC PMU driver") cc: Signed-off-by: Xu Yang --- Changes in v5: - new patch Changes in v6: - no changes Changes in v7: - no changes Changes in v8: - add fix tag Changes in v9: - add Rb tag Changes in v10: - 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 dffe7c1e4809..53cb2842956d 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; }