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: 881285 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zvmvx3HgHz9sZ1 for ; Mon, 5 Mar 2018 15:22:21 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Yy7aUmZS"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zvmvx19dhzDqlb for ; Mon, 5 Mar 2018 15:22:21 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Yy7aUmZS"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linaro.org (client-ip=2607:f8b0:400e:c01::241; helo=mail-pl0-x241.google.com; envelope-from=viresh.kumar@linaro.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Yy7aUmZS"; dkim-atps=neutral Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zvms36XfNzF09v for ; Mon, 5 Mar 2018 15:19:50 +1100 (AEDT) Received: by mail-pl0-x241.google.com with SMTP id f23-v6so8994641plr.10 for ; Sun, 04 Mar 2018 20:19:49 -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=soG02Wocq3SdvXux2jUzwRyFUjMK2SbZ+50fSC1MC6dxSYowIGD2JBQ1wNfv3x78yT p/A5unuF0BS7ZdIbIF6kTX4BHL4K7Yj/pbX6eoHMJAjQuvzAMSxqce15eTtac2gKTlBG nHCSaFshyHsrSUJSDkzFuOMBeQKABlARWm5B4ZHMdfSnWqWs2AYRiGTBMiraF9HZ2JEk c2ZMiC1OakILKrfGKEF9qvKma9TdvfaxJrvDoR7aMCs3x8tW7uw1B9wasODK9HDH6niy QkGZbcTN53keVmSBJPMpVU5NVAEvLh2sWT+kn3Y3oXrNyQolEdkYkqMOLbTaN7V9OyTc RsFA== X-Gm-Message-State: AElRT7HT7wFOsWVxWQ3tJHwDo8V32MyEmqVYqkrntyF3iU020lq9NpkD 88wdVmEoFVq3dwvr5+k1i+5/Mw== 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 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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Viresh Kumar , Vincent Guittot , linuxppc-dev@lists.ozlabs.org, linux-pm@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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)