Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2432550rdb; Tue, 12 Sep 2023 01:21:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdCde686TW4oWWxao7siXmA30qATm5DrHoClYDJGXQzcNDD+hCxcJtzbcU5RFieaUiYG47 X-Received: by 2002:a05:6a20:748d:b0:140:d536:d428 with SMTP id p13-20020a056a20748d00b00140d536d428mr10966228pzd.51.1694506887552; Tue, 12 Sep 2023 01:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694506887; cv=none; d=google.com; s=arc-20160816; b=x/8FPo7tG8HHLzQAd3AJcBEAEDs0ODOze7YdMrEJBY64XcV8hafeX7P1GW/QLm4rn9 Nt6eKJnYk1bIVfmsCSKL1wvQ+M18iRkTSmzEkc4jAWKzYKU16gflUch5aONNL4x5Qnb0 AtyR3Jta7hUz0/pKxTEg64GqYjIoPmmJGftAkvrlpN4V+EgFthBzS1V7n+RL/Lm0xo3b MRnmqMx4zk7/nRLtbzIe3JMiG5wef28ApyhtJhsIjfrGSuxWPmMWX3h0f2lMJwLlFEEd vB9dQXSs2S/f6L/whFetAYYjXa2Ivzy8CUSksihCP6WK2iboBme5sT+vzxamSdBGV+NZ UyjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=npcQ+Mf8x+VKKY6cTy/ApVc5yCRBrLje7C28Ko6xeDg=; fh=7vQaPUYOPmkgAFJKFum77uu2hiHS/pbrLNNtkTcQyMw=; b=H0bgisxETiushhXEChz5B9htQYmhShPbMbEoHds0whgfTUJVEmbou8kJcMbfzKxAw0 T9SraPUX9yVPVVcvsLCgp/1KTB9RtrFTQkOCTs5j45ltDkEmgkWywbtH8Eb+wy5BrhH5 bhrvHUQ+I6fcN+78xnyrujb4n9Ifd0ALaSyo/JdVx6/sudF5SHHM8+5aSe1TVa7AYLas Ivf5yWqBAGhDsIueoKjJGrav/jBjnehVEmelL3V7bw39m8YY/5vrvphndMIW/FhY6nNL sJ+I7bb7jav5qnFaP+Eq2u1uCtrHu+AGBF7JpexZfyJQDbK3VGMZ2+s+SdDgfY9mQLML mKvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id fc18-20020a056a002e1200b0068e29634d9fsi4922628pfb.235.2023.09.12.01.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:21:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EC8728380FD3; Tue, 12 Sep 2023 01:08:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232226AbjILIIh (ORCPT + 99 others); Tue, 12 Sep 2023 04:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232073AbjILIIN (ORCPT ); Tue, 12 Sep 2023 04:08:13 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E52310D8 for ; Tue, 12 Sep 2023 01:08:09 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8C625C15; Tue, 12 Sep 2023 01:08:45 -0700 (PDT) Received: from [10.57.31.51] (unknown [10.57.31.51]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7BD663F738; Tue, 12 Sep 2023 01:08:07 -0700 (PDT) Message-ID: Date: Tue, 12 Sep 2023 09:08:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH] perf/arm-cmn: Fix CMN_DTM_UNIT_INFO offset in CMN700 Content-Language: en-GB To: "guojinhui.liam" , will@kernel.org, mark.rutland@arm.com Cc: lizefan.x@bytedance.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230912040309.1789-1-guojinhui.liam@bytedance.com> From: Robin Murphy In-Reply-To: <20230912040309.1789-1-guojinhui.liam@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Sep 2023 01:08:46 -0700 (PDT) X-Spam-Status: No, score=-2.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email On 2023-09-12 05:03, guojinhui.liam wrote: > The por_dtm_unit_info's offest is 0x0960 in CMN700 according to > the CMN700 spec. > > CMN700 spec link: > https://developer.arm.com/documentation/102308/0302/?lang=en > por_dtm_unit_info can be found in section [4.3.13.10 por_dtm_unit_info]. > > Signed-off-by: guojinhui.liam > --- > drivers/perf/arm-cmn.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c > index 913dc04b3a40..6f3fafee0ac9 100644 > --- a/drivers/perf/arm-cmn.c > +++ b/drivers/perf/arm-cmn.c > @@ -113,6 +113,7 @@ > #define CMN_DTM_PMEVCNTSR 0x240 > > #define CMN_DTM_UNIT_INFO 0x0910 > +#define CMN700_DTM_UNIT_INFO 0x0960 > > #define CMN_DTM_NUM_COUNTERS 4 > /* Want more local counters? Why not replicate the whole DTM! Ugh... */ > @@ -2247,6 +2248,8 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset) > > if (cmn->part == PART_CMN600) > xp->dtc = 0xf; > + else if (cmn->part == PART_CMN700) > + xp->dtc = 1 << readl_relaxed(xp_region + CMN700_DTM_UNIT_INFO); I'd prefer to fix this more thoroughly, since there are still potential issues with this code as-is. I already have that patch written[1], however it ended up spawning a couple more patches to revisit actually making meaningful use of the DTC domain information[2], which I've still been debugging, but I hope to post the whole series soon. Thanks, Robin. [1] https://gitlab.arm.com/linux-arm/linux-rm/-/commit/e4216d99eed2cd951fc515f06ccf31672fb3f58d [2] https://gitlab.arm.com/linux-arm/linux-rm/-/commits/cmn-dev?ref_type=heads > else > xp->dtc = 1 << readl_relaxed(xp_region + CMN_DTM_UNIT_INFO); >