From patchwork Thu Aug 17 05:54:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 13651 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp794279vqi; Thu, 17 Aug 2023 08:44:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGI2VXe5R/G6ChT9IgP4Siz0rX2QUKUQ8aA2oVRPhbJhdVB5CcuTalZyJxBZiEWLtDP+l+F X-Received: by 2002:aa7:df89:0:b0:522:2d1b:5a38 with SMTP id b9-20020aa7df89000000b005222d1b5a38mr109558edy.10.1692287097892; Thu, 17 Aug 2023 08:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692287097; cv=none; d=google.com; s=arc-20160816; b=MPOegsTSzWWZz/fuaSg3FbY+ciVwBl3fV5a9DieCjYgj2mjKVDbtRFINSiemqiy7U1 J+XilLHMmcve9JVZDn8xBW0xaKW6NKnDEIiCaJVt7InWnNS/ZQtYDEjcE85OtsoY6ao5 AU7JkcoGfwU3weJ2vf27Y6FIcTAz3zp2aCaOpHgXnRdPRHnd+bTH25N2PgtiQM/S8MKG VBjhkI0Lnm5JIftov4FZEGqjM6nE50M8IuPTop2ZBi75yjT5I/zodVB0POmUXv8eU6wU vfp4YSDfgmrYY/XlLAZseAscyfJY8al7FBd3pTLGxNpWl/DOew3Bp7zR8KSsfvOGOX3N 6pPA== 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=uxNRci4ERAgDS9+rww3IWPscbYEzSSuMIGGys0h93r8=; fh=Amix3fM17tr65VI1fISDYxtFdk/MRmRQCaXTbLjGJHs=; b=MIWArjrBTBguG3U0DneJkKJn9k8fXQb3droVpbeyN7RQohJFXzKZx2ec9meROGbcF3 44ZDFzdEmfhQ7Z+eQeMV+sfrG85iBD7e3CHc0+528ah5QIzvqvkci0lmycGQAZMrEa5/ Oo81FQAn/PinitXb7S2iTFzxrbSAEcmi+tP1uTejf8vhgE6nXNLVtZIJ55uSgX8+aWb9 NO0OTD8wEHkTPiJWU3B82i8el/sXmQXBy0Yy1KSZexdJdwvYLpyOs6Pn0ySSqNu4Kc7c qrEBkj94m1PwjzNuK8dmdEdqj2VZkQ3QTnzl5asVHcY3WfNplwABRgpMBwLnfPdRq/Zh Gsvg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020aa7d743000000b0052596b351d7si2961521eds.276.2023.08.17.08.44.24; Thu, 17 Aug 2023 08:44:57 -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 S1348141AbjHQFyy (ORCPT + 99 others); Thu, 17 Aug 2023 01:54:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348134AbjHQFyW (ORCPT ); Thu, 17 Aug 2023 01:54:22 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7B3BC2722 for ; Wed, 16 Aug 2023 22:54:20 -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 D1F72D75; Wed, 16 Aug 2023 22:55:00 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.56.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0D9B53F762; Wed, 16 Aug 2023 22:54:12 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: yangyicong@huawei.com, Anshuman Khandual , Sami Mujawar , Catalin Marinas , Will Deacon , Mark Rutland , Mike Leach , Leo Yan , Alexander Shishkin , James Clark , coresight@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH V5 0/4] coresight: trbe: Enable ACPI based devices Date: Thu, 17 Aug 2023 11:24:01 +0530 Message-Id: <20230817055405.249630-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774491636455866103 X-GMAIL-MSGID: 1774491636455866103 This series enables detection of ACPI based TRBE devices via a stand alone purpose built representative platform device. But as a pre-requisite this changes coresight_platform_data structure assignment for the TRBE device. This series is based on v6.5-rc5 kernel, is also dependent on the following EDK2 changes posted earlier by Sami. https://edk2.groups.io/g/devel/message/107239 https://edk2.groups.io/g/devel/message/107241 Changes in V5: - Detected zeroed parsed GSI as a mismatch but handled all zero scenario - Changed condition check from 'if (ret < 0)' into a 'if (ret)' - Dropped pr_warn() message after platform_device_register() Changes in V4: https://lore.kernel.org/all/20230808082247.383405-1-anshuman.khandual@arm.com/ - Added in-code comment for arm_trbe_device_probe() - Reverted back using IS_ENABLED() for SPE PMU platform device - Replaced #ifdef with IS_ENABLED() for TRBE platform device - Protected arm_trbe_acpi_match with ACPI_PTR() - preventing a build failure when CONFIG_ACPI is not enabled - Added __maybe_unused for arm_acpi_register_pmu_device() and dropped config checks with IS_ENABLED() Changes in V3: https://lore.kernel.org/all/20230803055652.1322801-1-anshuman.khandual@arm.com/ - Changed ARMV8_TRBE_PDEV_NAME from "arm-trbe-acpi" into "arm,trbe" - Dropped local variable 'matched' - Replaced 'matched' with 'valid gsi' as being already matched once - Moved find_acpi_cpu_topology_hetero_id() outside conditional check Changes in V2: https://lore.kernel.org/all/20230801094052.750416-1-anshuman.khandual@arm.com/ - Refactored arm_spe_acpi_register_device() in a separate patch - Renamed trbe_acpi_resources as trbe_resources - Renamed trbe_acpi_dev as trbe_dev Changes in V1: https://lore.kernel.org/all/20230728112733.359620-1-anshuman.khandual@arm.com/ Cc: Sami Mujawar Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Suzuki K Poulose Cc: Mike Leach Cc: Leo Yan Cc: Alexander Shishkin Cc: James Clark Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (4): arm_pmu: acpi: Refactor arm_spe_acpi_register_device() arm_pmu: acpi: Add a representative platform device for TRBE coresight: trbe: Add a representative coresight_platform_data for TRBE coresight: trbe: Enable ACPI based TRBE devices arch/arm64/include/asm/acpi.h | 3 + drivers/hwtracing/coresight/coresight-trbe.c | 26 +++- drivers/hwtracing/coresight/coresight-trbe.h | 2 + drivers/perf/arm_pmu_acpi.c | 142 ++++++++++++++----- include/linux/perf/arm_pmu.h | 1 + 5 files changed, 132 insertions(+), 42 deletions(-)