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: 10258087 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ECC606037E for ; Mon, 5 Mar 2018 04:19:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDE212887A for ; Mon, 5 Mar 2018 04:19:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C16B2288AA; Mon, 5 Mar 2018 04:19:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E81F288A8 for ; Mon, 5 Mar 2018 04:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752368AbeCEETt (ORCPT ); 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-Google-Smtp-Source: AG47ELsE8rXKd/0bCjeJlqZ6Oit3nTg95Vq74VA0sluDiCVB6dGYo9b/PZbGZv3Kf16DCDsOsNJmxQ== 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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)