From patchwork Mon Apr 15 02:03: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: 13629383 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 24A3FC001CC for ; Mon, 15 Apr 2024 02:04:12 +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=SnpxLm0xLXAGo+NRkEsVjDPHWiuonhII9XCIIg2lXkg=; b=bnO5Z92MUlF/bu mr1R6gRe/oZdcACKmUJ+nEZY6OThdVrbblty9tklPzCp9ap1J1TfQyj3j3aLqoWcVs+ixoxWdNVBU edjdz0jPIxmmnQ/xjwZGug7Fu3aAhFTRz7DQMGSfF38sCnp+mToAuSiR58hXh2u+D2CJeTGWl8A+Z g62DnyX4g68xpc89bP5DDp/yTCwi95t/pKEXSVyikS0WqmmFvpvzTt5jBPKuq46w1nM05XOjwZbN5 7VPDAJ3EfyX0hy/CphSJReDD31YemQA9OhxTLbn3Qkx3xNbqA/8nNAECDAJ0LrREcOCxEo1liLrIr +30KJFkg/J1AydUQyUuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhT-00000006jfQ-0ppJ; Mon, 15 Apr 2024 02:04:03 +0000 Received: from mail-am7eur03on20600.outbound.protection.outlook.com ([2a01:111:f403:260e::600] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhH-00000006jTq-2677 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:03:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWY/WkBUDKpVDPohFWhlB8Ku4h8muccIUPLYWjn5ZJY2C8JvJDTJvr1y92YKR+XGGCscvYI6NT1PnDDXBQ0nw0y6cIB5EhTCSoCiLXoUu55NI/5/EU9hM7sSZE7/DDp9bO8OkZ+gpti/N7h8bGQ+4U4cnGTfFuKqv+IHrj+1yR6f1r0r1AxSsH2Ysm9yENKZ3pAhI2MXihy/XEpdjJYJ1yiBds4j29j158D+rShwk6cWOKTG5mhLh+a6AK4xtVoMxMtfjzMyPyP6DgCCkmFnVdHtIH2Yokqm+Q4V9GPk8c7qVgJKwpFI5LNn2kLtRKQVsSTPR4X7719wN2hExDwNqw== 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=7LQjDYvdW8tQc+jXTDbv8bKHhC/ea4zn9nLCLe+HWKw=; b=lcoloV1rLSAzC9CKdNCXDsN7Ibs047DN8d6izLos7PpgkSA8FYEPt6iAA+La2C0ThRhadVSD2E2tbhZbL+hv2olzafSsOXJiBaYRuanooNuQhoMQB1rlTefiwK5yEqCzVCf2RJzgwevLdVXW7sU7bs+4BxRTsQMWpN1Ytx9O7srY2ZWujxuRwhETpjnGtZMGyeYGYS2ElxSdqdkxM+MExh6jHxx/hcdIiyXRrl8jC8kO1iS0saKH7IMSEy2LdnrMMT9HIsJa5sZlzdtmRv2VqQyg0qbumnmyi6I0yLssahWDtsxdPibfxcPYgsG60wxFdh3h/xOKgfmPikv3LUsPeg== 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=7LQjDYvdW8tQc+jXTDbv8bKHhC/ea4zn9nLCLe+HWKw=; b=NsbM2cPiryFVAp+UliP1hJNke0S0YwSNauS5rzuyxEjETqouwNQ90AxYVqFmMCymK5QrKj9Xz0orfOYOOj207TEpDSKZFHP1vk2unWqDNh9mHiNQqG+1+S0a1yCZ9R1T7RFFIKFSnrdqgZcOiTs8aymfFAGoYNHGV9/Rc0HMqTM= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:03:48 +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 02:03:48 +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 v9 5/8] perf: imx_perf: fix counter start and config sequence Date: Mon, 15 Apr 2024 10:03:50 +0800 Message-Id: <20240415020353.3833367-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415020353.3833367-1-xu.yang_2@nxp.com> References: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: 5524b646-2fb5-4ba0-362e-08dc5cf04a1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LxXvVv6zrJEJ7d1HzU+OGRK8SCj+gKOtFyDbuXx1NHkWdcyAPOkWLj5SknXIDPulBY8NaJWClQyLp5ZXVaIxbfXce68w6PuF6LsXLPD3/BF/7yBlqnj4Ct/QQ2uwHSFSY3vIuNuWeGK7ExpJbYuVZJGrHdXfUsgTQRjJCam56iCL7qbhzk1IiPtYvmkqXPpgfthqSB1sqJ95WekB4H/vvpsdLOEkQukZer336TE9mGh0S7nNyd4Of/Sod74YNYeVyWoCUIR3D6KGXfyPy0Or1PcCSd367e253hPM/Rc7gjxjsHWGZZ0HaLKJr9ODtvJWQy4E4QVfPE+NE8QCXSSuYoZ539remhvcp2x1KEAJ2RrpLG9RPI7zEwNZEJJ7iXwnXG3kGiy2703sgCYB7AtI2BUiT4/BC94IuIv+mHrnXQEc5VoQkvnF+wZRG2kmHsMdZnnOX/1VM9x4ejMS+ONKiQ3SuRatERm0G4jP+4Dis8n4JPN4oWTHslRg62Olzb9h9IggDOULq67ryDFw7LudnSAKwytsjR/8Q7eUShSLfBZsXO5WJOCFpUJDk9y2r+7JVP9K3eauwBJbpyeRo1Se7fOG+iveg8EEryJgZy0Pap3X36xlEBBgReBfknIb/4MS+OQpToNXU9EvNRrlZU0a9TZfsiMsiClVCgu5Y3bFZ6zM9lY+KJMRO5SV1l8NGXfZ4m0HdDbOM9MvyGvNL9h20Nj0SddL9y8qvzBJNoVU/m4= 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)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DnXQ3rt0ZOQye9Sq2TyC2EnU0yhN4+GkDmdNgU7NVtQIjeg/jwf4rK/ITHCLbKka9IKQmBJCeJ8CQiPe6EjjyFtjn5/LNeNLnELEKKCBZeJjMH6jC8iA5jpDJHJVl2uzt15aY7U8+8BugSny3dObb7ptfwKYjqj8mQIKQMoje5aFnJh8zR/QWqZVGKPkG3+hpsUrYyd9mrgGUIguoQVr+c/Qu4FeVGgwstwUvgogRn1ER3KMrDgV2BPoNFH/nNW9Ag3KYi0e5o8ssLnDDGG5ugZgNazz9c8b/mLh5cywhBz2BlEZUCpllldwOoJuMH+K4qcskxdPFYsDoxgCz3efdYKmJ4imwgdklLw/FL/gxNYa0Fxz0wPQwkattMzq6IS4HkoAeVZdBKqXWpPwBdG1OiV/yxQzy5lm3AVIaayGkLodyi1H1P2+z8BEUS0+ZkSSeyFoX5XODNAaH4hay6tRzey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OGtTxK4U9SUpWKaVvkqJaj+A+AHREmqcok71PM9DmRGj X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5524b646-2fb5-4ba0-362e-08dc5cf04a1f X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:03:48.8327 (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: qv2BbXaKwrZABlYPQdvduDxbrI8zD7Rbc2VniR1vyQUnxEng4M+H4zx6sOsdfvxWqzsr97+4T8H8POWgARj4jA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190351_632995_85AA0800 X-CRM114-Status: GOOD ( 12.94 ) 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 --- 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 1510502862fe..910fda7eb2c6 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; }