From patchwork Mon Mar 5 04:19:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 130613 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2256073lja; Sun, 4 Mar 2018 20:19:51 -0800 (PST) X-Google-Smtp-Source: AG47ELvXHfjJSAPauTHLcUZolCFRKl9ZU8jlGJBKXU58JBvxBU3BeVgwE7IP8ALUPThLZ6AJG/WX X-Received: by 10.98.153.86 with SMTP id d83mr13858545pfe.46.1520223591442; Sun, 04 Mar 2018 20:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520223591; cv=none; d=google.com; s=arc-20160816; b=ttzj8g+OX7UO+Gl5tyt9TwnJHkK1lYJQRkAgPc5UI4b/W2BqWDW9Tzz12yhAMX/KsT xtDP2w2lzUDFOJMv2XJyKACJkxCMW1NDureHnJR5rlzyMe+xEnrUbAeUoK4Tn5PIeVfk 1mMIxOb+cKoLL7LY89RcIZowRVRgkdb0s4VsLITUr3Z/a2cwwXkWLTZk3T31xh7KUmCt KVjlPIPP7sSzAewl82h5uHUHO2NEc/M/R3mnKPZ075GCc5ObYNp0HJlU3OFYGPDQwiY5 KcW4OCGqqp1ll3GP/ICbzOIo6//yFjBet/fqMOa2h+zYMN2rpkR3H+B2ymIcqG42rb7C zD/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=eF2QzpLTcF+dwYg9BNBrXhsmVTDWwco4SFHmSRHKoi0=; b=zM7POB/CothFfAStHa9NvNWBwaShb+5SC5fNKoykIFP+g+bhnfs/pNmPApoIzFPuKo pYe2/NIPDgAqSbJuw/dcxrPHAFRHKaXqx5F7IK9CZ2C60+K/kA/pWhtVtCcVZL/EVW4Z fqkFHZ+g3zulaHT4N7bD+Esttf8+jIvFojhzf6K/4l/KWrVhLo3bqlcD/2kKqRPIlhtR /xLlGAcewENHngK9sJQpos9q06kqEsRptwnexY+EOgT6n4r7odSouv4JipzccYyRW1kl YqrL+51ExCS9cPz7dTAYji8E/Z2Burcbkk8zZe/blNQVY+IH3DM6wgcmjziLiDSVj6iS /Yjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yy7aUmZS; 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 p125si7828435pga.97.2018.03.04.20.19.50; Sun, 04 Mar 2018 20:19:51 -0800 (PST) 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=Yy7aUmZS; 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 S1752368AbeCEETt (ORCPT + 11 others); Sun, 4 Mar 2018 23:19:49 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:34887 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752225AbeCEETs (ORCPT ); Sun, 4 Mar 2018 23:19:48 -0500 Received: by mail-pl0-f68.google.com with SMTP id bb3-v6so9005350plb.2 for ; Sun, 04 Mar 2018 20:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eF2QzpLTcF+dwYg9BNBrXhsmVTDWwco4SFHmSRHKoi0=; b=Yy7aUmZSepvODoAt/SW2jaWRAHjPLIOzM1yJOlfe4Sdj4mOmwbBsccxZjqNkvGdYXC 3NDAOl/WQ9VncMnDy/S/Cp0jsW+SLaRelIu03Akegu4WHVYDaVxd+3vHCBjRa2XawGyQ OUIwVykdvhULG3EbKVCLrSlc/gLNoLICpweuw= 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; bh=eF2QzpLTcF+dwYg9BNBrXhsmVTDWwco4SFHmSRHKoi0=; b=cVTonOHh5f9VV2zC4vd41XnYqlLXnj3KW+6/2g945NFjrog5fJBwN3/ucbzoXuHH8m LQv5tEerSfBdpq5y26vsbo6RnISkSCVkVk6eHLPYG8xwgr1jF9R699iZ7Pwkc10N4raX 6gPhBT0i4FUkF2kwznmospEiR306AEjX3W1RmTqKhK71+1AOVGv1MJRan96WIIV67uRU BULBaE7zWFG0EtLa/eP82fsAv+x/1VmPf+JAYHDA12cT/xhrpyLnjDEeslHziv2NPQ1J nYU+G4NmS2RXWNdGDYAg27IXlT+Co+AZXxB7ekopukM7iOWIc7KgMbVok7dzOf17+zZX Ux0Q== X-Gm-Message-State: AElRT7FkgOW40OJH53tu47LeXjTllCjmfqioRoIwbw844pPRcm56Dx/0 1kE76u/VvMyGEy4RMwuiRCsT7A== X-Received: by 2002:a17:902:7f0c:: with SMTP id d12-v6mr4032528plm.350.1520223588356; Sun, 04 Mar 2018 20:19:48 -0800 (PST) Received: from localhost ([223.226.75.205]) by smtp.gmail.com with ESMTPSA id x1sm23625236pfk.144.2018.03.04.20.19.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Mar 2018 20:19:47 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linuxppc-dev@lists.ozlabs.org Subject: [PATCH V2 15/27] cpufreq: powernv: Don't validate the frequency table twice Date: Mon, 5 Mar 2018 09:49:32 +0530 Message-Id: X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: <3120e4db4ae3bc014d198a206f46be1305ec65e8.1519620578.git.viresh.kumar@linaro.org> References: <3120e4db4ae3bc014d198a206f46be1305ec65e8.1519620578.git.viresh.kumar@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The cpufreq core is already validating the CPU frequency table after calling the ->init() callback of the cpufreq drivers and the drivers don't need to do the same anymore. Though they need to set the policy->freq_table field directly from the ->init() callback now. Stop validating the frequency table from powernv driver. Signed-off-by: Viresh Kumar --- V1->V2: - s/powerenv/powernv/ drivers/cpufreq/powernv-cpufreq.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 29cdec198657..0591874856d3 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy, static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) { - int base, i, ret; + int base, i; struct kernfs_node *kn; struct global_pstate_info *gpstates; @@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) gpstates->timer.expires = jiffies + msecs_to_jiffies(GPSTATE_TIMER_INTERVAL); spin_lock_init(&gpstates->gpstate_lock); - ret = cpufreq_table_validate_and_show(policy, powernv_freqs); - - if (ret < 0) { - kfree(policy->driver_data); - return ret; - } + policy->freq_table = powernv_freqs; policy->fast_switch_possible = true; - return ret; + return 0; } static int powernv_cpufreq_cpu_exit(struct cpufreq_policy *policy)