From patchwork Wed Jun 16 06:48:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 461377 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp321388jae; Tue, 15 Jun 2021 23:48:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHJxJcHJH3VfV2ZQR7QXYFJ+ayLpFlSp5UWuMAj/RN5z83Un8KFlKRnWPOsHK8BGSnPEGy X-Received: by 2002:a92:c503:: with SMTP id r3mr2647164ilg.4.1623826097115; Tue, 15 Jun 2021 23:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623826097; cv=none; d=google.com; s=arc-20160816; b=GUnD4W0OQgeaTJzjHB2MlzU0CWaexicr0287aHfxvUDgZ/KoWIGvOI0WGfeiwhXkSU j9hhyMCEXY/3T5XzdtbrZ7YL8JUDJyPnk51ZjNLp9m78ylCwUJ7KjT84LKAEcMXHfn9F 0kmVtyrsepuqj/408fjSzG2PMCjyijono3FAyYOy/naGTqpdbQ1mTDdb6fA4lEO+3p5i c22brrmGFS/RWYmUGk6+d/eQY60DPVsUl2W2yTJ17TkdtUcg7EUbu5aiQ+LeHuFIcKo9 eL7ot9Rh+YlSJuuZ4T/5KTLp82MW2/5v+og9YEWUj4/ztrgcSLvgHL5lPimdG9bgRlqw 4c6g== 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=pGeux1k9JWdeLuVQiCjnsXhyQPPrJGOsEZqXQl3yO0U=; b=dkIfh9e0Sydi2ckZFbXqqCNi4bY87miagceBSXGup53bb5TDdCIyW1FJY2THQCBJ0V PBTbXLnzAl05p4WlgJ8x3LbJvXcBOPqO3K0vA1T6DkV72iSAM5EhRU3Fi1nECGx0ZD/a BuDzBNrgPXXnWnynztqHy3gztI4Bv3mPH6iRVcQqM0wB+igZld0ez4Ad1/nUgRgMaOAu 6PAtg8s2lvMqmfhsx5UYDOdNAJa6idM5xHVbzJ+25i0PcNZ4lhm85ECA5UAh1Dd7Qxd9 Xz4eyOBlaJVTsgfsbUqPYJ0lbPLdTeP65LpSm7sU828R3ze/9cuSUEo//PM20/WvI8Jl GAmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C5NAcwkC; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-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 y9si1871361jas.84.2021.06.15.23.48.16; Tue, 15 Jun 2021 23:48:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-acpi-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=C5NAcwkC; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-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 S231220AbhFPGuV (ORCPT + 4 others); Wed, 16 Jun 2021 02:50:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231132AbhFPGuV (ORCPT ); Wed, 16 Jun 2021 02:50:21 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3E53C061767 for ; Tue, 15 Jun 2021 23:48:15 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id fy24-20020a17090b0218b029016c5a59021fso3401860pjb.0 for ; Tue, 15 Jun 2021 23:48:15 -0700 (PDT) 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=pGeux1k9JWdeLuVQiCjnsXhyQPPrJGOsEZqXQl3yO0U=; b=C5NAcwkC7mA1qeppXu2tkTAkN7Jy2MTgN4kTAeYpf+aPPjiofwWPc/Zen9dH10DK9V 6jXvGF/h1ZATOw9SeR1C7Tx2GNtiD1WXbuLL0OmjuErWPNdPy1V4lUzHlOm44m45mxhl KIOXN8nSFwgX4g6ztaeKjzyvLd5+qN0qZ00DSYdmWjSz01xXoRMwnQm0dEXk8RG+nJhu ikNPloTrQEgHmsd0HVbuetcSPjbihvHfewN5fDSOrtd0H5lo0o3Ng2oAMv3ekAyGprDv 4EEZ4SXI/07UVoQ/B+WJu+EawA/rY0eOg30vHev6mco1uKydZbGOCjfDjoQYRHtLgWkm zQmw== 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=pGeux1k9JWdeLuVQiCjnsXhyQPPrJGOsEZqXQl3yO0U=; b=KFzXJYLF76rWOAiqCmBq2pT4j77ZdTfrwuWuSdB1oqMkQS+8Ct56fq4qXKzszwZH1V Qj8r2QIO3EEqzoSdZ8+/3ce7IeuycDkWPs7WZMmSkWAH9A+Z+UrHZdV71sgpnYjIz/mE gt27FVkkfnC1X3svEXuduXz5vjyCPWmLRl6O6sKOed8r/OfaeN7Id+S+W/tkvv6+vj0o I06X92wX2C3noKVNaM98+TNwtsHRP4PTBFpnxMw4BvCrDfW8RENsKj35ogzH/FyPmlLV QQffhDCGvZfradabkoC/SHc2A9uuVUSqHBCQoHbYl2cVkqB3ClsfreTPU3haSE9XGNDE 3ABg== X-Gm-Message-State: AOAM530xboEOK/aUMlrBO3uAlWSjldI6KLxDN+6rLmRF3Brr9byXDfiM BodAe2GIMKEHcCED2aF9wPRzfg== X-Received: by 2002:a17:903:3053:b029:110:d36:af61 with SMTP id u19-20020a1709033053b02901100d36af61mr7798331pla.5.1623826095004; Tue, 15 Jun 2021 23:48:15 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id x36sm1096314pfu.39.2021.06.15.23.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 23:48:14 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Ionela Voinescu , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Greg Kroah-Hartman , Ingo Molnar , Jonathan Corbet , Juri Lelli , Mel Gorman , Peter Zijlstra , "Rafael J. Wysocki" , Steven Rostedt , Sudeep Holla , Vincent Guittot , Viresh Kumar Cc: linux-pm@vger.kernel.org, Qian Cai , linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Paul E. McKenney" Subject: [PATCH V2 0/3] cpufreq: cppc: Add support for frequency invariance Date: Wed, 16 Jun 2021 12:18:06 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hello, Changes since V1: - Few of the patches migrating users to ->exit() callback are posted separately. - The CPPC patch was completely reverted and so the support for FIE is again added here from scratch. - The start_cpu() and stop_cpu() interface is reworked a little so stop_cpu() is only ever called for a CPU if start_cpu() was called for it earlier. - A new patch to implement RCU locking in arch_topology core to avoid some races. - Some cleanup and very clear/separate paths for FIE in cppc driver now. -------------------------8<------------------------- 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 was reverted earlier for the 5.13 kernel after Qian Cai reported kernel oops during suspend/resume. This is based of pm/linux-next + a cleanup patchset: https://lore.kernel.org/linux-pm/cover.1623825358.git.viresh.kumar@linaro.org/ All the patches are pushed here together for people to run. https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git/log/?h=cpufreq/cppc This is tested on my Hikey platform (without the actual read/write to performance counters), with this script for over an hour: while true; do for i in `seq 1 7`; do echo 0 > /sys/devices/system/cpu/cpu$i/online; done; for i in `seq 1 7`; do echo 1 > /sys/devices/system/cpu/cpu$i/online; done; done Vincent will be giving this patchset a try on ThunderX2. Meanwhile it is up for review. Ideally I would like to get this merged for 5.14, but lets see how it goes. Thanks. -- Viresh Viresh Kumar (3): cpufreq: Add start_cpu() and stop_cpu() callbacks arch_topology: Avoid use-after-free for scale_freq_data cpufreq: CPPC: Add support for frequency invariance Documentation/cpu-freq/cpu-drivers.rst | 7 +- drivers/base/arch_topology.c | 27 ++- drivers/cpufreq/Kconfig.arm | 10 ++ drivers/cpufreq/cppc_cpufreq.c | 232 +++++++++++++++++++++++-- drivers/cpufreq/cpufreq.c | 19 +- include/linux/arch_topology.h | 1 + include/linux/cpufreq.h | 5 +- kernel/sched/core.c | 1 + 8 files changed, 272 insertions(+), 30 deletions(-) -- 2.31.1.272.g89b43f80a514