From patchwork Mon Feb 26 05:08:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10241257 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 E03F960208 for ; Mon, 26 Feb 2018 05:10:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D161E297C2 for ; Mon, 26 Feb 2018 05:10:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5F96292DF; Mon, 26 Feb 2018 05:10:08 +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 2CC3A292DF for ; Mon, 26 Feb 2018 05:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751954AbeBZFKH (ORCPT ); Mon, 26 Feb 2018 00:10:07 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:42148 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbeBZFKH (ORCPT ); Mon, 26 Feb 2018 00:10:07 -0500 Received: by mail-pl0-f66.google.com with SMTP id 31so8649376ple.9 for ; Sun, 25 Feb 2018 21:10:06 -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=5E4IZ5X/+j0mHhsPclVR6FGkLsrx28tHLU7PR/FpO1M=; b=etyYJ34mYNvf2k7zLPY14ZyY6sPgifsX0CtOusC58QnNDjNo775zwf/ybU6RqC9fL5 X3kpBWSJowpTYhWKduBBJp8XVJKWdRcbvk4Vf2Oe1/rG0ygCZthd5BJ35QTriqKaD32n o/HGjfjOg0Zt0mXmuxEUMw2U8jNw3HaXF5DSQ= 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=5E4IZ5X/+j0mHhsPclVR6FGkLsrx28tHLU7PR/FpO1M=; b=acBcFWLLqzHvXBDp9MWdZKXO2pQjeSvo8HwA1r4uD4c1Jypf4dE9GfcM1oWJXu+Qjr WkSYdDLgAp617a7VoDBtil0E7+CKX/9KcSkTtvLRa8Ao1kmt4tzUwOFvfwgGjssqiKDH 7oLRrWxa+CdajfKKAIvrlraYO95IYmfbtNGVrwW3MjxTkbvjNbN21bFlWFmM0K+XFHyB G24YLPdsJd7P19/4pVsr1MeQ0eu4EXPHF0uZIEIxR2xMxqvxJKFF0cruGJ15boYUe8Uc cynFac+jDUrM0t0+7VDE0zA2ipi4CAW1GcbMmr+TK1CXLvw62g7eQYCQydtpwbWaMhBF 7yDg== X-Gm-Message-State: APf1xPCt8vWxm0aXt6qinjCs/YP1pnmhMI77b9suV9XdAWims2UBHDt1 MLpGLoHC89iD5xN8wOYxN9JX5g== X-Google-Smtp-Source: AH8x2275vdThaoJBYAzZLktO0+RAbNF0vhDDxlBiKGs5enWtnhe4alCS71sAcEIIB7rs3eULKHau2g== X-Received: by 2002:a17:902:225:: with SMTP id 34-v6mr9442002plc.415.1519621806579; Sun, 25 Feb 2018 21:10:06 -0800 (PST) Received: from localhost ([122.172.92.38]) by smtp.gmail.com with ESMTPSA id v1sm6107640pgt.62.2018.02.25.21.10.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Feb 2018 21:10:06 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot Subject: [PATCH 14/27] cpufreq: powernow: Don't validate the frequency table twice Date: Mon, 26 Feb 2018 10:38:57 +0530 Message-Id: <64f6ee28c8343d967c1ed540d11ffd3d8e24c4b9.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 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 powernow driver. Signed-off-by: Viresh Kumar --- drivers/cpufreq/powernow-k6.c | 3 ++- drivers/cpufreq/powernow-k7.c | 3 ++- drivers/cpufreq/powernow-k8.c | 10 +--------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c index dedd2568e852..8a8ea68611a8 100644 --- a/drivers/cpufreq/powernow-k6.c +++ b/drivers/cpufreq/powernow-k6.c @@ -214,8 +214,9 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy) /* cpuinfo and default policy values */ policy->cpuinfo.transition_latency = 500000; + policy->freq_table = clock_ratio; - return cpufreq_table_validate_and_show(policy, clock_ratio); + return 0; } diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 302e9ce793a0..d6cb052b0a75 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c @@ -639,8 +639,9 @@ static int powernow_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = cpufreq_scale(2000000UL, fsb, latency); + policy->freq_table = powernow_table; - return cpufreq_table_validate_and_show(policy, powernow_table); + return 0; } static int powernow_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index b01e31db5f83..b9c04e74cdbf 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -1084,15 +1084,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) cpumask_copy(pol->cpus, topology_core_cpumask(pol->cpu)); data->available_cores = pol->cpus; - - /* min/max the cpu is capable of */ - if (cpufreq_table_validate_and_show(pol, data->powernow_table)) { - pr_err(FW_BUG "invalid powernow_table\n"); - powernow_k8_cpu_exit_acpi(data); - kfree(data->powernow_table); - kfree(data); - return -EINVAL; - } + pol->freq_table = data->powernow_table; pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n", data->currfid, data->currvid);