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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8F45C433EF for ; Fri, 8 Oct 2021 08:23:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7D0CA61040 for ; Fri, 8 Oct 2021 08:23:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7D0CA61040 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5XtnfqhpFu9iwBTaVHM9uE8PgRddVCmeEoRzYQOKv44=; b=wtnLRmwu7dcD2X UmSAV9DwnOnGBiz1gDWbS2hmchM8GR6OQcwcd5YZ8vabFuNqRx0hPIeozUVszH/jG0C1u8y5m3hR2 bitwsfJ9EubdXGli6tlAvVv8m/bWJmr214Y800CTbqgptesXZvTdA6D4VIx9xpgdFQM0ZzreKVpOn JeoaEfB48DWmgMn12AorD+MdPnICeZ0n6BOPwCjyPmfSAL08EAHPP3QOc/hfNWW+4SwP4ZmisF3lI JFfPO8zQrZdqmNFbC9b4iNWHKC6a7MIpTNxyDQXZF5aI+vQ4dPJHeMoBMV99LBIqS90y1GlVW1Ykd LLniRaIGvt2mAR9yw1Xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYl8c-00211t-Rn; Fri, 08 Oct 2021 08:21:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYl8Y-002118-99; Fri, 08 Oct 2021 08:21:51 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F389C60F4A; Fri, 8 Oct 2021 08:21:49 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mYl8V-00FUTk-Uh; Fri, 08 Oct 2021 09:21:48 +0100 Date: Fri, 08 Oct 2021 09:21:47 +0100 Message-ID: <8735pcq63o.wl-maz@kernel.org> From: Marc Zyngier To: Ehsan Aghapour Cc: linux-amlogic@lists.infradead.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: Enable "PMU" counters for Khadas VIM3 in the Google AOSP kernel In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: aghapour.ehsan17@gmail.com, linux-amlogic@lists.infradead.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_012150_362110_5A9C0B68 X-CRM114-Status: GOOD ( 22.49 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 07 Oct 2021 23:13:30 +0100, Ehsan Aghapour wrote: > > I am working on Google AOSP kernel and require to enable PMU. PMU is > working well in Khadas kernel for both A53 and A73 cores but it is not > enabled in Google AOSP kernel 5.4. I try adding arm_pmu definition in > device tree at /arch/arm64/boot/dts/amlogic/meson-g12b.dtsi as follow: > arm_pmu { > compatible = "arm,armv8-pmuv3"; > clusterb-enabled; > interrupts = , > ; > reg = <0x0 0xff634680 0x0 0x4>, > <0x0 0xff6347c0 0x0 0x04>; > cpumasks = <0x3 0x3C>; > /* default 10ms */ > relax-timer-ns = <10000000>; > /* default 10000us */ > max-wait-cnt = <10000>; Most of these properties don't exist in the binding, and are thus ignored by the driver. > }; > > However in this case I only see A53 performance counters in DS5 Streamline > and performance counters of A73 cores are zero yet. > > Would you please help me solve the problem? (If device tree need change or > kernel config to enable pmu counters for both CPUs). The problem is that all the Amlogic SoCs have a totally broken PMU integration. They OR'd all the PMU interrupts from the CPUs inside a cluster, which is why you end-up with only two interrupts in a system that should have 6. There is no good workaround for this. The downstream kernel may have all sort of hacks to cope with the brokenness, but upstream will simply not work. I have my own set of hacks to deal with the PMU on the A55-based version of that SoC[1], but there is no way this is going upstream. Thanks, M. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=hack/vim3l-crap&id=6bde69695241344ddf7f74880314a0c6cbdaf963 -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel