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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88BFCC433FE for ; Wed, 19 Oct 2022 10:16:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231470AbiJSKP5 (ORCPT ); Wed, 19 Oct 2022 06:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232148AbiJSKO7 (ORCPT ); Wed, 19 Oct 2022 06:14:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A28F6786FD for ; Wed, 19 Oct 2022 02:56:28 -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 6D1C91063; Wed, 19 Oct 2022 02:28:56 -0700 (PDT) Received: from [10.57.68.61] (unknown [10.57.68.61]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D7D653F7D8; Wed, 19 Oct 2022 02:28:48 -0700 (PDT) Message-ID: Date: Wed, 19 Oct 2022 10:28:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [Question] Question about supporting sysreg only CoreSight ETMv4.4 on ACPI machines To: "Russell King (Oracle)" Cc: Xiongfeng Wang , yehaiyang2@hisilicon.com, wanghuiqiang , Linux Kernel Mailing List , "linux-arm-kernel@lists.infradead.org" , mark.rutland@arm.com, Catalin Marinas , Anshuman Khandual References: <6e85db13-a65f-d4c6-1b6b-660a94cb7060@huawei.com> <9fc5ab20-c7f0-a917-4938-403e3661109f@arm.com> From: Suzuki K Poulose In-Reply-To: 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 Hi Russell On 19/10/2022 09:46, Russell King (Oracle) wrote: > On Tue, Oct 18, 2022 at 10:18:08AM +0100, Suzuki Kuruppassery Poulose wrote: >> That is true. Unfortunately, supporting this requires us to move away from >> the AMBA framework (at least) for ETM4x devices. This is currently >> developed by Anshuman. We can share it as soon as this is complete. > > Can we not find a way to create AMBA devices from ACPI? > There is a way today and that is how the AMBA devices (including ETMv4) work. But, the problem is ETM with system register access are not AMBA devices. On a DT based system, they have different compatible and are created as platform devices. But on ACPI, there is a single HID (which makes sense, because they both are ETM devices). Now, if the instance has memory resource, we need to use the AMBA hook, but otherwise fall back to the platform device driver. And this is not reliable, depending on which driver gets to the scan hook first. Also, another reason behind moving away from AMBA, in general is: we need to explicitly add PIDs of all new CPU ETMs to the driver to be able to probe them successfully. This doesn't work very well for older kernels running on newer platforms. Even now the list of PIDs is not complete and that would go on forever. And the "party bag" of this change is the runtime power managment on ACPI platforms, that works out of the box for platform devices. Thanks Suzuki