From patchwork Thu Aug 12 04:35:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495944 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639691jap; Wed, 11 Aug 2021 21:35:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXcusv2SKQiuNfKEiq07BvnKUhgkQ9iQMcQU/Gct9vv/fCkBiokMS3eN2yYCj6Nri6tfHz X-Received: by 2002:aa7:cb19:: with SMTP id s25mr3243647edt.194.1628742952185; Wed, 11 Aug 2021 21:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742952; cv=none; d=google.com; s=arc-20160816; b=BfAdjAP6Q4aW00KHtTem56sxrGujoAGymZmKU8aey1Gwkzdlk39Uh9D1pp2v2Nms2R TeLIuop9ZHF8BZdBLRVpuwltCWv4ekK8k01zi0YzbTtRGLKzuxNi+wkXgqi06ZUrAOnf nTo7ND8nlNYuDWw0idjzTtVmlwATJFLf6BQgyc5QmgLZFkvOijUysrq1NU+mWfmSwVAX CiWoS7/wPezDMUStfHzGM8Y2cM5/TaPJ3pbcScEhWFLOOUfNN9lJgGRKn92d3yCVtZOu JAHm4qwm+rOI/hfVM/Ip9hjsBiHFBi6/Ct1VgaV1BzQSx+w1sHu4mHZ9uw0s4vJntZLe u8oQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cJkxi06rEFhzSNPo56wxZ6biRKSh//pEh5NibXjmjwM=; b=qU7nYV/EBPFwrJqlJoV4FINc+7wopHNoH26xybe9j+4wln8R4tRqSB61/JLqhua8Cu uc7rmVwUKVXAtNvQMIy0xPkcNJMc4exftV6zSQeSR1Z871tEJ5J9wjY3czALGnCyqIe5 H7NhzYPfCwFonMGUnSdKCc/ybTWdmhyg/JLMAHA4njKdUVbesUPJgphEzPLbZVue7ZTb V1v+rUFsJt8na8m7bdSm1ZRVZKyfvA3wQzWWD8NywtO6iIDwI9W5E1+OZk6d3sDtI/Nz /LpmpsgoF0d5zLAe/155YeV9VrewYKrIbNtuvdUNTgG0ExM3y/FRvx5wn0GSOiQVrhm+ 96Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RAirbPPx; 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 s5si1550640edr.161.2021.08.11.21.35.52; Wed, 11 Aug 2021 21:35:52 -0700 (PDT) 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=RAirbPPx; 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 S234026AbhHLEgP (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234007AbhHLEgO (ORCPT ); Thu, 12 Aug 2021 00:36:14 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65A4EC0613D3 for ; Wed, 11 Aug 2021 21:35:49 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id a20so5674300plm.0 for ; Wed, 11 Aug 2021 21:35:49 -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=cJkxi06rEFhzSNPo56wxZ6biRKSh//pEh5NibXjmjwM=; b=RAirbPPx9tnYmbm7/B3VW4qbupcBxMwQjkcXHBx+L3yU6yxYBF+d9XUAInkPCyrn5B SRKabkuLIqGhQlNSuABj1NaR0ajNPChwmDUeed35LL86Frnk9LuGSVhl8oC2mIb1cF/b yWV54ZAS63LGN4XEqb8kAUqSNuoOoa9W1N1iNJEHnxpTf8vzopA7ovS5/kMJVQbHxFBn UZpWcqkInRb/D+Bhw1CfSBdQBAQ3aXcnxN9ePDT8ZVUWeA2QLEy/L3VJMXneTioQvsZB xz2bPCW/ZmYqSctomgT4xIc1fkwxBAPCDp7Un6a+dU2aKGT9/k+VH2uL69KgTJNzGdgx I/wQ== 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=cJkxi06rEFhzSNPo56wxZ6biRKSh//pEh5NibXjmjwM=; b=Lw0dLjNrhZr8eS3lKuE5LTkqHxZj2Fzog/N9HhXRlWQcYd/3PgIkoOuz6NIDTIyW6P hfZjreSxXY9xnfbLj2fq9IYXk0z+u8/Fb8XMEe+iMPk45S5K6Mb7VpY4GB4Y4I3bWHNd xgtxyCg8qdryDIluRhBYN8jUqWMnDzn0zTMCZePB9E16uDv0tfFG0suxDIjp+x6Gfnpt UJ4//LB4CFcJiNZjv673TSIt6nHsat1CaDxQolST9Oe/3GFn2TtIJxJ3vI7P0S0Joa8G /r1JLAem0GvOcyDsDjRyjSWsaOFo2Rkfx0yhJjNIADZQkPi5wG0F8eLSyiH93oQKz4c0 oK5g== X-Gm-Message-State: AOAM531vIY6P94p1VdTWl9k3fyhD0afRpol26WlU1hxg7MTU440mnz4p IQDkQMYdf2GSHyGAxb67SKPTDg== X-Received: by 2002:a17:902:a702:b029:12b:aa0f:d553 with SMTP id w2-20020a170902a702b029012baa0fd553mr2035019plq.3.1628742948946; Wed, 11 Aug 2021 21:35:48 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id s14sm1268828pfg.220.2021.08.11.21.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:35:48 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH V3 1/9] cpufreq: Add callback to register with energy model Date: Thu, 12 Aug 2021 10:05:14 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Many cpufreq drivers register with the energy model for each policy and do exactly the same thing. Follow the footsteps of thermal-cooling, to get it done from the cpufreq core itself. Provide a new callback, which will be called, if present, by the cpufreq core at the right moment (more on that in the code's comment). Also provide a generic implementation that uses dev_pm_opp_of_register_em(). This also allows us to register with the EM at a later point of time, compared to ->init(), from where the EM core can access cpufreq policy directly using cpufreq_cpu_get() type of helpers and perform other work, like marking few frequencies inefficient, this will be done separately. Reviewed-by: Quentin Perret Reviewed-by: Lukasz Luba Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 13 +++++++++++++ include/linux/cpufreq.h | 14 ++++++++++++++ 2 files changed, 27 insertions(+) -- 2.31.1.272.g89b43f80a514 Tested-by: Vincent Donnefort diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 45f3416988f1..d301f39248a0 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1491,6 +1491,19 @@ static int cpufreq_online(unsigned int cpu) write_lock_irqsave(&cpufreq_driver_lock, flags); list_add(&policy->policy_list, &cpufreq_policy_list); write_unlock_irqrestore(&cpufreq_driver_lock, flags); + + /* + * Register with the energy model before + * sched_cpufreq_governor_change() is called, which will result + * in rebuilding of the sched domains, which should only be done + * once the energy model is properly initialized for the policy + * first. + * + * Also, this should be called before the policy is registered + * with cooling framework. + */ + if (cpufreq_driver->register_em) + cpufreq_driver->register_em(policy); } ret = cpufreq_init_policy(policy); diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 9fd719475fcd..c65a1d7385f8 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -9,10 +9,12 @@ #define _LINUX_CPUFREQ_H #include +#include #include #include #include #include +#include #include #include #include @@ -373,6 +375,12 @@ struct cpufreq_driver { /* platform specific boost support code */ bool boost_enabled; int (*set_boost)(struct cpufreq_policy *policy, int state); + + /* + * Set by drivers that want to register with the energy model after the + * policy is properly initialized, but before the governor is started. + */ + void (*register_em)(struct cpufreq_policy *policy); }; /* flags */ @@ -1046,4 +1054,10 @@ unsigned int cpufreq_generic_get(unsigned int cpu); void cpufreq_generic_init(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table, unsigned int transition_latency); + +static inline void cpufreq_register_em_with_opp(struct cpufreq_policy *policy) +{ + dev_pm_opp_of_register_em(get_cpu_device(policy->cpu), + policy->related_cpus); +} #endif /* _LINUX_CPUFREQ_H */ From patchwork Thu Aug 12 04:35:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495945 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639748jap; Wed, 11 Aug 2021 21:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye00XRw9+Icq5JY/GpNrz7PAY0711AA/N2T8OPXCsWBO3xanG3nuEgnSrGJSEM5WoioNBE X-Received: by 2002:a05:6402:1215:: with SMTP id c21mr3120294edw.137.1628742958745; Wed, 11 Aug 2021 21:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742958; cv=none; d=google.com; s=arc-20160816; b=MCNQvTGig+V8ZAZ653prIWQX7oGTI+zSNPxch7hA/ekRH79xM5MwZjaDn8esoaC2B5 jpA4FjXAskmPj6zW+vNhtCV2/Vf/mZyfHy9WV+HJrS+8V3T/jbPRYQCbDkFvuYmk2FCc 67I1g6FMi0fInDRPaufxCJWVkJP9gmfTwNS4KB8Phmrnn5vUq5wFzKYNLTzsAhEeCfy9 TaQibTiqHIGnpioEloc+X69ENE+/Tkm4BoQjnzvdyp7lS+fRLlokjoIHDpqem2iOA+s0 1X2V7O6OqY3CzeDXf2DiPMKafXGsBkKyftsobxLg+z4rM9PEU2ZndptGExnI5OZM+qXU Js0Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k48YyjS9KRlRanFe/kfIE1R2AlXiENKsFw9f6TRi87E=; b=sDl+P0lLrGPd3GQDyUDHfVoi0FE3sB1ey8V6omHL/XaeHWsZ5YIeCQ2cSFl1wR7Pc5 kwIrQfsqcxGmuEfe7hMK5plqbe/xpMb/E3CFqwCTbdjH43Ivjcjz182iVaNwP+9nyrE9 Szas/MI9AewWPDjAuu6p2M05l4yucptQtLXRZW46e5WXm0pPJ88lvTnYavgRf7YoW44M SQ1gwhkZ5YxSfP3Vv9hDz5RhWrQvjSA2EldMKbgzflBeGSxoTcH7gD5LTwH/4nViF2EV xYxZU0Zrob+7SDYZyZVc939hM8TO39hT/lAAWaRYQexUcVZakhVWPS/WT89sjB9/t5KX fXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tN9B5k4m; 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 s5si1550640edr.161.2021.08.11.21.35.58; Wed, 11 Aug 2021 21:35:58 -0700 (PDT) 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=tN9B5k4m; 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 S234053AbhHLEgR (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234036AbhHLEgQ (ORCPT ); Thu, 12 Aug 2021 00:36:16 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ED67C061765 for ; Wed, 11 Aug 2021 21:35:52 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id a20so5674410plm.0 for ; Wed, 11 Aug 2021 21:35: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=k48YyjS9KRlRanFe/kfIE1R2AlXiENKsFw9f6TRi87E=; b=tN9B5k4mmcraApnfbxQl5mSz8yiBDtzXSKYvcsLtFW80z4amA5SAE+BAn3vLkujR9+ h6zMKm2sm9uZ6vPq+28lMbKGnA15WOdpBsJISdSfQlFz6KUqnD23F0EPiMzWr+SwfVX7 b6R86wjg0a1B/sa8LZk3dGMu+dfC4uOdqvmtp0iD5blno6FxTLbA1RTQ3ZTapWpRJs5c 7XFOCVVzhW+JA4lIHiag8SSj/2/blzgEFinlVw3ZZC2s4Y+QPTBY0qwBZaVuMZBAyUkE w0lqq9lop8oIL9zpQPXf3f+kNAttFKGQlCnSY43LI3lAlHGftrOxizAemBajMbeED1c2 DhBA== 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=k48YyjS9KRlRanFe/kfIE1R2AlXiENKsFw9f6TRi87E=; b=dNCPTGb2/w6rRL68owD8BSmxUPgEyJBEyD0Lwe/0B5QskvSKYyOPMCxSQRXFIVXmMy nhG0eeO3/bxqzd3pG5UDkFZ42ya1hEuwYrh5UX4HEfvTdNwyrgaC3kku0svssddpkNaR Pda5huduOtq0vnr8amtraA3xgbrcS0dvLRSTBHnKyNeLuaP7MwB+XoWE18fdhN9b+tpT umWhZ0rZZEVUCGjjQW876pLy93pMHwvTyksFsOSoPSvmQ58L9or8GtXvGHBi6o5ZWrWj 2zU/R7Ta0rmt6hHfSVNxNDQNTpAwkzqdhEc7t1drpCUi5iXzvMhJwgG5ViCDhiPtWcfZ Bsqg== X-Gm-Message-State: AOAM530rEWBelanbp0TRdQlRE8Umo5lbtw1DHy4t1zJ03OFQiUkTwPVK 3Mi+WYA2zGGTwrvgrc0Ermj05A== X-Received: by 2002:a17:90a:4987:: with SMTP id d7mr4856388pjh.46.1628742951640; Wed, 11 Aug 2021 21:35:51 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id 128sm1330009pfe.55.2021.08.11.21.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:35:51 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH V3 2/9] cpufreq: dt: Use .register_em() to register with energy model Date: Thu, 12 Aug 2021 10:05:15 +0530 Message-Id: <94ab4c3c259c7d00746e5cafb55b5f5125f34b71.1628742634.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.31.1.272.g89b43f80a514 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index ece52863ba62..8fcaba541539 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -143,8 +143,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) cpufreq_dt_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs; } - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - return 0; out_clk_put: @@ -184,6 +182,7 @@ static struct cpufreq_driver dt_cpufreq_driver = { .exit = cpufreq_exit, .online = cpufreq_online, .offline = cpufreq_offline, + .register_em = cpufreq_register_em_with_opp, .name = "cpufreq-dt", .attr = cpufreq_dt_attr, .suspend = cpufreq_generic_suspend, From patchwork Thu Aug 12 04:35:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495946 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639797jap; Wed, 11 Aug 2021 21:36:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi06dClpuF7OaeAjrasOM2YaXLXix4RIp+s/nI+ajOsvXE8voTMnQmEb2qq/ISoG40piQK X-Received: by 2002:a17:906:d52:: with SMTP id r18mr1791175ejh.47.1628742963146; Wed, 11 Aug 2021 21:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742963; cv=none; d=google.com; s=arc-20160816; b=cS1FV+E6NinMbsr1BPDTG7ZE3LudDtP9fAZycunc4QjwQflOzyk48Ct0notFqRW4vc 9mM4ptjdlZLqwqrma8jWCB3YDa+7SR5ACldFCnCyrGPECDeMFP4SvB6Ihn0RARPv14F5 KFGS1eyAFm35QQdPJINSqTd1UcELAvuFlnBaC0SOz5ooFlgI5t2d9Ko7TSVOIs8IbuAk /Uu/37KSrwHclhC65b6Pn0r0+cFqonDmrTi1+Q+6vuSzpbrMtWC+IgdVWkfsYBoCMCF7 hkbuhtRZQgvdDLsvY9qa+W+MFEfwILpv5dig5fqImKq3ukenMoLPZdOUDzTo1j4ICLdw n2Nw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HAdryzVWDItJYYyaDLA7TehMKmxc7AbVJUX+CfkiRLM=; b=OAgUvXLfw0qhFdShrbMJs5fXpUHxDxaPV1KrESV6r4cvKCa8b1xIKV2pWLaA3Jh0t0 O9L5G2Hli8LqE+84VBj0XZBl+jeGDUqoZtDyOyRuB3QLdl8IUwBvN1BrCxSXkDLFDwDj EXvQpNzvDAtgzn7Jw/ZUkOgqfGkMMV3CM37+edomhhGLkEW5jBjvyPnGCJrC9zylfnmI RxyZTUAxHPYswh7ut0gcC2c6+co10CicZ9wUR9BOUoZrg6XU8I9EUAOJBPMsC4O2/W+x BFkNqBh1XpmTCODBhWyon8i0bo86FPpZbpttAXXLPRD44paZGgUM9D7O7wVorTO/F8yy jhIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xzANoon5; 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 s5si1550640edr.161.2021.08.11.21.36.02; Wed, 11 Aug 2021 21:36:03 -0700 (PDT) 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=xzANoon5; 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 S234018AbhHLEgZ (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234067AbhHLEgT (ORCPT ); Thu, 12 Aug 2021 00:36:19 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA875C0613D3 for ; Wed, 11 Aug 2021 21:35:54 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id w13-20020a17090aea0db029017897a5f7bcso8686489pjy.5 for ; Wed, 11 Aug 2021 21:35:54 -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=HAdryzVWDItJYYyaDLA7TehMKmxc7AbVJUX+CfkiRLM=; b=xzANoon5SbQWRFGC1BUPcxuFt4rcYZc8/rPCpYUjdCqey0034wFpO6mH6LFYSEQvVw 2nxj3THpCJA9kO5visFyu0mNL/9jkIuuPPeveXEv89LFPKOeCUuYSeVr8aXD1aX8X/QF rKU17iP/WdMU+QYu8OaNypVR6mGiZdu/WjazUaCM+rhTWa3sq5BWK1ljtVWIB60NYXwl rcIzGW+1/IoEaw0ZnCkWrPG9RQPm5bJR0fp/2VJ8Br8bpi+zrPG23NvlXOMqcezp3AfZ XS4DasrPso/XizZc3lRn9FPzcJwvOxedKzWzqV8tey/IS9cTyqwSBhl09rQfG7MvLBf0 YPeQ== 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=HAdryzVWDItJYYyaDLA7TehMKmxc7AbVJUX+CfkiRLM=; b=YRY7jJqqqj+6HGW07PTrOyXAdVpmDaXigKrhfywfSt+p3+IuMZwmsoVvPs7HHdRk+8 Q+YDnvrGf4uWwlea9QMl/YaBDZl07jNPA8N8rMNhcqp09eG+Mj2YQsw6DNtMRdVMaH6c rfAO6tMtP0WaQGVWgmrt4akPLT8N2DVHoraRhFokRfiMwphYDJX0LWTg/eM11Caz/W2T bECDd8WFOhSCAtS790PPM5/KgfNK+lvKKcA4aqh6Frtc2YPZJeLCrpWzQpzqaeUVjGV6 AEd66FVjrpHTGIEeZCcDiyLlsy9ENtWc9u+7i+Uk/uRBGGLT8QeBljtMzbH6Z1tR3vF5 fGiA== X-Gm-Message-State: AOAM53375Ml5yLz2C9y5iPs6WteQNwrpz0yeu1XXpfPQA79QqH2e4qjc p1qsFVJJvO/HTpodfzxXsiyqWQ== X-Received: by 2002:a62:3082:0:b029:3cb:52bd:c0ab with SMTP id w124-20020a6230820000b02903cb52bdc0abmr2310147pfw.56.1628742954426; Wed, 11 Aug 2021 21:35:54 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id q1sm1377480pfn.6.2021.08.11.21.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:35:54 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 3/9] cpufreq: imx6q: Use .register_em() to register with energy model Date: Thu, 12 Aug 2021 10:05:16 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar --- drivers/cpufreq/imx6q-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.31.1.272.g89b43f80a514 diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 5bf5fc759881..90beb26ed34e 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -192,7 +192,6 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) policy->clk = clks[ARM].clk; cpufreq_generic_init(policy, freq_table, transition_latency); policy->suspend_freq = max_freq; - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); return 0; } @@ -204,6 +203,7 @@ static struct cpufreq_driver imx6q_cpufreq_driver = { .target_index = imx6q_set_target, .get = cpufreq_generic_get, .init = imx6q_cpufreq_init, + .register_em = cpufreq_register_em_with_opp, .name = "imx6q-cpufreq", .attr = cpufreq_generic_attr, .suspend = cpufreq_generic_suspend, From patchwork Thu Aug 12 04:35:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495947 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639810jap; Wed, 11 Aug 2021 21:36:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZS6qsn6v6vODmyYc0WavJPx6Pgbt4BX59wa+Pb+WLcpSv2gHeCNlYcHxlHDl6Al60YvFo X-Received: by 2002:a05:6402:27cf:: with SMTP id c15mr3186270ede.268.1628742964884; Wed, 11 Aug 2021 21:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742964; cv=none; d=google.com; s=arc-20160816; b=dFAN9GK+2IKKQNy/18UWe9HkaUX6HdcZMG6x4yajDgUrxo7z3wXwk0XzCqTyQV6UlV fsMX2OqG8MhuTG15CD3OImL0X1pw6DQcBHRkqQIxNjcO3QqezjmPVqzkjNpPMUVSqQ0p fCLF93VcPXjsP3YSUtZF+4nIZaM9MW5HUwmZoLekxqUDIvpE/8+WlGYEuE+HcXq3uXKZ /9uJk2aObbN/lkw9VT/AgmXJe5t/rBPBb6oU4U7cDiSkUkVF/JZCtSrbg1OtCITJpMgn 3SPeDEN+w4MRfyoUyIriFCzgX56z6asRRA8NzucbLrj42FekoXTTYqwjNocGacyEYPwd Tq4w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5B6LAGyn6qpvhvvXqvmp0F5nk8/QX8RYvQTVx1M0/gM=; b=q2mFFk0KqdhnyNPbY1i6yZPrdLprvKL+9gMRuQWG2QghWqQL6aGXypERL1emI6uhca gTqWz2NVzdv0CV2o0Q1wJtSYh8qpf+Y2XpksqaiPblF89s1Avfa3FQdT5nwEHe/7Byx0 lgB3znuGVcRrQOZUlMK1Lrh3CVRFxRPz8v/QP4cfRgSU65VFJ3PuvH5PsfMtk9PG8lgi DntDyY2k1t/LjAbShmVXePrkSalrxaIswp9osgQ7XQfeq00ELjgBmc+oz9NjBEhUcjY6 MptkFiM9Luob8wKHJGtC5/LrVtBu9uSmDPDd/BC0pttb+7TDxJSJh1Ml+gaxj+x8SP6q vliQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QP4d91nK; 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 nd36si1498955ejc.253.2021.08.11.21.36.04; Wed, 11 Aug 2021 21:36:04 -0700 (PDT) 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=QP4d91nK; 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 S234069AbhHLEg0 (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234037AbhHLEgV (ORCPT ); Thu, 12 Aug 2021 00:36:21 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77745C061799 for ; Wed, 11 Aug 2021 21:35:57 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id b7so5619659plh.7 for ; Wed, 11 Aug 2021 21:35:57 -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=5B6LAGyn6qpvhvvXqvmp0F5nk8/QX8RYvQTVx1M0/gM=; b=QP4d91nKyPuYgkXOj2993WRqr7vFWjzAt2pAYEpOqBJrX79KK7X7Lye9RW33nVemOS glTh3230AbIEle58TNmDHg+mGlObfxcChEqEIgpM51UFcNuoT5t2gwEZYo9rstSe+BUh G8oAVPZc4Or2lHFxR9TnUcIaCZpTTeNW497UmbMV9rdrFsDQX3C4DbEyHzT9ETDcJuHH 44M487nZNgj5a1TirMtTv5x8vkPi0ZRWgBVRFM/hm1MZ4gPWlnqSsL9XbuORZM21Fqvq 2Kb9HOtRennF8T/9AvDxP+8H2lNL1JiYws1Z/YqfyQ//45J/2m8OCM9lP/bKaiSF0mx/ SA2w== 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=5B6LAGyn6qpvhvvXqvmp0F5nk8/QX8RYvQTVx1M0/gM=; b=ruXxMX9v9HBVdmDLQbAgG5ywRjg5MjnjZJXkQI3JwSBvZvZR4bvpP6AQkCBGrKBdX9 cMvwE+kxwLPfBNtTqx85xjci6Zo3jAj7xDuTHWvacpD598bJ7B253ZXtN/tkxBsULkFW /D+WdkLjfwje1WXniRmT/LZ2inAFv+mQs/p2A5qGGsgGeYBq9DPWACX/0vszzCphMyKq 1Sv11ig8R5sC4HcpZRxAxE7x9OaewnsZT9MTyAql1bhY68As2tUUtZF/3O/i++MJORH9 y/addNczouj/jGb7Feilc/tR3ijydY2GmNtIxLE3zUOYTln0HfdZP7z/COv7I+qTtmrK kFgA== X-Gm-Message-State: AOAM533sQzGHqUccQcBCc396KjS1zQ8ZVbJSPpiBxW+XVwbJI09BAVpv WQrvp9OjHzSJtaOMFnVVPlXWWjVZ4xK8Fg== X-Received: by 2002:a17:902:bc41:b029:12d:3f9b:401e with SMTP id t1-20020a170902bc41b029012d3f9b401emr2042045plz.47.1628742957070; Wed, 11 Aug 2021 21:35:57 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id v31sm1420379pgl.49.2021.08.11.21.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:35:56 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Viresh Kumar , Matthias Brugger Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH V3 4/9] cpufreq: mediatek: Use .register_em() to register with energy model Date: Thu, 12 Aug 2021 10:05:17 +0530 Message-Id: <3701fd64a3fb947fc805ca0d108ab87562a9659b.1628742634.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar --- drivers/cpufreq/mediatek-cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.31.1.272.g89b43f80a514 diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index 87019d5a9547..866163883b48 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -448,8 +448,6 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy) policy->driver_data = info; policy->clk = info->cpu_clk; - dev_pm_opp_of_register_em(info->cpu_dev, policy->cpus); - return 0; } @@ -471,6 +469,7 @@ static struct cpufreq_driver mtk_cpufreq_driver = { .get = cpufreq_generic_get, .init = mtk_cpufreq_init, .exit = mtk_cpufreq_exit, + .register_em = cpufreq_register_em_with_opp, .name = "mtk-cpufreq", .attr = cpufreq_generic_attr, }; From patchwork Thu Aug 12 04:35:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495948 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639862jap; Wed, 11 Aug 2021 21:36:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTq/QJU5urou2GaNDBIRS6/McqXJrVJsrZdYLEHv1E1XwyE987zwwAs6jWOhQBw718bEsY X-Received: by 2002:a17:906:64a:: with SMTP id t10mr1831239ejb.5.1628742969598; Wed, 11 Aug 2021 21:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742969; cv=none; d=google.com; s=arc-20160816; b=iel8Pr0xmo2okE/I8SX2N7NJo54OBNOLEsRNcXBbzxQIAIyN7suIaJ0tiPUmnOIlql yjmNho8gnj2oTAdSUCP9J8qBjoPh4GcUGU2bQnHDh0OrK1vTm5K+sSSwp2ozaEYQ++Dx XzxqA56arSDQmRHIhaeut8po7RQD4fyCu9lSJQRG+ZitKKvdhuF4A5fwFwodaY1/V1w2 k43UwXMatL43lv990I/ClqKRmu5hEpn6/97DTWz0skDUNsYcVFy34kR9/yQ89czMCyFq T6HFTgMu5jFAH+750UmenI1IxJ+e5YFcuQCE0tQag/G/BO5c5Ka0FHBNdKH+a+xS65wS Oqxw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xQGKod+1toETrZZygbeTDI/UD9O56l1AgluTcAmsQr0=; b=FIM5FdyQi6riEVz6m0V45aZa4TNbNPa2Ic/VCu2h9QQ3lpMZdiWvPmwl57N8715+Kv iqS6vPLtiFBVJ9EpQKwbdFe5TIC45Qtpe8tEndPd7oJqOd/jXvRmfUAQldZ7Q5jboE3e RSgDvPqiviJ46Ju7iUzLKCrKEPTxPazdHpju4bfFqSAQhHbQMlKWiF8pvWEXadS/HNm9 eXUV++gtMSwtPgpd6JFu+5Q+jAmrFsoOkKY9EtwmMCfqhNxed8TFYb8HeqCawYPmAKD7 su5QsIFTVkl1Mx2E/SbsMi2SQfRftjEeB4MgTEhnbUB7/GA0v7GAr22Zhkn5N7JDhTJg jWEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hpGYNDBG; 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 q15si1215298ejs.626.2021.08.11.21.36.09; Wed, 11 Aug 2021 21:36:09 -0700 (PDT) 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=hpGYNDBG; 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 S234047AbhHLEgc (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234093AbhHLEgZ (ORCPT ); Thu, 12 Aug 2021 00:36:25 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E9DC06179F for ; Wed, 11 Aug 2021 21:36:00 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id gz13-20020a17090b0ecdb0290178c0e0ce8bso7848920pjb.1 for ; Wed, 11 Aug 2021 21:36:00 -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=xQGKod+1toETrZZygbeTDI/UD9O56l1AgluTcAmsQr0=; b=hpGYNDBGEyQkLVHPIW1XmsAQfqm6lMtcizJZT9wFryqif4CvN6lQx93IkKP+CIH8RC 3ne6sueHneC5rp8enoVSBifcSV46fJ4r1rdWZFacDGaU2r5q3yG0w1EYLkgwfXhkbpDg a7wE0mqWmfyfHb7mozVb34JlMjsJq0P0s/XK6pcoh3YxlMODM8llnCSTngTAthw6U0Ab j0+ktxEXSk5SSG29DI1dvgDO9qhDBmMhNWgJI9ScSMFXWzd/w0n/oWZqiptOp710AGFO aSnYZDsdnO2aeQ6vNAf11Au7QNAkQcINdZsGQXZwPGb9K5H7Hi8jvqB+M6J6bj3cxvSk xvZQ== 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=xQGKod+1toETrZZygbeTDI/UD9O56l1AgluTcAmsQr0=; b=mLjFlIiVYJg77LD2GBVodKcdYxzPhmyrLyr6l/7LZm7sB8c6DVdGQ27cyAxZcGWW/Q H7Zk8nr76tbGQEAC9fBDvcaaWTm8o9YgzDKbD0vdrGOoPN07P9Grpud2+EPCTVGoypkj 5rXjuquGmi1FM0Z4zQQ0mFfyhAOv31JbJeuLbkHOL1NGUpQJfK1sMMfx/IeLO92NQ7Cr fqVsVmRi3FiEQCpnbF3nNr68mA9Pa33DHLsDOVO5nWHUQguifhLU+nlSW7rRBk1UX4dA 90JOHN5eUL1R0W7pKqoIN7fpq0Ts+3CuujqU3FDSDPmjx2c48DUbxDOKJJVuN+ZBo89N hcjg== X-Gm-Message-State: AOAM532a+eMVUY+vmqqKh/jrkctg2fS48c63+nGyPNgy4AtnLizM5yfg uSOP/fZWaHYVS0QDSyqDh8TL5g== X-Received: by 2002:a63:ef02:: with SMTP id u2mr2198232pgh.298.1628742959909; Wed, 11 Aug 2021 21:35:59 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id t18sm535357pfg.111.2021.08.11.21.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:35:59 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Kevin Hilman , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 5/9] cpufreq: omap: Use .register_em() to register with energy model Date: Thu, 12 Aug 2021 10:05:18 +0530 Message-Id: <361a172d230964807c0b479738749c50d95d7b50.1628742634.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar --- drivers/cpufreq/omap-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.31.1.272.g89b43f80a514 diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index e035ee216b0f..1b50df06c6bc 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c @@ -131,7 +131,6 @@ static int omap_cpu_init(struct cpufreq_policy *policy) /* FIXME: what's the actual transition time? */ cpufreq_generic_init(policy, freq_table, 300 * 1000); - dev_pm_opp_of_register_em(mpu_dev, policy->cpus); return 0; } @@ -150,6 +149,7 @@ static struct cpufreq_driver omap_driver = { .get = cpufreq_generic_get, .init = omap_cpu_init, .exit = omap_cpu_exit, + .register_em = cpufreq_register_em_with_opp, .name = "omap", .attr = cpufreq_generic_attr, }; From patchwork Thu Aug 12 04:35:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495949 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639882jap; Wed, 11 Aug 2021 21:36:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8cyiWpg5Wkzd7cFqwSezByXcuyx6QSxt572Rw7Icgcwmmp2J2ZKQ75cfLw2yW38j8oiIo X-Received: by 2002:a05:6402:408:: with SMTP id q8mr3107156edv.13.1628742972211; Wed, 11 Aug 2021 21:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742972; cv=none; d=google.com; s=arc-20160816; b=YzQtaencQ4kGk8174vZFAETrqalhjZJprlP43ACWu96oMjWfok9jpDAYUWJrsz/r9E +QjX0oOIrk8ow77FzxsieSs4RJyEWq01d2xEkAWhTRrb9COzWAigNWNFItLck0G5silx 7GOKWQRIhUBz8u3aoS4ujtKKjR7/u9trFVwaEnMAL864FhOOGsPlunWSKd2OnkIb8eGj sAXOTVUZVVrkgPuExX8rcsvAWIYoF0CFwx6TbrJqYNXlm/5zXSwHY74dlI2fvGhh8YmI +4h/5aH2lGX5T45iiXfV/oK1J5FS0UtL8TNAevXXh0wtPtLHCNH8Kc4VkoQxOCn1kATa IuZw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JOkHp31PCeB99M1dSxN1Du6uw4AQKsapMxFixRcFEa0=; b=XJVZhx9KGZSyHeoo/8c0JrIYDrpIdeQbJdnEHHKwfDVXDuRMgIVQrn+hzVqhv4GZsp CucdnZ6hpvyg4qaABTZ2S/UiKFauHUItHOSpuJVkU0F4DhhQeD3RAUUndmh3i8ED01ob qOFuMYy4cHcrYrPfT4UWO0Xzg7K3QaWVGORGElXN+HgRZVz7O0YYlSzBKOY5Clh09u17 QpWP7a1e0TYllHZN7Yh3/S3/rau3wcs3yZV+w1sWzebUT2XrOo8XRRYnySxYLlScgb3k rtK5vN6d7tILSW4t/R+ZCAhhf58k375zVHhUVG1YCwlWt3Zeho4DCfOvSXjewcvuFxHF SCpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kh7hj4I7; 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 w24si1149889eja.172.2021.08.11.21.36.12; Wed, 11 Aug 2021 21:36:12 -0700 (PDT) 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=Kh7hj4I7; 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 S234040AbhHLEge (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234057AbhHLEgc (ORCPT ); Thu, 12 Aug 2021 00:36:32 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A9CCC0617A4 for ; Wed, 11 Aug 2021 21:36:03 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id cp15-20020a17090afb8fb029017891959dcbso13235692pjb.2 for ; Wed, 11 Aug 2021 21:36:02 -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=JOkHp31PCeB99M1dSxN1Du6uw4AQKsapMxFixRcFEa0=; b=Kh7hj4I7h5CBlthAjIqogCoHqEsTXGwRK33ywj/3LXMyBATvxFhFWnw3YPLcQN7O8w 7QjH4GDLQShi7mobqrYD8nw0176v1Xpc5uvJUorIClB9Ym8UAEYjVryjjeHzLIYX9dpl XGvTT0EZ5f0r/28shwGhJzElGs0BnhohuWx5xkLbOaLjK1oS54dDiYl2A5x04CNBGlZu gvCRC/3zVpYzUhuhHpDUYiRT+01GNbz1NU8XhIgcTJJT62iN2wRbkCxN5P+svmojj6lk XezXTEQcRWc3vVYfXyVyRPh/4X/EwnCyDiMg69Rn7Hc5vqSuNtSqiH72uRlZNV8Lw1pE C9Ew== 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=JOkHp31PCeB99M1dSxN1Du6uw4AQKsapMxFixRcFEa0=; b=tIqqVj6z9HMjqytu4HkdCUe6dOC4X+I5fYgsyR8pEkhGt81T7zEGjX+regbCJV8ucy rUJVRbglHpdklGyfP9pHVl/HvpXRe7ryKtWhrYgxMV76+IQoDwQDYkcbj+2LJeW6BTaS My9svAk4enT7917VvyTh2HNMy+qATwgQc1J63s5/YbYkEkbVPq4e5Cv85SJDwSB7KKZO yHkcvBe6IhEHvnFkRy5GaNJpL1f2XTfw1Xe53ZiZyAKkaPPxFn4d6kvG58mrbAFsuzY6 Gk6nWZr2SR6IMgoxQumkrBxXjXqOd/R2U8ifkB2uUw2D/bANGdS/GFbUEIy/gFfmUjdH B0gg== X-Gm-Message-State: AOAM532HM5czE185lOTTI9Uzzdlei3EMg3RHid69YX3fGRuIQUVtR2L7 CcytxPe2C4hHN8vynY2e2x/4Ug== X-Received: by 2002:a17:90a:4285:: with SMTP id p5mr2373269pjg.162.1628742962600; Wed, 11 Aug 2021 21:36:02 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id z131sm1353426pfc.159.2021.08.11.21.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:36:02 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Andy Gross , Bjorn Andersson , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 6/9] cpufreq: qcom-cpufreq-hw: Use .register_em() to register with energy model Date: Thu, 12 Aug 2021 10:05:19 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar --- drivers/cpufreq/qcom-cpufreq-hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.31.1.272.g89b43f80a514 diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index f86859bf76f1..c2e71c430fbf 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -362,8 +362,6 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) goto error; } - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - if (policy_has_boost_freq(policy)) { ret = cpufreq_enable_boost_support(); if (ret) @@ -412,6 +410,7 @@ static struct cpufreq_driver cpufreq_qcom_hw_driver = { .get = qcom_cpufreq_hw_get, .init = qcom_cpufreq_hw_cpu_init, .exit = qcom_cpufreq_hw_cpu_exit, + .register_em = cpufreq_register_em_with_opp, .fast_switch = qcom_cpufreq_hw_fast_switch, .name = "qcom-cpufreq-hw", .attr = qcom_cpufreq_hw_attr, From patchwork Thu Aug 12 04:35:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495951 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639920jap; Wed, 11 Aug 2021 21:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb11N9mnT7sqZYSEubZs938saPG4mk9SCjk/RcuVEd8L2EfMSak2QIUbNnWjmnW3cztG+K X-Received: by 2002:a05:6402:138d:: with SMTP id b13mr3139946edv.355.1628742975326; Wed, 11 Aug 2021 21:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742975; cv=none; d=google.com; s=arc-20160816; b=e76lZLkahD8w8sk38MC9c12XuJo/xy/JufvfMyK1H0aw7aQrTzvf5/t8T0fXIBI0Rl IBHuS1cnf60W2OpC3dplPy4gYRwGnwQIUVPSa5261H1tsFQnA1qF1ko70QZQOxY11Zae iTuobxoBYbnznuTMGubc7U1M7i31JYLMiNWcgCGwPAHhQ2i6TgtYu8UqG+lNAZIpTfth 8Q+rXjXeGXfgLNWmiriD3jncXzXFuYI4w8euET1O3Xg0R7yR2/yRlz+ZisgirwrJGZYY ne1DF6NZNU7cUs38Wgo2D1ANH1EttWQ5uF/gk+xygdmI3FhN19O7ny89jUn/yALwRVgj L3dA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6wofbpP2XHH8vKqCJvAlC0rsCzyQ6IN16xqpsQAu78c=; b=PTmBavqgxKufThA+MMf+ko9a9bs+cpx/73XqiLa8rajEmn7ZNOcr0lFkOlWWhP1vMF FME5UyzlY/zyTcIkylaOf1SJ80zVZ2pjjzZrzIecgi7Pgm/qtqG/31vi3pHdHSdUxvU6 BrOlefqX2JO/PUpvMc+sN9oar1ANAKd2igKBfWkq0Hxicwu7SR3FzwuU78KFDnT7S4Np Yfe2EsEAg+DWCqH8GzJmyN3E7xw5G2OStXaTJEEOF2f5vMbJB8o3sxruX6v/yvjeWGa1 a/VhG8Ex3Vlk2MLJl1x5DhOODIcIxInKjEHv8MDPZdP7DSdei+TenkskcRbEgbSzFZLp tAhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kcTGTOMu; 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 w24si1149889eja.172.2021.08.11.21.36.15; Wed, 11 Aug 2021 21:36:15 -0700 (PDT) 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=kcTGTOMu; 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 S234093AbhHLEgi (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234133AbhHLEgc (ORCPT ); Thu, 12 Aug 2021 00:36:32 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC7ACC0617B1 for ; Wed, 11 Aug 2021 21:36:05 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id j1so7340122pjv.3 for ; Wed, 11 Aug 2021 21:36:05 -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=6wofbpP2XHH8vKqCJvAlC0rsCzyQ6IN16xqpsQAu78c=; b=kcTGTOMugFVsFi9+hhyJu2RhkTevTNPQoau6mbfxI1ob4Xd98YMMTlWa4HAVxbnYZF 0zCmJXMZXbZw00yPhX2lYZyZua96iQxKSmxYzxFaQxfoHY2L3Ye9awQnnl4E874fpAvy TqV1TxaMgS0kcmXxjvAOJbK9Eryr8xabf7A5CjzFtJ2YM7UI8zxqXn0EpKJDfFGjGHWJ tf6goZyfThDvJNaFZRj008upYFfeQoE6+ngyRrnr910bX800SG1RDMvpXi7lK7uRfnK/ PK08nYK1MomznKkiawoMEmkuE7JCXNp8mnV3w3z1Wlb2WwZYV6b6j6PMFIAQ8OfYaZrs jFrg== 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=6wofbpP2XHH8vKqCJvAlC0rsCzyQ6IN16xqpsQAu78c=; b=b9XXXYueAJumFqUewkHaCv20uflMLpS1uzbwc9o2wrsGgGGqh3J4gXMG0PcNLRB+yt /RP5A0G8QcePG8jKjy19K4fI6FUOxC7NWx9xgXcHF4878GZRkncENW+JeqTlUGSPjGgS jxsWMcm05QGaRvRyH4egxYVi3OMEw4s4bHVIL9A6Yv5E8i1SUgh0e2/zrRMDceHnBKTh hoPEjvOAmjmOVnAJ8Ro3BMHTwRNcJfKedCIREA748Q/jDIzFFGvunDE6yDnGfAbnZf04 xl1/jB8+VBqixjtwEvmdH+VTFUbhXzxtF1DWlhhnMY4sbkdHxH2Pt/eQBkvl6Nm8dGSj gSkg== X-Gm-Message-State: AOAM530gwyXFHLKQjOiaWnQWKcThS/YIsuncadRzuG5wT7O8mbgmStgi pj9YBk4ZeNZvXTSgL7WqqyR9Pg== X-Received: by 2002:a65:690c:: with SMTP id s12mr2110775pgq.401.1628742965215; Wed, 11 Aug 2021 21:36:05 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id z15sm1402647pgc.13.2021.08.11.21.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:36:04 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Sudeep Holla , Cristian Marussi , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 7/9] cpufreq: scpi: Use .register_em() to register with energy model Date: Thu, 12 Aug 2021 10:05:20 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar --- drivers/cpufreq/scpi-cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.31.1.272.g89b43f80a514 Acked-by: Sudeep Holla diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index d6a698a1b5d1..bda3e7d42964 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -163,8 +163,6 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy) policy->fast_switch_possible = false; - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - return 0; out_free_cpufreq_table: @@ -200,6 +198,7 @@ static struct cpufreq_driver scpi_cpufreq_driver = { .init = scpi_cpufreq_init, .exit = scpi_cpufreq_exit, .target_index = scpi_cpufreq_set_target, + .register_em = cpufreq_register_em_with_opp, }; static int scpi_cpufreq_probe(struct platform_device *pdev) From patchwork Thu Aug 12 04:35:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495950 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639913jap; Wed, 11 Aug 2021 21:36:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZx4dP6hcePBiAhfGo+ydnyNJTuu6pWU/rtwqjyjRtct/2DK0GhRS/fy3AgxD/aGVThVQC X-Received: by 2002:a17:906:bb03:: with SMTP id jz3mr1873429ejb.79.1628742974769; Wed, 11 Aug 2021 21:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742974; cv=none; d=google.com; s=arc-20160816; b=FpD4Y1+iSQrD2KLZzAhbByPdEn9wtOScqWJULZtSbXswXS8EVCmOwMIYm0a4Fs/QOc 78NZacQfx3/U3qE6ypaiF+dgjcKPjCtla1+NiiNj8eyYxbWH6l1sDkCQYjF631JfE4/+ 3yIhFXvfqx7ILPUp00myVjAQ5tIdtcKpLGTRDPWEgKUdp2tV/KZtG5z9RR4TbP1f+ZhZ Bw8iHiylDgW2Ed5qSAqgUDn1Km6+DSskbdFOtL2gMkS2OZaqilZsC725bAAQKEXWfGew yPeWJW49h/jZDDjbRbrkaQFNy4WmlXQC9qxySfvw+qhTQL7HlSenSQ8V8CHYL9Er0YkL QcCQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9HVQrCOVXbcxMp8JFbwYQtdcMjF/4FzEzkmzk55j+qs=; b=mDBnEIXgknkOs5cYj7rkPz0MIw+gKZCZeEJ8sIxBcbbWMxMTVXY+pgKBq+C7TKQph8 3TfGB0m6ZI1k/e0eKtYFjxELIHj24/+Yl2+NgchHflqw3Fg2gFY2NvblP3FdsUmJuCHA 7e0P8RNYOwwJyLswngQqaD28+L1sIqnyO1wb1/pzlkwHe1ZaQH+b5QIjMYf0TUT6XoJH 0+mABmB3vntYDaVF9nm32blfogH5knQqV8sc7d00MuKoyi5VhlGG0GLMTqSTP3Ct880y CnAEPL3wRoHc4EWhr3uKfJ5Wb/ZffPpQQ5ZYARZn6EPz2Nn6WbOQTUtIbqstd8COA9eN hOmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NNjORvu+; 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 w24si1149889eja.172.2021.08.11.21.36.14; Wed, 11 Aug 2021 21:36:14 -0700 (PDT) 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=NNjORvu+; 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 S234083AbhHLEgh (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234142AbhHLEgc (ORCPT ); Thu, 12 Aug 2021 00:36:32 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631A9C06179C for ; Wed, 11 Aug 2021 21:36:08 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id a20so5675196plm.0 for ; Wed, 11 Aug 2021 21:36:08 -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=9HVQrCOVXbcxMp8JFbwYQtdcMjF/4FzEzkmzk55j+qs=; b=NNjORvu+ttL+CFOCo7D45Yn4LkvAxOR6f1Gig7ouC62A9kFpKoUe+B2COQqZWaYo6s EFIYD1i7xT7d/uesW+whvQ0HXxm6JTTg1qLK54j2OSMtPRCUxl9OXDWyC8e6TB+mI1xp vtRGa2cNSu2wpcduh7fOk2wtwcLh54+uC6BCn4VlZkvGvDmkdngjtH59OZwiyA4FCkyx LGXgxK5oSvMflvnvQwtENwczgV95ZjV1tURh2AiHsWlbE19/RPL172iKJ5qMJ8E/2ANW 1awLQnOKL7j4sq0yX8k61HIcI411xUOgD0oF4HwXTYYHiUM9SNijv0EW1LGlI1D8KHhV ZG7w== 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=9HVQrCOVXbcxMp8JFbwYQtdcMjF/4FzEzkmzk55j+qs=; b=cm0YhoxI4EBVFtN0wkj+eObwgLp4WVnH12PWtVO51ctGLHMFQeI3smh0jwFFQYU5Wz xI0rH0GeJn3wLUJlUwYX2Xr5ttgeaWxU9LYLWTShUuuNFNvv0uMUDT3R9QROmyqbu12B +UEpw0BtgryqIcFj5PpH+XvHHx77FapiF58VOkAJgjuUemYr+qPc+VppR1yz2kT5PViz 85A8lTxiMX3NDzt/msEmOOq0AGES0hSDZ4x99tOZV/S11VFxEVEEJr5Zr8YMqSA6/MXR ShsSjFYcr3G2K1FdyXON+tQpnxdn9oF5QcNTiDzPuvzER/3UdoBxopSThQBVeNyef4ws t+ug== X-Gm-Message-State: AOAM531uu6T2exMwVVFO5toHkGDqz+DfKzuVBPqSpOMs2Eyda0CuugfB 0Ovo3GwgNcBskyqK9QGAokoPaw== X-Received: by 2002:a62:e405:0:b029:3c8:e5ab:ca94 with SMTP id r5-20020a62e4050000b02903c8e5abca94mr2302045pfh.5.1628742967964; Wed, 11 Aug 2021 21:36:07 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id e8sm1433156pgg.31.2021.08.11.21.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:36:07 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Viresh Kumar , Sudeep Holla Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 8/9] cpufreq: vexpress: Use .register_em() to register with energy model Date: Thu, 12 Aug 2021 10:05:21 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Set the newly added .register_em() callback with cpufreq_register_em_with_opp() to register with the EM core. Signed-off-by: Viresh Kumar --- drivers/cpufreq/vexpress-spc-cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.31.1.272.g89b43f80a514 Acked-by: Sudeep Holla diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c index ab56813b7256..284b6bd040b1 100644 --- a/drivers/cpufreq/vexpress-spc-cpufreq.c +++ b/drivers/cpufreq/vexpress-spc-cpufreq.c @@ -440,8 +440,6 @@ static int ve_spc_cpufreq_init(struct cpufreq_policy *policy) policy->freq_table = freq_table[cur_cluster]; policy->cpuinfo.transition_latency = 1000000; /* 1 ms */ - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - if (is_bL_switching_enabled()) per_cpu(cpu_last_req_freq, policy->cpu) = clk_get_cpu_rate(policy->cpu); @@ -475,6 +473,7 @@ static struct cpufreq_driver ve_spc_cpufreq_driver = { .get = ve_spc_cpufreq_get_rate, .init = ve_spc_cpufreq_init, .exit = ve_spc_cpufreq_exit, + .register_em = cpufreq_register_em_with_opp, .attr = cpufreq_generic_attr, }; From patchwork Thu Aug 12 04:35:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 495952 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp5639932jap; Wed, 11 Aug 2021 21:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9bDdiwQOKhQt80gAgeRAYR7HxEgiYR1LpxJ899rsPhzUo2E8zFrqqucrlz5MiEb8DP3J5 X-Received: by 2002:a17:906:9241:: with SMTP id c1mr1454641ejx.125.1628742976313; Wed, 11 Aug 2021 21:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628742976; cv=none; d=google.com; s=arc-20160816; b=0pY1gVnqWLoHng/ecX9GkFXMS8uhdjRz6xJibZCJobRHBAYigW5Df3Xx3IFfFp0ozy dM/eYEXHUJ6LH0SXIdFQukW7wsRcqt5mbZobmjjD6DN0o+PnKnd+wciB98DcgQ3NUJXb RCa6N7ZqaLq02uD7PJxN6vP2AuoTv9JR3Ba5gm/AQzAbOKzBbb+zLDz8J4KW0j0oHmeS FxZgZ43vLGdDiXlku1dnWIbwN6MmXdxxgZlXrR5Ub00SBX8V1dC/GuDd0DTFk1SH1WUc wp44o3pZ+E7iscGfK0oD0uovwKg5z0AfsIkI08yEIFfvnbHvGEmiTz0Pq+41aVBxYVgb WjKw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8K1U7FQdWn8Epzc/tTySkxl9YBi7lGLi/bEAhau8x6Q=; b=RlnmtvMndJ0nxULf32UKPmUNV+7tlKGshJQWUSdILjED1SI25DekR1A81X69OnA1/6 3ke3wfaKKvTkrfgjcUJBMk7g7Eftlu/ne0aMa+XvmnxQpZ/9/mtrOJAPVVF0y+QG6EzI yS6dex0fOXDACdV61PGoG8EQ9n+tHiAOvd11a2oMFCUxfJG4EB1HLU3vHoJP+XePq2hn sRGFwP8i/1kYyHOQxWeQsyPbPsl8/tGsNU3A1LO/loup86mnCDZpV8F9j0PzFRxcY6gx nrB6J1EdeMwyq/mz9We/M36ALgs8xv0YEK1OpxBvrHdtsM6hjP4CwihHEnJR+GzSMSP9 cykQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AAy+qkAk; 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 w24si1149889eja.172.2021.08.11.21.36.16; Wed, 11 Aug 2021 21:36:16 -0700 (PDT) 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=AAy+qkAk; 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 S234086AbhHLEgj (ORCPT + 7 others); Thu, 12 Aug 2021 00:36:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234165AbhHLEgf (ORCPT ); Thu, 12 Aug 2021 00:36:35 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C4D0C061765 for ; Wed, 11 Aug 2021 21:36:11 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id c17so327852plz.2 for ; Wed, 11 Aug 2021 21:36:11 -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=8K1U7FQdWn8Epzc/tTySkxl9YBi7lGLi/bEAhau8x6Q=; b=AAy+qkAkZITRW3NQ0AvJtgjN/N3Vhf/2ReAgijDisDJw5V++3rkcQcH3ofdyEGVkjk pCtSPd3+yFEl6Y0E8+o7QkHKZxxK+vcZ+fG10oUU8Z5HBma1y58ZkA/zIPp+bBkN2L8O txic0SyyzSshcK+Oe7M3kpHAbg68NY2is/AH5vf2O57B2Wq1MfU+ocINXCphcR5i0SoL 8Nhuwxolf4hCahGJtOJGafAFsMU8nW7WVZgxUQeQ0AB2YMDvXFNMl9ks2/ykiIHSsfss Pbq+Bh5TqW3LZc6u7Qmy4/w392Yj70yjWop/ZVeB+xfcZK8BTeuvnRvIz/vl1Yz98DKu ml6A== 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=8K1U7FQdWn8Epzc/tTySkxl9YBi7lGLi/bEAhau8x6Q=; b=sB6pQwB6qTJYpLBvlRKL90Tvw6Ed/e23GPCpEpdQLvbg2dKvbWyCCePaaF5y8xN6OR TlfBGU/FlLvvMh5oX9o4yBATSjjXCs6jQCCYWc4ec+mpDIQrjHvmE++WDLOS/UhBKRyN ap4ZwVog+fs0k3vhf2EwNJLkpcCzpwvQT/byhiKyiKlYn2jjYvUloDrG9uG0qVeLgGsk JDwBiqubyFNbhcJ9pnUsctXZisj7d7r8JFk44nNzfHrdO9FmcXbWdVarNw/3abXjZrLZ 6xJRTBZnJveMAimHL8jBm3BZSepVDJHl5hgsmqE/cqZxnW9xraa33VGNU5HZGrbnNLbM QEbQ== X-Gm-Message-State: AOAM532uu/dyceTde1saenXCLAAQ7hflGmLiBmINBsob7qTucnuzE9YH fSYhb3fwp1/Jwq/AZ3UsslqU8w== X-Received: by 2002:a63:2024:: with SMTP id g36mr2092959pgg.213.1628742970741; Wed, 11 Aug 2021 21:36:10 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id x24sm8399795pjk.43.2021.08.11.21.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 21:36:10 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Quentin Perret , Sudeep Holla , Cristian Marussi , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 9/9] cpufreq: scmi: Use .register_em() to register with energy model Date: Thu, 12 Aug 2021 10:05:22 +0530 Message-Id: <8158488baa1ea1aebd09c8d256db7420051d05ac.1628742634.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Set the newly added .register_em() callback to register with the EM after the cpufreq policy is properly initialized. Signed-off-by: Viresh Kumar --- drivers/cpufreq/scmi-cpufreq.c | 65 ++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 23 deletions(-) -- 2.31.1.272.g89b43f80a514 Acked-by: Sudeep Holla diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 75f818d04b48..1e0cd4d165f0 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -22,7 +22,9 @@ struct scmi_data { int domain_id; + int nr_opp; struct device *cpu_dev; + cpumask_var_t opp_shared_cpus; }; static struct scmi_protocol_handle *ph; @@ -123,9 +125,6 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) struct device *cpu_dev; struct scmi_data *priv; struct cpufreq_frequency_table *freq_table; - struct em_data_callback em_cb = EM_DATA_CB(scmi_get_cpu_power); - cpumask_var_t opp_shared_cpus; - bool power_scale_mw; cpu_dev = get_cpu_device(policy->cpu); if (!cpu_dev) { @@ -133,9 +132,15 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) return -ENODEV; } - if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL)) + priv = kzalloc(sizeof(*priv), GFP_KERNEL); + if (!priv) return -ENOMEM; + if (!zalloc_cpumask_var(&priv->opp_shared_cpus, GFP_KERNEL)) { + ret = -ENOMEM; + goto out_free_priv; + } + /* Obtain CPUs that share SCMI performance controls */ ret = scmi_get_sharing_cpus(cpu_dev, policy->cpus); if (ret) { @@ -148,14 +153,14 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) * The OPP 'sharing cpus' info may come from DT through an empty opp * table and opp-shared. */ - ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, opp_shared_cpus); - if (ret || !cpumask_weight(opp_shared_cpus)) { + ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, priv->opp_shared_cpus); + if (ret || !cpumask_weight(priv->opp_shared_cpus)) { /* * Either opp-table is not set or no opp-shared was found. * Use the CPU mask from SCMI to designate CPUs sharing an OPP * table. */ - cpumask_copy(opp_shared_cpus, policy->cpus); + cpumask_copy(priv->opp_shared_cpus, policy->cpus); } /* @@ -180,7 +185,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) goto out_free_opp; } - ret = dev_pm_opp_set_sharing_cpus(cpu_dev, opp_shared_cpus); + ret = dev_pm_opp_set_sharing_cpus(cpu_dev, priv->opp_shared_cpus); if (ret) { dev_err(cpu_dev, "%s: failed to mark OPPs as shared: %d\n", __func__, ret); @@ -188,21 +193,13 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) goto out_free_opp; } - power_scale_mw = perf_ops->power_scale_mw_get(ph); - em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, - opp_shared_cpus, power_scale_mw); - } - - priv = kzalloc(sizeof(*priv), GFP_KERNEL); - if (!priv) { - ret = -ENOMEM; - goto out_free_opp; + priv->nr_opp = nr_opp; } ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) { dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); - goto out_free_priv; + goto out_free_opp; } priv->cpu_dev = cpu_dev; @@ -223,17 +220,16 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) policy->fast_switch_possible = perf_ops->fast_switch_possible(ph, cpu_dev); - free_cpumask_var(opp_shared_cpus); return 0; -out_free_priv: - kfree(priv); - out_free_opp: dev_pm_opp_remove_all_dynamic(cpu_dev); out_free_cpumask: - free_cpumask_var(opp_shared_cpus); + free_cpumask_var(priv->opp_shared_cpus); + +out_free_priv: + kfree(priv); return ret; } @@ -244,11 +240,33 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); dev_pm_opp_remove_all_dynamic(priv->cpu_dev); + free_cpumask_var(priv->opp_shared_cpus); kfree(priv); return 0; } +static void scmi_cpufreq_register_em(struct cpufreq_policy *policy) +{ + struct em_data_callback em_cb = EM_DATA_CB(scmi_get_cpu_power); + bool power_scale_mw = perf_ops->power_scale_mw_get(ph); + struct scmi_data *priv = policy->driver_data; + + /* + * This callback will be called for each policy, but we don't need to + * register with EM every time. Despite not being part of the same + * policy, some CPUs may still share their perf-domains, and a CPU from + * another policy may already have registered with EM on behalf of CPUs + * of this policy. + */ + if (!priv->nr_opp) + return; + + em_dev_register_perf_domain(get_cpu_device(policy->cpu), priv->nr_opp, + &em_cb, priv->opp_shared_cpus, + power_scale_mw); +} + static struct cpufreq_driver scmi_cpufreq_driver = { .name = "scmi", .flags = CPUFREQ_HAVE_GOVERNOR_PER_POLICY | @@ -261,6 +279,7 @@ static struct cpufreq_driver scmi_cpufreq_driver = { .get = scmi_cpufreq_get_rate, .init = scmi_cpufreq_init, .exit = scmi_cpufreq_exit, + .register_em = scmi_cpufreq_register_em, }; static int scmi_cpufreq_probe(struct scmi_device *sdev)