Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2371707rwl; Sun, 26 Mar 2023 22:06:24 -0700 (PDT) X-Google-Smtp-Source: AKy350Yy9wK7vlx4EjNzwkBwwXyx2uu0gyL3/2dTsTVsf0hxvocZ6Icf526u+G3jmu6vvM5zdPep X-Received: by 2002:aa7:8f14:0:b0:628:bf87:54c1 with SMTP id x20-20020aa78f14000000b00628bf8754c1mr10148695pfr.6.1679893583750; Sun, 26 Mar 2023 22:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679893583; cv=none; d=google.com; s=arc-20160816; b=aI/STXJyiYkLby5OqvClw8TgElCEHyuDAogVLW2dg2G4vOkVBrgJISk/e8woA7MD1S jC0+xqTWB4uGQgjT/laa0tfF+ZsJuh67yl0iZD27EbgswlJA36LVpA9DAM/okNYf/yYZ 5sp3Kxr83pOuBpDW6n01TZxTN3KavnIHnVzkv6mMGHjRQA/OtUoT39Y42dkJltyAXDgp XUqJQ6FoLzW9xjo/kvWWzDEqgpPI2zmBj6/EUQ+LW+JynC9kFuWEePRNkqCRrgeCCi/Y /gCjMj7AfViY+qu+PMjROM+7sOCZNkF2akWHRtU7wPDoCjs+19eLXLNGMAl2pFS0MJd8 wxwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=M6Gs0jfruChBXRVOfZA6xQ+CrGwS+5uRuBv71XCdU0E=; b=qPw//gb/ICM5it95psAOZk+YYQYwo2fSglOU6hW8T3+OsMZF9epnQ7mxyPO+dJ+CVH kPMBkeiuSrQwUvQ0AtViW1x+wEcmpO0dD+35+dB+ljTW5Jrx171JKVV0WWd4g8bXB5hu 4IpNW17wHRdOLvYa2GWcjNP+K2oHKwGP6GbQGZiyrcX1mMWUU65ecmnQpm7KGgyeUgz6 VT4ijNy5BifNiRpQaQ656DVUOIPQ/jRFpNAfqazYDU8u4Cy0jUEUhBuOLFgX+wZxIRBN rooFYM6vi6zAdUSPR5B9dAwbIQ4m5Jn5HKSdWZGx1KS0hTEZ+cFR/J0liUrXh3ZMHu/K 0FJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020aa7962f000000b0062c31053b64si5127201pfg.56.2023.03.26.22.06.12; Sun, 26 Mar 2023 22:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbjC0FF4 (ORCPT + 99 others); Mon, 27 Mar 2023 01:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjC0FFz (ORCPT ); Mon, 27 Mar 2023 01:05:55 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8B4D5AA; Sun, 26 Mar 2023 22:05:53 -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 1E5AC4B3; Sun, 26 Mar 2023 22:06:37 -0700 (PDT) Received: from a077893.blr.arm.com (a077893.blr.arm.com [10.162.42.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D9EDD3F73F; Sun, 26 Mar 2023 22:05:46 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, suzuki.poulose@arm.com Cc: scclevenger@os.amperecomputing.com, Anshuman Khandual , Rob Herring , Frank Rowand , Russell King , Greg Kroah-Hartman , "Rafael J. Wysocki" , Len Brown , Sudeep Holla , Lorenzo Pieralisi , Mathieu Poirier , Mike Leach , Leo Yan , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 0/5] coresight: etm4x: Migrate ACPI AMBA devices to platform driver Date: Mon, 27 Mar 2023 10:35:32 +0530 Message-Id: <20230327050537.30861-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CoreSight ETM4x devices could be accessed either via MMIO (handled via amba_driver) or CPU system instructions (handled via platform driver). But this has the following issues : - Each new CPU comes up with its own PID and thus we need to keep on adding the "known" PIDs to get it working with AMBA driver. While the ETM4 architecture (and CoreSight architecture) defines way to identify a device as ETM4. Thus older kernels won't be able to "discover" a newer CPU, unless we add the PIDs. - With ACPI, the ETM4x devices have the same HID to identify the device irrespective of the mode of access. This creates a problem where two different drivers (both AMBA based driver and platform driver) would hook into the "HID" and could conflict. e.g., if AMBA driver gets hold of a non-MMIO device, the probe fails. If we have single driver hooked into the given "HID", we could handle them seamlessly, irrespective of the mode of access. - CoreSight is heavily dependent on the runtime power management. With ACPI, amba_driver doesn't get us anywhere with handling the power and thus one need to always turn the power ON to use them. Moving to platform driver gives us the power management for free. Due to all of the above, we are moving the MMIO based etm4x devices to be supported via platform driver. The series makes the existing platform driver generic to handle both type of the access modes. Although existing AMBA driver would still continue to support DT based etm4x MMIO devices. The series applies on 6.3-rc4. Changes in V2: - Enables ACPI etm4x device support in the existing platform driver - Dropped last two patches from the series - Dropped redundant 'devarch' checking from is_etm4x_device() - Renamed updated is_etm4x_device() as is_etm4x_devtype() - Fixed arguments in fallback stub for etm4_check_arch_features() - Tagged etm4_dev_pm_ops with etm4_platform_driver - Updated the comment for coresight_get_enable_apb_pclk() helper - Updated the comment for new 'pclk' element in struct etm4_drvdata - Dropped the clock when devm_ioremap_resource() fails - Convert IS_ERR() into a direct pointer check in etm4_remove_platform_dev() - Dropped "arm,coresight-etm4x" compatible property from etm4_match[] Changes in V1: https://lore.kernel.org/all/20230317030501.1811905-1-anshuman.khandual@arm.com/ Cc: Steve Clevenger Cc: Rob Herring Cc: Frank Rowand Cc: Russell King (Oracle) Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Mike Leach Cc: Leo Yan Cc: devicetree@vger.kernel.org Cc: linux-acpi@vger.kernel.org Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (4): coresight: etm4x: Allocate and device assign 'struct etmv4_drvdata' earlier coresight: etm4x: Drop iomem 'base' argument from etm4_probe() coresight: etm4x: Drop pid argument from etm4_probe() coresight: etm4x: Change etm4_platform_driver driver for MMIO devices Suzuki Poulose (1): coresight: etm4x: Add ACPI support in platform driver drivers/acpi/acpi_amba.c | 1 - .../coresight/coresight-etm4x-core.c | 114 ++++++++++++++---- drivers/hwtracing/coresight/coresight-etm4x.h | 4 + include/linux/coresight.h | 59 +++++++++ 4 files changed, 154 insertions(+), 24 deletions(-) -- 2.25.1