From patchwork Wed Jul 29 15:12:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 11691183 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 399EC14E3 for ; Wed, 29 Jul 2020 15:14:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 EE19120829 for ; Wed, 29 Jul 2020 15:14:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BKvnjXUd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE19120829 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ScjAelfe3NtU0xiX9xX0z7Ccy1fdHxWTngHvRBCgUOg=; b=BKvnjXUd2ifVE5YXhojPfBQBZm h7kea8aCcoQjUbZlBMG6ulX+uXvoW6YYLLq+6sjbFhCiabsRAW8ozfYzhr6Rr11Ue08SDXA2um77Q qDRR6rhPIrXCWyIs05KXcG4K/Eto14Oee7gZKgR8ZvTP0W8QjWXZ6P0HfLRfMSqkAmL8uLC2+L6OX 98fruIylv1LIRNknZYO74PqsueLeTOoPhgFfZzOdW0cgdL775zgO1XXog8bIrgzUdA9N1/0BpVtDD wQAlEWm4qvdTavpxANzFfesnywnP90shq469HLm/C6wYm2FXAs8i0bTIn1F7ZQlIEFczy403QGdY4 uWHaocJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0nkq-0005xn-BQ; Wed, 29 Jul 2020 15:12:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0nkm-0005wX-7A for linux-arm-kernel@lists.infradead.org; Wed, 29 Jul 2020 15:12:25 +0000 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 A9AE330E; Wed, 29 Jul 2020 08:12:20 -0700 (PDT) Received: from e123648.arm.com (unknown [10.37.12.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 95EB63F66E; Wed, 29 Jul 2020 08:12:18 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 0/4] CPUFreq statistics retrieved by drivers Date: Wed, 29 Jul 2020 16:12:04 +0100 Message-Id: <20200729151208.27737-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200729_111224_363614_203DE0F2 X-CRM114-Status: GOOD ( 11.89 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: viresh.kumar@linaro.org, rjw@rjwysocki.net, lukasz.luba@arm.com, cristian.marussi@arm.com, sudeep.holla@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi all, The existing CPUFreq framework does not tracks the statistics when the 'fast switch' is used or when firmware changes the frequency independently due to e.g. thermal reasons. However, the firmware might track the frequency changes and expose this to the kernel. This patch set aims to introduce CPUfreq statistics gathered by firmware and retrieved by CPUFreq driver. It would require a new API functions in the CPUFreq, which allows to poke drivers to get these stats. The needed CPUFreq infrastructure is in patch 1/4, patch 2/4 extends ARM SCMI protocol layer, patches 3/4, 4/4 modify ARM SCMI CPUFreq driver. Regards, Lukasz Luba Lukasz Luba (4): cpufreq: Add support for statistics read from drivers scmi: perf: Extend protocol to support performance statistics cpufreq: scmi: Move scmi_cpufreq_driver structure to the top cpufreq: scmi: Read statistics from FW shared memory drivers/cpufreq/cpufreq.c | 22 ++++ drivers/cpufreq/cpufreq_stats.c | 38 +++--- drivers/cpufreq/scmi-cpufreq.c | 116 ++++++++++++++--- drivers/firmware/arm_scmi/perf.c | 210 +++++++++++++++++++++++++++++++ include/linux/cpufreq.h | 32 +++++ include/linux/scmi_protocol.h | 11 ++ 6 files changed, 401 insertions(+), 28 deletions(-)