Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp293178pxj; Fri, 14 May 2021 03:41:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTOGUK9ftEV7TBnlLAoU2HESjeMQ0O3DRRZRWfvLN+63amhvHgrhgc8xZ5Im369BSLzgvY X-Received: by 2002:a17:906:3bc4:: with SMTP id v4mr13482070ejf.12.1620988918560; Fri, 14 May 2021 03:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620988918; cv=none; d=google.com; s=arc-20160816; b=MCC7oSaEC/gAWUrLxzi4oqpNwQCnY+EGPtYLQlN3F6l+y9CrI/Gj89Mv9KA365FSiV ukUZTmKSGhaSGwJCPF/ETeGcDhNZ0DcZxbjX2jjC0c2tHbsFL2LqzwZQ7lNK1mT59vsT OoMIvljeCo5E9KtFJ5RHXo2mDy+/QcWY2xtGoTpBpVK8lB7083PNoagqvh1U2bL+n9xe DiseJiegqO2r59a+6aaAoAQi4531L5nL/uoopyQbLyCL3VlJ+Lck3KWjgRkc+b5HuFkt I/8Dl07RBSnMzL2F32691sIYBiJo5BqpcLC4G/BRJiVdorQZriKEVq4d4xtMHSEU3KP7 AF0w== 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=oIhad6T16EB5Eu+hxbpOF/xhdkWOYrcL2NuocSAi3hQ=; b=SbW4rXRCvjLmsIrYgPo+Ok0tfvMgC/H+cIt3D3YwgLfR99mPMGYWqFMF6Km3fR2IXC EFndWbs5OF8x5iiL3jAO6JqWJfMOtyWiUv7ueR7YMRfURzAT7v0P/b2gV5A706Y/L71n bcf/ifGHs7JPc4P0EO8u8saZBNh8o02kAfSMiiQSaqwEcJ+Q5md6/tD+kiRYZqrRcZk7 wr7Ct11RKgigcpxYsrcblTAIf2l8fP/xGMBTxOfBGG9l3cCMyYSRIK0axgAKj8MCVZT1 dDTM15A9wkVVC0t846gPX3+aTtHoEaY5R0uyXfe/P53+SQOOnkHOKOdoz/UyZn006nxz SwTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si6237463edu.41.2021.05.14.03.41.35; Fri, 14 May 2021 03:41:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231956AbhENJz3 (ORCPT + 99 others); Fri, 14 May 2021 05:55:29 -0400 Received: from foss.arm.com ([217.140.110.172]:46100 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbhENJz1 (ORCPT ); Fri, 14 May 2021 05:55:27 -0400 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 F0CD5169E; Fri, 14 May 2021 02:54:15 -0700 (PDT) Received: from e108754-lin.cambridge.arm.com (unknown [10.1.195.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 832AF3F719; Fri, 14 May 2021 02:54:14 -0700 (PDT) From: Ionela Voinescu To: Sudeep Holla , "Rafael J . Wysocki" , Thomas Gleixner , Ingo Molnar , Giovanni Gherdovich , Catalin Marinas , Will Deacon , Valentin Schneider Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/3] arch_topology, ACPI: populate cpu capacity from CPPC Date: Fri, 14 May 2021 10:53:36 +0100 Message-Id: <20210514095339.12979-1-ionela.voinescu@arm.com> X-Mailer: git-send-email 2.29.2.dirty MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, These are a few trivial patches to populate cpu capacity information using performance information from ACPI's CPPC. I've tied this functionality to the existing function init_freq_invariance_cppc() called in acpi_cppc_processor_probe(). This function is renamed to a more generic arch_init_invariance_cppc(). The patches have been build tested on x86 and more thoroughly tested on Juno R2 (arm64), which uses the new functionality, with the following results: root@ubuntu:~# dmesg | grep cpu_capacity [ 2.157494] init_cpu_capacity_cppc: CPU0 cpu_capacity=38300 (raw). [ 2.163699] init_cpu_capacity_cppc: CPU1 cpu_capacity=38300 (raw). [ 2.169899] init_cpu_capacity_cppc: CPU2 cpu_capacity=38300 (raw). [ 2.176098] init_cpu_capacity_cppc: CPU3 cpu_capacity=38300 (raw). [ 2.182296] init_cpu_capacity_cppc: CPU4 cpu_capacity=102400 (raw). [ 2.188581] init_cpu_capacity_cppc: CPU5 cpu_capacity=102400 (raw). [ 2.194867] cpu_capacity: capacity_scale=102400 [ 2.199409] cpu_capacity: CPU0 cpu_capacity=383 [ 2.203952] cpu_capacity: CPU1 cpu_capacity=383 [ 2.208495] cpu_capacity: CPU2 cpu_capacity=383 [ 2.213037] cpu_capacity: CPU3 cpu_capacity=383 [ 2.217580] cpu_capacity: CPU4 cpu_capacity=1024 [ 2.222209] cpu_capacity: CPU5 cpu_capacity=1024 [ 2.226886] init_cpu_capacity_cppc: cpu_capacity initialization done root@ubuntu:~# tail -n +1 /sys/devices/system/cpu/cpu*/cpu_capacity ==> /sys/devices/system/cpu/cpu0/cpu_capacity <== 383 ==> /sys/devices/system/cpu/cpu1/cpu_capacity <== 383 ==> /sys/devices/system/cpu/cpu2/cpu_capacity <== 383 ==> /sys/devices/system/cpu/cpu3/cpu_capacity <== 383 ==> /sys/devices/system/cpu/cpu4/cpu_capacity <== 1024 ==> /sys/devices/system/cpu/cpu5/cpu_capacity <== 1024 All works as expected even if ACPI processor support is built as a module. Patches are based on v5.13-rc1. Let me know what you think! Thanks, Ionela. Ionela Voinescu (3): x86, ACPI: rename init_freq_invariance_cppc to arch_init_invariance_cppc arch_topology: obtain cpu capacity using information from CPPC arm64, topology: enable use of init_cpu_capacity_cppc() arch/arm64/include/asm/topology.h | 4 ++++ arch/x86/include/asm/topology.h | 2 +- drivers/acpi/cppc_acpi.c | 6 ++--- drivers/base/arch_topology.c | 39 +++++++++++++++++++++++++++++++ include/linux/arch_topology.h | 4 ++++ 5 files changed, 51 insertions(+), 4 deletions(-) -- 2.29.2.dirty