From patchwork Mon Feb 26 05:08:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 129541 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3230497lja; Sun, 25 Feb 2018 21:10:11 -0800 (PST) X-Google-Smtp-Source: AH8x226+/e7CKMO7xq4RpajnxS3FB2+hd6YHgOph3HVl6TtPLZZl3Z3khiPXqirEWxpTrch1FXMI X-Received: by 10.101.97.139 with SMTP id c11mr7380017pgv.449.1519621811155; Sun, 25 Feb 2018 21:10:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519621811; cv=none; d=google.com; s=arc-20160816; b=MBEUXp9QI2Lt7xq7KsloKZhHx1Evmq5N1rkgAOE/l3qTb06X0q6BajK/Phncf+YQhj KTYomZvxgC4YX14zq1Gx3mYKbRZK7GQGtpU2wONR5g9fZawRtHgZK/XL5tWED9rCmIsU 80CIXoovDTjLwVhotX2NThDD9af+0COKdMrTbfA7nh8ThKrx0ISXRpQtG8n2YJoax1IB BHDlK2iunEXArhaWKPMujxWC7QVLAiEwWoIofrXRNhEXHUm7DS7hxnT3G8dBHUNPwmro 3DZ63NTiVUAq1KBSMjo1pQyCiahe7kzK9sG6aoYEa+PCr/houE4RLMdFWRxYoR3Da6D0 4b6A== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=S9I5NEQLmCJXPHbik4waQr5Xe6PeubJ1kIWZIQAIp0k=; b=ISEjW9XX6FNkEA1wSUtYGVuMvQ/po/6BnjjNI0RBBSbxE9j1m6t+diBiANnysQPPNL +vyl3tK3VPW37e0SKxrxr4CAg6gv8n35iFBxOmfqwEgCKt9dpbRQ61cb82xY9QDAmSQa rZsiB93tr7HZfkzx4fzExrNov2coTy0EU/95O1xpJDYsy9/jBHmD5C7VZRjYKZcCSsAx /AhPaD321BnTlV9JmC32RuR+YEZm/1zX84TR9jG1V0/isyLc0KLhuDB3mwhg+7Q6qbVC uP6bxv+jIPefMDig1Qqko3fhXTXRHidjWxtps2b/tWlyNfTBPdWcU/VYZ4g6lP+xSu2e dFDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S/5TVUJL; 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 h32-v6si6199354pld.217.2018.02.25.21.10.10; Sun, 25 Feb 2018 21:10:11 -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=S/5TVUJL; 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 S1751959AbeBZFKK (ORCPT + 11 others); Mon, 26 Feb 2018 00:10:10 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44270 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbeBZFKJ (ORCPT ); Mon, 26 Feb 2018 00:10:09 -0500 Received: by mail-pl0-f67.google.com with SMTP id w21so8654435plp.11 for ; Sun, 25 Feb 2018 21:10:09 -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 :in-reply-to:references; bh=S9I5NEQLmCJXPHbik4waQr5Xe6PeubJ1kIWZIQAIp0k=; b=S/5TVUJLTzR6/kgtf5zQi07cRVGGtZIHmmEjMAiFnw/V+Dqma/1mzgO46kMCeLQ1nL T7w5q4XY6xbGKAOP56Ug94WcSeHH8IDJVFwpj6VxMwaVuITvNLJeJ2O/C/7TGcS2q9lN 2puUjN6gPG28GxiGvfUdcg7xW/My404ee+XpI= 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:in-reply-to:references; bh=S9I5NEQLmCJXPHbik4waQr5Xe6PeubJ1kIWZIQAIp0k=; b=qA+wdPe/x0zcMLxbUdLgFLCHn9fWxBBLqAAoUSgXbkTjHOshClSvx8MBUTE044c0JA 4BzlXo/V5aT1xZUK+pFrdDFak2ErnYreueX/2ej4xeMyKiI8RP/bEJIcOgy4eZQY3EO9 65DoGw0C5QsYacHIPSfxE6FmywNMorvZEyv//D8fGAjYVWUMk9P66IoWUHc4ZmsSRQ0Q X7v6aynsXgX7kZVIwn1vEA/0FozWyW4KMVETUvEhoZd1y9pbvihdZHpiNzcwAOISbVIE PGQ/Rm43VnkXWJWSbBYP7GzDpxZFp5fPil5tG+ZGkzTuy4YTR73sf1zk5TGX8Y9eYOk6 JC3A== X-Gm-Message-State: APf1xPBbZzrc0zm2Zj+vsJYbyK66DSfqfR2eE3+QSnDFN6IDyEG2w8s5 ZY/2nPi2pGHwzL7H/2Bw8bHnVw== X-Received: by 2002:a17:902:536a:: with SMTP id b97-v6mr9390907pli.421.1519621809307; Sun, 25 Feb 2018 21:10:09 -0800 (PST) Received: from localhost ([122.172.92.38]) by smtp.gmail.com with ESMTPSA id u27sm11171721pfk.172.2018.02.25.21.10.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Feb 2018 21:10:08 -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 15/27] cpufreq: powerenv: Don't validate the frequency table twice Date: Mon, 26 Feb 2018 10:38:58 +0530 Message-Id: <3120e4db4ae3bc014d198a206f46be1305ec65e8.1519620578.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: References: In-Reply-To: References: 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 powerenv driver. Signed-off-by: Viresh Kumar --- 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)