From mboxrd@z Thu Jan 1 00:00:00 1970 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 E24C4E7717D for ; Wed, 11 Dec 2024 05:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To: Content-Type:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cpzp/90CPQpudCDxYLJrLS3ijqZAQaydAz5hFjliG2I=; b=SESnOEf62mytPl849R56wx9b4E XNoKf9lnco/Wb/jCLxfXTWtO15n3hStltX48WgF2Q+4mRy3onwNFhZMYsg3QN8qocYAQ2sZ7jhTi1 I9Zz6aHdEvw/mVaIK7lAJxDXqeNzR4gxA/8E0ttcJEEoIvi/Q8o9fdKl+SmvZhCbygPvqlZhJHcN4 bzBeIgEqZ6T3bGVB9+DFj35YD1jK8MmgLaSpUAccf4LHeCgmkBQ82l6fCs/jWdGbs7oCaolpBXS/D h4HeqpLNjQWkUs40ug7v659m17e4xJL8ttPBpogUhac6xHvJ6r0lQW6lMg+FUMXiXRtS7BrX2sFy0 pRD+ZrbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLFRO-0000000Dr9h-0Tdg; Wed, 11 Dec 2024 05:39:18 +0000 Received: from mail-vi1eur05on2060e.outbound.protection.outlook.com ([2a01:111:f403:2613::60e] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLFQK-0000000Dr6m-19Qg for linux-arm-kernel@lists.infradead.org; Wed, 11 Dec 2024 05:38:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W9wlMZ44HmYhSdINMAa1qA4tCn04I6kdmsd70BmhvrckspYkohQcD4Ly/tEuHWKezS+yJUGSXHEtsrtPxiVI+y6/70+gdFy2GfTLiD6A39VQCPIThoD8sR9fV4P27K87J+wWenNEAkL4jipjySBYvu9pqPUyEtha62pwBwMJTKwaNAT18dd1+pScwpQmbuNQi1jG2o84X01Xwo0ri5ZqR3JMJB5y4iNKYyTYd4IYzPwOc97ItXsWTbbjPIfj70LhSs6+N3mVusfyF+kn7irLkolgStPLtNqIzPXOUlY28yJLF8cVCPEgHQU4lHe2i/bNPQVB997XfsLsIDqc6jru1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=cpzp/90CPQpudCDxYLJrLS3ijqZAQaydAz5hFjliG2I=; b=dnGqcMraqiZ5IK4jX6NYh4sSfpMos07VAQCkEXqR3zP2gAs3z+i1BaT6+8joAHim273y+zjfezV7YIpwGKcgd/y4KWEh1HYqFeO12VzvxFh8lltchGULRN2uAwabcMnLNCpUp8oq7aveqjQGOibBD52qGRgM4pgs5FQjvwVkHz1rMH1A0HxhnfJZ20xK8uvIChxdIS8IV/oh4S8byZwO+MAks/Zbb+5ViV3pjFlZZMyWLsmsT30B3G6soRgVDz2fuk9xdAMvzPZ0CP/hO9O+QsKp3A/iTmKQSy0N6zDTIWLvtUVj/zXX0OFVmPw4HqxEQIpWpKqB/oIQnbSwghz+bQ== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cpzp/90CPQpudCDxYLJrLS3ijqZAQaydAz5hFjliG2I=; b=hvt83H/+Dyy00nkDEru5gSXqlsqFPphM9AkVoEZaJz/rU+faLLpLdmdh4JZoGCxyPiKaUruGS4OqZ6A2IeH2BxflmgYg2N54Xj6VYIbf7RC0v8ieOBYjVzLR9yrpnqSWe/jCCtweGFNmIJZKO0oDUV6YxwESGlfLoOkVpgs8BSClW+XZZnyuaoA3BjrCn9yvz9iuEk+PLoZpax7LAuvY7pWjyaA/OACM90ttOMqNxkkZQkpOlJ1uzJ+axZFGKGIwMMUumhJdDrxIeE8GeRCtZ2EgJjF4S7iBMiSUaG4JOnorSse/U0i+ZGwDTkBmnpF/DWlhKGl6jLEbZPFcS7PClw== 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 GV1PR04MB10944.eurprd04.prod.outlook.com (2603:10a6:150:210::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Wed, 11 Dec 2024 05:38:00 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%6]) with mapi id 15.20.8230.016; Wed, 11 Dec 2024 05:38:00 +0000 Date: Wed, 11 Dec 2024 13:35:16 +0800 From: Xu Yang To: Will Deacon Cc: Frank.li@nxp.com, mark.rutland@arm.com, shawnguo@kernel.org, kernel@pengutronix.de, festevam@gmail.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev Subject: Re: [PATCH v2] perf: imx9_perf: Introduce AXI filter version to refactor the driver and better extension Message-ID: <20241211053455.z5zzawfacpyv2dlt@hippo> References: <20241125104338.2433339-1-xu.yang_2@nxp.com> <20241209154419.GB12428@willie-the-truck> <20241210020212.yz3xowvdk27zmgsl@hippo> <20241210133732.GA15607@willie-the-truck> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241210133732.GA15607@willie-the-truck> X-ClientProxiedBy: AM0PR04CA0040.eurprd04.prod.outlook.com (2603:10a6:208:1::17) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|GV1PR04MB10944:EE_ X-MS-Office365-Filtering-Correlation-Id: 92d0e675-1d97-4f73-5b10-08dd19a5f96b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?T3KXeV2PiRBFkJKN4+0nheNfIL8sa+OKXTXVvHUoG6bis7PTAOhmxh+38B/J?= =?us-ascii?Q?NJcBXIcr5DLMPjFKRvVtaohHI4M8J/fqzeRvMyZQvjvqLgyMlt30j8rWe5Qa?= =?us-ascii?Q?t7TF0CAR7rn9XrF/uUBzOdNTeKqmLcHAZIPv7ZgUY4qsco4/Doy0GpPYofsp?= =?us-ascii?Q?470vhw00Mnggi45p0uhl/sUCyCLtvPmGpm70umlDYiDa4GQ+mqVqZzGK5iUf?= =?us-ascii?Q?N8N4IUsXVq1OOgKM3rXRlKq7xEsfH/D9CsfWEhY/plPD7a2fUWEcFAl2UVmp?= =?us-ascii?Q?LB8jgabuBpFwLtyMgzL5w2JNeMZeMkYpamv8JQDbpc1+Pm3zR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PRYq6o43UzguX27tFdP4VgY10BMA6OsSiZVfH4I?= =?us-ascii?Q?s1Hz+q/r2iQk5GPxqotvgPDCmPvXUJOQrU+qWrfWgxVQPa4HimEYRPTMJJhz?= =?us-ascii?Q?n9fGbuADDL3FzpPUUaG+GvogPRyFL9L9TqpqxS5R67ID4q8rpBpkYYrysQxP?= =?us-ascii?Q?q46Pv3bVd2Erf0YrcTI62yt2ybm2xpDMLNXe7Z3YRnUKOhInuA=3D=3D?= 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:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?d32U6W9YwLIIICKxNm2tKO/hu8JXM0lQhJCLmVPC/yDms+cU95UtvLday6xh?= =?us-ascii?Q?aCuWIeNI+TBzKaberBxbA4Rid2ywhNDulFfT05+u/Io70FI+5aTbFcxGFV/p?= =?us-ascii?Q?Lt1Mn1KfR91kFU7qzXtDWuM8JUy/oaZ8HMX78tDBjMPTArpjei83pC5mOnlg?= =?us-ascii?Q?Baw0P0AeW9YYFnmgFseon6rQXOOCINnXaJjMFvJsdsRrixCJ4oVSQ3XA8OUr?= =?us-ascii?Q?zaPD4OwYEHXIiNFHPuCVF4qPMdFE7CHdmpEXLjCQzpbJrM+Xtq6AdEKok75K?= =?us-ascii?Q?p/cCEWRHNUnxqIaGZbC1AxBN/FCprDaRRu1aF3zXrva8IRqnHabgb2GpTrqX?= =?us-ascii?Q?V5LC8XhoSzkMU3TAPYm/jgLHeDeEUIdGsv9JX5HcvGXVEsduMCP1DQcefbwA?= =?us-ascii?Q?F/N2vjGBFK8CkcjSYBtmJM7BbUyIytO4oBA9TemL7LtozvlSWAT7S+82hJlo?= =?us-asc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vz/FeBVCcJV9Qiv9jw7jZM3?= =?us-ascii?Q?MEOoiWGjspY9nqYirAnpDQv1HG7nA5dzBJK+XFdcDWFwKa0qUfaAGqMo0Jga?= =?us-ascii?Q?jcGpZG45dmjr5WBu/qs37/0yJQIInzkAW7oQ+MW45ZxKh0MxXO3inpKVH80Q?= =?us-ascii?Q?EpxFtqLo7H9Zuvj0ng2X+qb0baQixPXfWJgOikdYK0seLZr8mQgC9CArQhdx?= =?us-ascii?Q?4nT7uJasDK8LNKvrSAyU8kc8DdobiiU2Z9iQfa3l?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92d0e675-1d97-4f73-5b10-08dd19a5f96b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2024 05:38:00.4411 (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: WZexYYfbhXtaiRcE0IR2xhywQSFo8eqiSRCrr9H68iYWpcPhyMIzs73YKuQ5q4rZbinvFF8u9VXHN/2OL/N7CA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10944 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_213812_347742_22DBF400 X-CRM114-Status: GOOD ( 34.64 ) 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 On Tue, Dec 10, 2024 at 01:37:32PM +0000, Will Deacon wrote: > On Tue, Dec 10, 2024 at 10:02:12AM +0800, Xu Yang wrote: > > On Mon, Dec 09, 2024 at 03:44:20PM +0000, Will Deacon wrote: > > > On Mon, Nov 25, 2024 at 06:43:38PM +0800, Xu Yang wrote: > > > > The imx93 is the first supported DDR PMU that supports read transaction, > > > > write transaction and read beats events which corresponding respecitively > > > > to counter 2, 3 and 4. > > > > > > > > However, transaction-based AXI match has low accuracy when get total bits > > > > compared to beats-based. And imx93 doesn't assign AXI_ID to each master. > > > > So axi filter is not used widely on imx93. This could be regards as AXI > > > > filter version 1. > > > > > > > > To improve the AXI filter capability, imx95 supports 1 read beats and 3 > > > > write beats event which corresponding respecitively to counter 2-5. imx95 > > > > also detailed AXI_ID allocation so that most of the master could be count > > > > individually. This could be regards as AXI filter version 2. > > > > > > > > This will introduce AXI filter version to refactor the driver and support > > > > better extension, such as coming imx943. > > > > > > > > Signed-off-by: Xu Yang > > > > > > > > --- > > > > Changes in v2: > > > > - modify subject > > > > - add comments for AXI_FILTER version > > > > - type -> filter_ver > > > > --- > > > > drivers/perf/fsl_imx9_ddr_perf.c | 33 ++++++++++++++++++++++++-------- > > > > 1 file changed, 25 insertions(+), 8 deletions(-) > > [...] > > > > > @@ -624,11 +641,11 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) > > > > hwc->idx = counter; > > > > hwc->state |= PERF_HES_STOPPED; > > > > > > > > - if (is_imx93(pmu)) > > > > + if (axi_filter_v1(pmu)) > > > > /* read trans, write trans, read beat */ > > > > imx93_ddr_perf_monitor_config(pmu, event_id, counter, cfg1, cfg2); > > > > > > Hmm, doesn't this change mean we now enable this for imx91 as well? My > > > reading of the commit message is that imx93 was the first chip which > > > supports this. > > > > Yes, it's enabled for imx91 too. In fact, imx91 is compatible with imx93. > > They use same configuration for axi filter. > > Ok, but my worry is that the above code looks like userspace now _must_ > provide valid values for the config1 (axi_id) and config2 (axi_mask) > fields on imx91, whereas before I think they were ignored by the driver. > > In fact, without this change, how were the PMCFGn registers configured > on imx91? It looks to me like they were left uninitialised... Before this change, PMCFGn registers are indeed not configured on imx91. However, they should be configured as imx93. I notice this thing when make this patch. First thing I tried is to add is_imx91(), then check it and is_imx93() by "||" operator. However, this way seems not scalable as more imx9x Soc comes out. Basically, AXI filter version will keep at V2 unless big changes due to new features. However, perf tool need export correct MetricName via identifier in sysfs. So I made this patch, then PMCFGn will be configured based on axi filter version rather than pmu name. Thanks, Xu Yang > > Will