From patchwork Tue Jul 23 06:14:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 169478 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8446592ilk; Mon, 22 Jul 2019 23:14:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0CoMhI6A3bJtKR09nLGP4ETRyZRhqP67koWyYY0gJWU2lTsI9VDFh/h277x3JKeQloHov X-Received: by 2002:a62:b60e:: with SMTP id j14mr4134381pff.54.1563862473718; Mon, 22 Jul 2019 23:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563862473; cv=none; d=google.com; s=arc-20160816; b=JFuxufUZtI4+yRE8ogZ6xiqDjrUWaUB9voXfKY2KfJkOmzOrLin+oUGRAt5CNROPyI 6T+CHdPvTJzypLHuTaPdSKFQV3h4xn/zaRGsruD7JFpvX0CreQdlMihTOj61zsY/UjHq UiwKQ74PuOCndEgiNrZ0qLto43JH0RhvGawiLd0I0edDdGUssFvl04pylMKTHlPEYQI6 WFAeKmUtJ3I1BqathmqsTQsIEBS5BjKjqZF0jnTTg5m90vXNv0EWtj+NeRvvniwj0Gzh o/AQlCAVjlQ8jG6Xyg02mj1WRvUFqkESegTUNI4rBwktHwIonS/kN3KtY7gr8uCPg+Em BLww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SWb56XEnAkwuUUTQuv4g9CftmyTnuWFI0OcyOh8bV4E=; b=XwN2iNAUPGILDr38ABAh3oqexdxDixa2lN6x11BdtEVNNoOE/t7fw5hJyy09AYYWLM 066jLxMO70Idv0BJ9zHDksd2+hDI7bfQjySdtAlAM4MmF6AzofiBJcpeLC9cJEetoaDc OAEWUjGCA35pTcQzJRTj0LpPMpmaZ082sEeyH1VpqO/8kqsEJGEYGdGyKv+claGIWsTL wiHcgfL5m+gNkhxCKJu8A0R5dXGyFjYV62j45IRL+Eyow3bOjQ/qSwuVrz3CSVosBfhN ZyMXTBOJyT03tLWhmsQ85OHiInn47zxdgDrAQnhTUdelCSqYe3EUYpe4+LWwbuuSTBog gfCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AS7dyrHG; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id j1si13710259pfa.91.2019.07.22.23.14.33; Mon, 22 Jul 2019 23:14:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AS7dyrHG; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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 S2388098AbfGWGOb (ORCPT + 11 others); Tue, 23 Jul 2019 02:14:31 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42838 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728505AbfGWGOb (ORCPT ); Tue, 23 Jul 2019 02:14:31 -0400 Received: by mail-pf1-f194.google.com with SMTP id q10so18569008pff.9 for ; Mon, 22 Jul 2019 23:14:30 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=SWb56XEnAkwuUUTQuv4g9CftmyTnuWFI0OcyOh8bV4E=; b=AS7dyrHGVRmWsssELTaKoX/PZHEcnPqpDyuzYRx6yaWF7GV4TKl3wEsZLCqK09+afF UKPtHWleI0QB5Zu+zLqZNjhxvZgS1rWrGvzeol0aIejROxSkP10NjaNGLT9TtV4w4lTW 9Ts6P/HxToNpQDWru2fZuBq1sLHJFfgeXg6uLZz6K18KDfsWBt3WvVSSgCAc46a8uYMh SmC/72s3aW8jIJj9hT0a9/XIgifFfWhoAOjRGbzvD9UVyZPoczLs2O0lZfsyOWbuV1LB ieQ/b25D/HHynbfdTLTG6pT9Zlj8Y50YrcCoIMfmMka93RWyu3U789hVkhtj1fOM6LFV XQAQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=SWb56XEnAkwuUUTQuv4g9CftmyTnuWFI0OcyOh8bV4E=; b=NqN7xRnYTNvDnZJxT+a8+ZV+x+6islZHzAg13AEFAZI24kQiPDgqEwPorUCPYX3Rn8 fzTLnDu2v3XS8VY1ZVp6x03zHKPbny2LxHp4StijrQh8uasAv0fcRPsNdkkEy/N41t5l apF5qYKyjho8uFpuYdr+wlkPAcjW0mWH13vE1n91u67xtccHeBbXbhem6zpQIwtLswv/ 3OXcNZxOt83n23ckPU0oqDt6tMcwSYbJbvnTMVvN6Miq9xhtryQPLbYqy+7Esv5rlVsw p/iwCN2wGyxatLl/zYo+wMvD7Mm+UlP36PwEfHVg+S+8eAVT00iC1LiVrl7C57M46Not GVzQ== X-Gm-Message-State: APjAAAXMG5C/UX/XCkc0NR4cqEk4LDkbCmpF3SBVW3EeYHilUxOIMyAI rWsnL1HU6WEV1C8EiTt1Z8/ijQ== X-Received: by 2002:a62:2f04:: with SMTP id v4mr3966722pfv.14.1563862470362; Mon, 22 Jul 2019 23:14:30 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id c69sm50590753pje.6.2019.07.22.23.14.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jul 2019 23:14:29 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Benjamin Herrenschmidt Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 03/10] powerpc: macintosh: Switch to QoS requests instead of cpufreq notifier Date: Tue, 23 Jul 2019 11:44:03 +0530 Message-Id: <8fab346b73991afcc6bc602253c973e5d4ecde95.1563862014.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The cpufreq core now takes the min/max frequency constraints via QoS requests and the CPUFREQ_ADJUST notifier shall get removed later on. Switch over to using the QoS request for maximum frequency constraint for windfarm_cpufreq_clamp driver. Signed-off-by: Viresh Kumar --- drivers/macintosh/windfarm_cpufreq_clamp.c | 77 ++++++++++++++-------- 1 file changed, 50 insertions(+), 27 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c index 52fd5fca89a0..705c6200814b 100644 --- a/drivers/macintosh/windfarm_cpufreq_clamp.c +++ b/drivers/macintosh/windfarm_cpufreq_clamp.c @@ -3,9 +3,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -16,36 +18,24 @@ static int clamped; static struct wf_control *clamp_control; - -static int clamp_notifier_call(struct notifier_block *self, - unsigned long event, void *data) -{ - struct cpufreq_policy *p = data; - unsigned long max_freq; - - if (event != CPUFREQ_ADJUST) - return 0; - - max_freq = clamped ? (p->cpuinfo.min_freq) : (p->cpuinfo.max_freq); - cpufreq_verify_within_limits(p, 0, max_freq); - - return 0; -} - -static struct notifier_block clamp_notifier = { - .notifier_call = clamp_notifier_call, -}; +static struct dev_pm_qos_request qos_req; +static unsigned int min_freq, max_freq; static int clamp_set(struct wf_control *ct, s32 value) { - if (value) + unsigned int freq; + + if (value) { + freq = min_freq; printk(KERN_INFO "windfarm: Clamping CPU frequency to " "minimum !\n"); - else + } else { + freq = max_freq; printk(KERN_INFO "windfarm: CPU frequency unclamped !\n"); + } clamped = value; - cpufreq_update_policy(0); - return 0; + + return dev_pm_qos_update_request(&qos_req, freq); } static int clamp_get(struct wf_control *ct, s32 *value) @@ -74,27 +64,60 @@ static const struct wf_control_ops clamp_ops = { static int __init wf_cpufreq_clamp_init(void) { + struct cpufreq_policy *policy; struct wf_control *clamp; + struct device *dev; + int ret; + + policy = cpufreq_cpu_get(0); + if (!policy) { + pr_warn("%s: cpufreq policy not found cpu0\n", __func__); + return -EPROBE_DEFER; + } + + min_freq = policy->cpuinfo.min_freq; + max_freq = policy->cpuinfo.max_freq; + cpufreq_cpu_put(policy); + + dev = get_cpu_device(0); + if (unlikely(!dev)) { + pr_warn("%s: No cpu device for cpu0\n", __func__); + return -ENODEV; + } clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL); if (clamp == NULL) return -ENOMEM; - cpufreq_register_notifier(&clamp_notifier, CPUFREQ_POLICY_NOTIFIER); + + ret = dev_pm_qos_add_request(dev, &qos_req, DEV_PM_QOS_MAX_FREQUENCY, + max_freq); + if (ret < 0) { + pr_err("%s: Failed to add freq constraint (%d)\n", __func__, + ret); + goto free; + } + clamp->ops = &clamp_ops; clamp->name = "cpufreq-clamp"; - if (wf_register_control(clamp)) + ret = wf_register_control(clamp); + if (ret) goto fail; clamp_control = clamp; return 0; fail: + dev_pm_qos_remove_request(&qos_req); + + free: kfree(clamp); - return -ENODEV; + return ret; } static void __exit wf_cpufreq_clamp_exit(void) { - if (clamp_control) + if (clamp_control) { wf_unregister_control(clamp_control); + dev_pm_qos_remove_request(&qos_req); + } } From patchwork Tue Jul 23 06:14:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 169479 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8446624ilk; Mon, 22 Jul 2019 23:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnRtfqiRnCYnD42QQmwMcbY+O+k4lqWcYk8S6OjjTpYZpKWQjL6a66ON9tAZ4ljs99enx9 X-Received: by 2002:a62:6044:: with SMTP id u65mr3984969pfb.15.1563862475692; Mon, 22 Jul 2019 23:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563862475; cv=none; d=google.com; s=arc-20160816; b=D9vZkwokFK/WY4jA363Eutd9dEwvV8GkSzG5j+AwDGB3IMRhkZ9df+THeIZzhz7xww f4twKVROOJGXR4LOcVKXGIUkFUGqjpmltw4ebw4yXgZAzlmhL2U3PzdZ5XLf5zRIvr/2 Mrvuyafjs0qajIFUQopY8WOWfTYDZwT2WKtjVinS8pTjX6njpEe4Ub85LbNa5xlhQZ84 S6I+/W7Y6RkScRHMVRlDKGILurAGjj7i8SSApel250tmWDQU3IkZIauYJOA0XXQaRLZ+ 28sD9NKOpibRL2X9BKgzghyMD1uwOtPJ+ykSfJBLoMKTdundQrzkTonpadRFRjZbjhNL so8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FCHE6jmJHvvf4ZOfPHyOAwxkEw7udl1CJtgxI9QEJbs=; b=pf1xlClopz986bx+FQ0fKSjv8qzg2KBgrLYYbsOyVHeh6nf/tKv+NBkX8bOv4WAG2W Yx62CYP+9LZ8N1BbKmXKDuHwwi+FJV1b3+9Jm/iomKtxpn7BDWJ7FpYPuGQsrSaf2zwh CKSP4RvLsEYxfMCQS/PVsDk9MX2eDWwgjcQ/0NniiW6YHAQrKuQbwjTZ/y4nVwCZTxyr tEhNNOGfxRqerccQ4gQx0t2VuS6vq3Gff/Gc9BdOcFc0sWFPhUUswsSOIr/K1hWd0Mmi ef+B411hghLUiWk3u+9xUkznZTWkzGqLp0qUD5ZAhJP1YUbfQMi8iOucZpIuA7mA0EBc 9IuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x5tKx8ng; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id j1si13710259pfa.91.2019.07.22.23.14.35; Mon, 22 Jul 2019 23:14:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x5tKx8ng; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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 S1732385AbfGWGOe (ORCPT + 11 others); Tue, 23 Jul 2019 02:14:34 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33221 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732356AbfGWGOe (ORCPT ); Tue, 23 Jul 2019 02:14:34 -0400 Received: by mail-pf1-f194.google.com with SMTP id g2so18584396pfq.0 for ; Mon, 22 Jul 2019 23:14:34 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=FCHE6jmJHvvf4ZOfPHyOAwxkEw7udl1CJtgxI9QEJbs=; b=x5tKx8nggIBKSNVr0fIQULuyuYaQQTRIECGmGLYfRBKWIX6uf8TnIOwygNZ45UifIo cS204IdYCmR9uACiUuLZ7skFpmhScySaOD2vKNsoIci6/pKIqnknupWFj8XRMOiiVDcJ djSM7e9G5hrRF797mzt2j4imMDnsMpQ5FMDG3nT1YsZmISpWVENGMMPHhOROba+yr2p8 AuF0NlBOsDK6JsyDdX+nnIUagzI2ltE/nQr8Zo+51a9cZtatauhY1YYS7yCwn3sE09PK fTa9q5J6VSmGWEwuCm0j2q5DMimHsEw+JrqBD+BdENuhGaR5G7IpV0Eqvg/qQTs6ndKQ pRmw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=FCHE6jmJHvvf4ZOfPHyOAwxkEw7udl1CJtgxI9QEJbs=; b=MHDnEMkXTCYA4odEi9fw9dn/RncpWeT2zkGtOT6pbrARK8Mx18fptFvXETwtTsAnu+ LSZk0pgtEUrG/LoUczQeNrHO009nQiZdi38sK21Wk4VmibsOK3IUPf9BliAJdaHYIUoy Ac8gZNsCvEyC8yYMtcDCpykGyJyhcAk5cbrUSfLYS5xYfEyuYtcHqTp4YmOnYbwEBcjQ EesbtcwfoSIb1PnZ40NHYeoEWREzLzfEyIFfIopsuLyKB0t1qgfwbxaEVLPtD6i6yLqo hmrp3FLLm+wczW1IvK7Q9s0F1VrUXZJyBzBQM6rJqt/PZ4KIc+LTShbC4RzztdJ3THwD IuWQ== X-Gm-Message-State: APjAAAX6cgmBiDUUG4FgjQTwjwzaQAk9gtf1aWf4Hv4evBPujuEMu85+ ykC6HDo2ASHp/DO+944zKcnyB3ZlBZQ= X-Received: by 2002:a63:1d2:: with SMTP id 201mr40137242pgb.307.1563862473622; Mon, 22 Jul 2019 23:14:33 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id k36sm43336181pgl.42.2019.07.22.23.14.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jul 2019 23:14:32 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH V2 04/10] cpufreq: powerpc_cbe: Switch to QoS requests instead of cpufreq notifier Date: Tue, 23 Jul 2019 11:44:04 +0530 Message-Id: <524de8ace0596e68a24b57b3b4043c707db32ca7.1563862014.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The cpufreq core now takes the min/max frequency constraints via QoS requests and the CPUFREQ_ADJUST notifier shall get removed later on. Switch over to using the QoS request for maximum frequency constraint for ppc_cbe_cpufreq driver. Signed-off-by: Viresh Kumar --- drivers/cpufreq/ppc_cbe_cpufreq.c | 19 +++++- drivers/cpufreq/ppc_cbe_cpufreq.h | 8 +++ drivers/cpufreq/ppc_cbe_cpufreq_pmi.c | 96 +++++++++++++++++---------- 3 files changed, 86 insertions(+), 37 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b Signed-off-by: Viresh Kumar diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c index b83f36febf03..c58abb4cca3a 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq.c +++ b/drivers/cpufreq/ppc_cbe_cpufreq.c @@ -110,6 +110,13 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) #endif policy->freq_table = cbe_freqs; + cbe_cpufreq_pmi_policy_init(policy); + return 0; +} + +static int cbe_cpufreq_cpu_exit(struct cpufreq_policy *policy) +{ + cbe_cpufreq_pmi_policy_exit(policy); return 0; } @@ -129,6 +136,7 @@ static struct cpufreq_driver cbe_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, .target_index = cbe_cpufreq_target, .init = cbe_cpufreq_cpu_init, + .exit = cbe_cpufreq_cpu_exit, .name = "cbe-cpufreq", .flags = CPUFREQ_CONST_LOOPS, }; @@ -139,15 +147,24 @@ static struct cpufreq_driver cbe_cpufreq_driver = { static int __init cbe_cpufreq_init(void) { + int ret; + if (!machine_is(cell)) return -ENODEV; - return cpufreq_register_driver(&cbe_cpufreq_driver); + cbe_cpufreq_pmi_init(); + + ret = cpufreq_register_driver(&cbe_cpufreq_driver); + if (ret) + cbe_cpufreq_pmi_exit(); + + return ret; } static void __exit cbe_cpufreq_exit(void) { cpufreq_unregister_driver(&cbe_cpufreq_driver); + cbe_cpufreq_pmi_exit(); } module_init(cbe_cpufreq_init); diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.h b/drivers/cpufreq/ppc_cbe_cpufreq.h index 9d973519d669..00cd8633b0d9 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq.h +++ b/drivers/cpufreq/ppc_cbe_cpufreq.h @@ -20,6 +20,14 @@ int cbe_cpufreq_set_pmode_pmi(int cpu, unsigned int pmode); #if IS_ENABLED(CONFIG_CPU_FREQ_CBE_PMI) extern bool cbe_cpufreq_has_pmi; +void cbe_cpufreq_pmi_policy_init(struct cpufreq_policy *policy); +void cbe_cpufreq_pmi_policy_exit(struct cpufreq_policy *policy); +void cbe_cpufreq_pmi_init(void); +void cbe_cpufreq_pmi_exit(void); #else #define cbe_cpufreq_has_pmi (0) +static inline void cbe_cpufreq_pmi_policy_init(struct cpufreq_policy *policy) {} +static inline void cbe_cpufreq_pmi_policy_exit(struct cpufreq_policy *policy) {} +static inline void cbe_cpufreq_pmi_init(void) {} +static inline void cbe_cpufreq_pmi_exit(void) {} #endif diff --git a/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c b/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c index 97c8ee4614b7..0babb27c1c72 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c +++ b/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -24,8 +25,6 @@ #include "ppc_cbe_cpufreq.h" -static u8 pmi_slow_mode_limit[MAX_CBE]; - bool cbe_cpufreq_has_pmi = false; EXPORT_SYMBOL_GPL(cbe_cpufreq_has_pmi); @@ -65,64 +64,89 @@ EXPORT_SYMBOL_GPL(cbe_cpufreq_set_pmode_pmi); static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg) { + struct cpufreq_policy *policy; + struct dev_pm_qos_request *req; u8 node, slow_mode; + int cpu, ret; BUG_ON(pmi_msg.type != PMI_TYPE_FREQ_CHANGE); node = pmi_msg.data1; slow_mode = pmi_msg.data2; - pmi_slow_mode_limit[node] = slow_mode; + cpu = cbe_node_to_cpu(node); pr_debug("cbe_handle_pmi: node: %d max_freq: %d\n", node, slow_mode); -} - -static int pmi_notifier(struct notifier_block *nb, - unsigned long event, void *data) -{ - struct cpufreq_policy *policy = data; - struct cpufreq_frequency_table *cbe_freqs = policy->freq_table; - u8 node; - - /* Should this really be called for CPUFREQ_ADJUST and CPUFREQ_NOTIFY - * policy events?) - */ - node = cbe_cpu_to_node(policy->cpu); - - pr_debug("got notified, event=%lu, node=%u\n", event, node); - if (pmi_slow_mode_limit[node] != 0) { - pr_debug("limiting node %d to slow mode %d\n", - node, pmi_slow_mode_limit[node]); + policy = cpufreq_cpu_get(cpu); + if (!policy) { + pr_warn("cpufreq policy not found cpu%d\n", cpu); + return; + } - cpufreq_verify_within_limits(policy, 0, + req = policy->driver_data; - cbe_freqs[pmi_slow_mode_limit[node]].frequency); - } + ret = dev_pm_qos_update_request(req, + policy->freq_table[slow_mode].frequency); + if (ret) + pr_warn("Failed to update freq constraint: %d\n", ret); + else + pr_debug("limiting node %d to slow mode %d\n", node, slow_mode); - return 0; + cpufreq_cpu_put(policy); } -static struct notifier_block pmi_notifier_block = { - .notifier_call = pmi_notifier, -}; - static struct pmi_handler cbe_pmi_handler = { .type = PMI_TYPE_FREQ_CHANGE, .handle_pmi_message = cbe_cpufreq_handle_pmi, }; +void cbe_cpufreq_pmi_policy_init(struct cpufreq_policy *policy) +{ + struct dev_pm_qos_request *req; + int ret; + + if (!cbe_cpufreq_has_pmi) + return; + + req = kzalloc(sizeof(*req), GFP_KERNEL); + if (!req) + return; + + ret = dev_pm_qos_add_request(get_cpu_device(policy->cpu), req, + DEV_PM_QOS_MAX_FREQUENCY, + policy->freq_table[0].frequency); + if (ret < 0) { + pr_err("Failed to add freq constraint (%d)\n", ret); + kfree(req); + return; + } + policy->driver_data = req; +} +EXPORT_SYMBOL_GPL(cbe_cpufreq_pmi_policy_init); -static int __init cbe_cpufreq_pmi_init(void) +void cbe_cpufreq_pmi_policy_exit(struct cpufreq_policy *policy) { - cbe_cpufreq_has_pmi = pmi_register_handler(&cbe_pmi_handler) == 0; + struct dev_pm_qos_request *req = policy->driver_data; - if (!cbe_cpufreq_has_pmi) - return -ENODEV; + if (cbe_cpufreq_has_pmi) { + dev_pm_qos_remove_request(req); + kfree(req); + } +} +EXPORT_SYMBOL_GPL(cbe_cpufreq_pmi_policy_exit); - cpufreq_register_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER); +void cbe_cpufreq_pmi_init(void) +{ + if (!pmi_register_handler(&cbe_pmi_handler)) + cbe_cpufreq_has_pmi = true; +} +EXPORT_SYMBOL_GPL(cbe_cpufreq_pmi_init); - return 0; +void cbe_cpufreq_pmi_exit(void) +{ + pmi_unregister_handler(&cbe_pmi_handler); + cbe_cpufreq_has_pmi = false; } -device_initcall(cbe_cpufreq_pmi_init); +EXPORT_SYMBOL_GPL(cbe_cpufreq_pmi_exit); From patchwork Tue Jul 23 06:14:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 169481 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8446859ilk; Mon, 22 Jul 2019 23:14:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHLzu7ac8V7nHgI5l+5vTETQjSZ5/Q+JpLiOHn0X7f3QAughZBfNtYviAPTB81FkK3fz3G X-Received: by 2002:a62:198d:: with SMTP id 135mr4051949pfz.169.1563862489492; Mon, 22 Jul 2019 23:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563862489; cv=none; d=google.com; s=arc-20160816; b=reokr4EltqwKATNGTAoYVFTNcuFrjxhOfNut8vxhKty/iiVdL91YcNzhJQ9Bc+cjhp fRo2WGFrga/M24QI5mCe7fqbYrLThXm6ZN/eGZy09dX6X2sUxP3gEAbxP4uba957T03b ypolhFAY26xp/xh1oVr+ACwreG7mIGbjLs+DmP/5aPXwQrXcbKiKBBRHASeJSav4kuQM McEjSginJ6245iHNkfgLbqlmATAsP+fE3uVHsrv7sKT0pq0RHwEC8D/H+TcikH610VLr aM9/D/pPbMwD0yKk0D8j7RacMfhwlq125CCp0lnmWWvwcy0KaeMTCdOZi46Ozbwx7Dg9 RLeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rUdeKFVKj/j46aY/YcoOji4W0Ij6fg/KFJvYkeK7wzw=; b=rRldwiLyfimw8sAeCbwm/cBx/xEwP87dDOKK9N9M6Mtn0Ft9lnYr723A9gaVWQDtew QZWcErbpzgR70CRb5XdKl2a0mdy5QQhmzuy1Ah5CUj++S1ZEb0oL81T1eU3VBKdGmMww P55jjgClij2anbl1zM97riMIF8b9hbb+g/TdGLcJ2uk8NkamfWS/bxGQgL9KoFgL8pO/ NGr50kMbA0WBBR5HyF0iLrgyalrJOvOmC7gFMuPnLd2V1x6FYpa5IE718D3DebBD42wF kbhCOEH+JmrCHlkhUTQQG+goreW1wh4Tp/BVJsWv6jbJZgFVQvKyNNXMVgBVVFRtU3ZC JzDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YdOCMHbE; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f2si13506322pgl.74.2019.07.22.23.14.49; Mon, 22 Jul 2019 23:14:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YdOCMHbE; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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 S2388168AbfGWGOr (ORCPT + 11 others); Tue, 23 Jul 2019 02:14:47 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44884 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388164AbfGWGOr (ORCPT ); Tue, 23 Jul 2019 02:14:47 -0400 Received: by mail-pg1-f196.google.com with SMTP id i18so18866368pgl.11 for ; Mon, 22 Jul 2019 23:14:46 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=rUdeKFVKj/j46aY/YcoOji4W0Ij6fg/KFJvYkeK7wzw=; b=YdOCMHbEQbXw8KubWzfOBaz7EB1B9f22y/t/+FTFKWx6jaFEuKDB5E3Sdj+cgk/DqY C9cxtOOhSrNaS0qcgK+e3peT5VxHr1x8GRySc1B8JNaI4BFnBdNZKAcPcQwlFhAuZnHM fVZrfoQqSU7JY3To8jmisIml+v18EtMwAP2mG9m2TZV0803DLrB/agmYbIynLjJbpWGf CEx548oc6YgKawUdx4hUVc63pqEnTiPyaA84BAupYaEGnhrc2rFI0wqFtyI4YVcC2EqM TcblXyTlgI5zs0HecA/SZBqEEZyaW8DH0Iy3gUTOjqAgrxmynKEqKoeWUy9kWzXO4Cue ThYQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=rUdeKFVKj/j46aY/YcoOji4W0Ij6fg/KFJvYkeK7wzw=; b=rUjT/cBXNyp27Rx6jgaqPmjaJ/yKJrAEGWr63xxYBtz3H8QwMob3bfp2WnXsAmVZjR Unpz84SCHScKxCQo/DRVbpTL7EoV7Ufxc5nTe3mH7pcPmk7sa63Z0x0g58SGW58WmVYL zY9tohzRKGxmiWdX5FY2FTOPmJMxOUFjw2/U8vWOoqPBHAFBHddl+OqyT4Ul1SMGu8eU +9Ak/B6xUC4HRmzSbyFA1SbqOJhCpJxRi8PqIncOoM2MZBBgAfiFAmUmAzYDlPvRIDSb AwxBqL3QYg6BwSdkzV7kbWFslWtnMyV1rSeXsCL74Bmtp4GDJl9XEZn1R0/e+DyVGx62 +qLA== X-Gm-Message-State: APjAAAXGPQJmP6NzKtBuPPL29xlUEU7kbTnhJKYY0YWghFSMxkPf3QUo eI2WiwdibhfOnsluCv8fKAzRDxo5PwE= X-Received: by 2002:a63:2148:: with SMTP id s8mr73371962pgm.336.1563862486415; Mon, 22 Jul 2019 23:14:46 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id j10sm3176159pfn.188.2019.07.22.23.14.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jul 2019 23:14:45 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Bartlomiej Zolnierkiewicz Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 08/10] video: pxafb: Remove cpufreq policy notifier Date: Tue, 23 Jul 2019 11:44:08 +0530 Message-Id: <56ea0fb68b99d343b093bc517024356a18f780e7.1563862014.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The cpufreq policy notifier's CPUFREQ_ADJUST notification is going to get removed soon. The notifier callback pxafb_freq_policy() isn't doing anything apart from printing a debug message on CPUFREQ_ADJUST notification. There is no point in keeping an otherwise empty callback and registering the notifier. Remove it. Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Viresh Kumar --- drivers/video/fbdev/pxafb.c | 21 --------------------- drivers/video/fbdev/pxafb.h | 1 - 2 files changed, 22 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index 4282cb117b92..f70c9f79622e 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -1678,24 +1678,6 @@ pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) } return 0; } - -static int -pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data) -{ - struct pxafb_info *fbi = TO_INF(nb, freq_policy); - struct fb_var_screeninfo *var = &fbi->fb.var; - struct cpufreq_policy *policy = data; - - switch (val) { - case CPUFREQ_ADJUST: - pr_debug("min dma period: %d ps, " - "new clock %d kHz\n", pxafb_display_dma_period(var), - policy->max); - /* TODO: fill in min/max values */ - break; - } - return 0; -} #endif #ifdef CONFIG_PM @@ -2400,11 +2382,8 @@ static int pxafb_probe(struct platform_device *dev) #ifdef CONFIG_CPU_FREQ fbi->freq_transition.notifier_call = pxafb_freq_transition; - fbi->freq_policy.notifier_call = pxafb_freq_policy; cpufreq_register_notifier(&fbi->freq_transition, CPUFREQ_TRANSITION_NOTIFIER); - cpufreq_register_notifier(&fbi->freq_policy, - CPUFREQ_POLICY_NOTIFIER); #endif /* diff --git a/drivers/video/fbdev/pxafb.h b/drivers/video/fbdev/pxafb.h index b641289c8a99..86b1e9ab1a38 100644 --- a/drivers/video/fbdev/pxafb.h +++ b/drivers/video/fbdev/pxafb.h @@ -162,7 +162,6 @@ struct pxafb_info { #ifdef CONFIG_CPU_FREQ struct notifier_block freq_transition; - struct notifier_block freq_policy; #endif struct regulator *lcd_supply; From patchwork Tue Jul 23 06:14:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 169483 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8446957ilk; Mon, 22 Jul 2019 23:14:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwybxtf9y13fH19hYCtq7PzZGlHM1En3/keE/ylJfkdwlBWshDWc4HPpIyuBxZ6H3JLn8ic X-Received: by 2002:a65:404d:: with SMTP id h13mr73440425pgp.71.1563862494832; Mon, 22 Jul 2019 23:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563862494; cv=none; d=google.com; s=arc-20160816; b=WcqrG6kFLOaGDLoCbfr7ldvleY4XkoBDi33iae9oowO1b++yChQQHNvEKUM1T6OWju ap0sFMLkTlMtz8QlF5hw7Uc4Hqn+WKD3AkbZyaP7Fs3PpGY7Ygx38Xf4pc3sfvB7zk+7 I4ZrcxKq+iUP9of/FRiGFRSg8x7wblxLN/LW3bbemg9wzV8uTLe4OY0EeLYgmGkwUdrB BcCnp4I1EBM5JXJGhuGIkp+Vfz7M+YvyzCAOAoz4khqvLvqAzoEVdw5mJj0LIPiKz//Q np3DZQDM5a5y3CXsvpxMXBTPIjtMcb8aolHBSnXC4LXW2eAQjBUmsVF5JX1JNKMUDKHX lyWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pE9tUu3P/8w1bftggmV11VxGbS0rl+eqvKACn21icvM=; b=kqxZ0H/ftWoO89zoFcfRSaT9PZ0a0SSw7AZQdFgYfObO0mX25AshwHATy0j24gMVpQ 9q/sbzR9NaBSqtrAFiy5hraBZimwKgyU4BKu24+eZAYxEkQccScN1tz1OSzL29xp/WpL 4G7pCg/VtPpMrvovAz5qHIBkZIk2hEr4mwa0vFzXTWu4ZZmXSkJx8FUnJGJDAgG1ErZJ qRMRBX2g0yRnpmyiQcaSVzy4djrBEZ+ve/+Hu6efkkIi3fhhXkucfwILewIdHprmwKfx YIzLnI5g9hAU+VFKZoCjLqs0NvbPcl3d+hWkl+6xHGqKUrSs5is8yWz3RuEzs1BNyEyn Jn3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ukFG103P; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 189si12002942pgj.416.2019.07.22.23.14.54; Mon, 22 Jul 2019 23:14:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ukFG103P; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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 S2388163AbfGWGOx (ORCPT + 11 others); Tue, 23 Jul 2019 02:14:53 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38354 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388176AbfGWGOx (ORCPT ); Tue, 23 Jul 2019 02:14:53 -0400 Received: by mail-pg1-f194.google.com with SMTP id f5so10041572pgu.5 for ; Mon, 22 Jul 2019 23:14:52 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=pE9tUu3P/8w1bftggmV11VxGbS0rl+eqvKACn21icvM=; b=ukFG103PF/bL7cLvjS/DEUm8Y+TFfzbryVSM7lnY7E2JAgqNadFQXZ+zzONmjxQRvN /UNtFxcDJE9E6GT1fFhmaNEdT0U6LY+fM7OLyuzdFbiF9pq/AOtrPPYgpCD7pQyMpqT8 RxNXI3sOAH+3hgE3B2gEyn6lDVa9opE8HSLJBn14tv10YYA8aPxKAtF8dkorCTcbJOLV JO7eYBtRjWSkQ5J09nJfN2iaEb1vbuaov0kgzMGIN6hiJzic3uaEe2jgeHQrAJIqdUZn DjqcHIFUYDCeqAjsTvjUIo5ZGlM7ySIuaLaeWa7YvtT2/mQ9Y+PamXkRp5Yyii2rH4zi ipuA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=pE9tUu3P/8w1bftggmV11VxGbS0rl+eqvKACn21icvM=; b=Ggz4vbJpAkk69HrXCNBGjkzSWveyUm3P3Hpn4zRNZS1ST8yjdo76d7T3fKDoOCnyR7 3wv0YaDruIlQ+Sf9r0apFUhoSIfyt7jtz2ILpOwnHT8qCuJ9RWNHrqQjwMJIKaCdfWDL v1U5bHgT7Fr9l+j2UEL00MMOk4ihST5UGB64k9/irvlMUztG5EQhTipOEXyZ1Z1i2ams 2xgANhwf+oR35mO7iNt3oN+RvGrRr4PqESeQH9MNcU7mr/LjfrLv2YhH5VjM1fg/IVcj UtkyTg0Ys9Z1IWatLNYLQBumiEnqj2zG1iKxJpJ9MfKGWFZ2+y99xAayY2/vyat12j8+ Mdaw== X-Gm-Message-State: APjAAAXqEqTyPXG8mSe88FRhbCjh/FwgNtDr3g/kR5YAYN0xdzZ2QjOr 9ZAtMwEDFhu7xPsUNFtvMVQBVYM0oQI= X-Received: by 2002:aa7:90d8:: with SMTP id k24mr4051781pfk.115.1563862492359; Mon, 22 Jul 2019 23:14:52 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id f3sm65402869pfg.165.2019.07.22.23.14.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jul 2019 23:14:51 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Jonathan Corbet Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 10/10] Documentation: cpufreq: Update policy notifier documentation Date: Tue, 23 Jul 2019 11:44:10 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Update documentation with the recent policy notifier updates. Signed-off-by: Viresh Kumar --- Documentation/cpu-freq/core.txt | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/Documentation/cpu-freq/core.txt b/Documentation/cpu-freq/core.txt index 55193e680250..ed577d9c154b 100644 --- a/Documentation/cpu-freq/core.txt +++ b/Documentation/cpu-freq/core.txt @@ -57,19 +57,11 @@ transition notifiers. 2.1 CPUFreq policy notifiers ---------------------------- -These are notified when a new policy is intended to be set. Each -CPUFreq policy notifier is called twice for a policy transition: +These are notified when a new policy is created or removed. -1.) During CPUFREQ_ADJUST all CPUFreq notifiers may change the limit if - they see a need for this - may it be thermal considerations or - hardware limitations. - -2.) And during CPUFREQ_NOTIFY all notifiers are informed of the new policy - - if two hardware drivers failed to agree on a new policy before this - stage, the incompatible hardware shall be shut down, and the user - informed of this. - -The phase is specified in the second argument to the notifier. +The phase is specified in the second argument to the notifier. The phase is +CPUFREQ_CREATE_POLICY when the policy is first created and it is +CPUFREQ_REMOVE_POLICY when the policy is removed. The third argument, a void *pointer, points to a struct cpufreq_policy consisting of several values, including min, max (the lower and upper