From patchwork Thu Jan 28 10:48:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 372554 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1115711jam; Thu, 28 Jan 2021 02:50:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLNjyuTUgUP5Ncrf+v+FTfX0f9LJwHzXgD/tHfZkZhoyBCe0SblaBB5/dE1BFaww+RPW9Y X-Received: by 2002:a05:6402:1809:: with SMTP id g9mr13267695edy.2.1611831017063; Thu, 28 Jan 2021 02:50:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611831017; cv=none; d=google.com; s=arc-20160816; b=COqq60JQ7yl9DXoB2KPxsYUnZI8KIQk3WYNpqBTVmRUNtBmvco0HyF365QcrPffpnD 4d7twBmIADqx0Zg9xbrOeZJpKvBCCIQ6TOfAMWng9iJdr8VsyWtNUHSL+eV7U0gOEYdo NRtwI9YiWbML/4FIHIEZTTq6h2vpAAKRU0aOgu7fUAGy3PlsrNcntgE3zcbl4l8UHNTp guV2O0BM7FbAze47rCP6rDUV7+5k16DdRmKFJfN82T9qPcQvOw4LtlpgsWNGyF+h36Oh QKE2lWrg7VfrjNBtHhnDXWW3begF4gyvw5GktHTqgNSer8h7285Da1QqKiNRKAflzQgI hjfA== 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:dkim-signature; bh=v8tY7xOSVL8TKmu23l5iwSWLMDTVdZzvIWOkVTMFGtE=; b=e6VJg8gvqe7UzRE3GeAgPvqhBhdaR0UlSmAFXUxOp6ei73JYtxay+KUYYeA/RwtE4K EPMuhOc5Gg9Pvypr0kguCr4cxycxhFwDgq4PDycKODjaP0KEnvzPfePj58qpmtPyRPi9 H2AkeWd/CVdeRAW0kmYYAB2X6sdWuuOVwCEnQ95q5GxgF8LtkVT8uXKYLC47MKuJwzUT PkIQt5yb0IFgs6TQUEIz1tWZ71LJp5aWUx6TskuDV/iRLJI4yl4fx3ySWQY4IgNgkV3T MjUvQ0GHXlM242WqdstJIAgLAGrSzr8GADtsTHiEjeEKIrNsTxE8T4SfLDF8ziVFniiq GH2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GOVFFIZl; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si2624692edr.414.2021.01.28.02.50.16; Thu, 28 Jan 2021 02:50:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GOVFFIZl; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbhA1Ktp (ORCPT + 7 others); Thu, 28 Jan 2021 05:49:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231152AbhA1Ktm (ORCPT ); Thu, 28 Jan 2021 05:49:42 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80F5EC061574 for ; Thu, 28 Jan 2021 02:49:02 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id j12so3723232pfj.12 for ; Thu, 28 Jan 2021 02:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v8tY7xOSVL8TKmu23l5iwSWLMDTVdZzvIWOkVTMFGtE=; b=GOVFFIZleKeu/u0ClRM2qZBnFQcwtfJ8rA2iqIzKh4pprvawvMHg+/qykqmwoO4Qv6 wx5VoD8JLCNalnmcuv46OFtu0o96/BWOseUB+v/QBLExW4R3c2nq2iA1VA2xUTYZbu5r Rd6vqPsDA6dhwCO3+h4J4lGF7AkGQ4jl3FGuvCNyniC6VwNLOWVtUcJ2X/OLD6RHs9g2 mzkLcdThwlY++oad1iemBQy65e0FdneukoyiNpD7I6+9tC7m0Bn2pfwtZ7j5A41pNufT xzw9TUQVwy5Qdz6My0hZ6zqsN1wz2VUNLJTJN/2l+9yX2gJRBUTmvdiJ2m37syVS/mC6 HNaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v8tY7xOSVL8TKmu23l5iwSWLMDTVdZzvIWOkVTMFGtE=; b=b6nMQ4pcxy3Pn2xsj1hjbRCPbIPcfEkbKmKmUTG8Uua5TY9vznlFxYOWgYz7rbNFAO 1Z/J8u8AKL9xwJ9AQOk6bSLvP0q2/Iimvx3cZM8faWMPR05W9mQKxAdaEPkNQkl4cFRz xsx155GA7IhQ7M3Jb9BcRGOHXaer4NHqGgV2wU7xvNvRDU1kt4mkYQR1b+sgidozcXQt K4Tp1Kzwg70YEse15ngZsg/lupUko4FmXePYFFT3hnrfugdHBWuyiBSuY0v14Jzdmk0u V7Zn8x3raCVke6exenVX1wcDGDFeRd1Qy5hUEABXr/bD1i8WzKINbdjQUXtm5rAMjl+w bOgg== X-Gm-Message-State: AOAM533l23o26fjDYf8IaFtkakU/tykK0306eqwf+mnnD5NdJQ44CDru y8Ysnb8Clm+wgR3CvIcPYlfpPQbjIC3eMg== X-Received: by 2002:a63:1a48:: with SMTP id a8mr16032597pgm.257.1611830942070; Thu, 28 Jan 2021 02:49:02 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id a30sm5378756pfh.66.2021.01.28.02.49.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 02:49:01 -0800 (PST) From: Viresh Kumar To: Ionela Voinescu , Rafael Wysocki , Catalin Marinas , Will Deacon Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, Sudeep Holla , Greg Kroah-Hartman Subject: [PATCH V3 0/2] cpufreq: cppc: Add support for frequency invariance Date: Thu, 28 Jan 2021 16:18:54 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hello, CPPC cpufreq driver is used for ARM servers and this patch series tries to provide counter-based frequency invariance support for them in the absence for architecture specific counters (like AMUs). This is tested with some hacks, as I didn't have access to the right hardware, on the ARM64 hikey board to check the overall functionality and that works fine. Vincent/Ionela, it would be nice if you guys can give this a shot on some real hardware where counters work. This is based of pm/linux-next (need some stuff from the arm64 tree). These patches should get merged via the arm64 tree only for the same reason. Changes since V2: - Not sending as an RFC anymore. - Several renames, reordering of code in 1/2 based on Ionela's comments. - Several rebase changes for 2/2. - The freq_scale calculations are optimized a bit. - Better overall commenting and commit logs. Changes since V1: - The interface for setting the callbacks is improved, so different parts looking to provide their callbacks don't need to think about each other. - Moved to per-cpu storage for storing the callback related data, AMU counters have higher priority with this. -- viresh Viresh Kumar (2): topology: Allow multiple entities to provide sched_freq_tick() callback cpufreq: cppc: Add support for frequency invariance arch/arm64/include/asm/topology.h | 10 +- arch/arm64/kernel/topology.c | 89 +++++++-------- drivers/base/arch_topology.c | 56 +++++++++- drivers/cpufreq/cppc_cpufreq.c | 179 ++++++++++++++++++++++++++++-- include/linux/arch_topology.h | 15 ++- kernel/sched/core.c | 1 + 6 files changed, 274 insertions(+), 76 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af