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: 129540 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3230468lja; Sun, 25 Feb 2018 21:10:08 -0800 (PST) X-Google-Smtp-Source: AH8x227S0qP3ms2k9qvlr9e4w4udryPHrCmDZ19iHc5K2m9L1RMicO8/Xlg99QpkNOq/lO/B/wOy X-Received: by 2002:a17:902:2904:: with SMTP id g4-v6mr9296491plb.170.1519621808433; Sun, 25 Feb 2018 21:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519621808; cv=none; d=google.com; s=arc-20160816; b=ZNTCXIAaCvGliKQvFZol4yiNi9jvGDOUyHEEYh4wLyWRT/BpD/yfCrqYE+9r85RAdQ k2Y5Y/9PzlYEHxlV6Ta89psjkrSiA192mA1i+tZGJFdd2+J24f4w6ySNIty6rOyeeNGj eOtDPKAR+RltbqIl5cdpzdjgCDLhGYow5/8ccKetP2/jC+EjjOo8UAiRIuJDXhTcs5BS HcsI3whGaTH2izW66vE7yESt9VZrpdkw4S239G1p3Cj9+37SVVJaki4a13+mIleyUEtU CnnilJjk6bdxyIjdWIPBqXRHUvrx0cX1Av+6DRLXKo10jtAPxDE1my36GG9YUzTfuH/n owWw== 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=5E4IZ5X/+j0mHhsPclVR6FGkLsrx28tHLU7PR/FpO1M=; b=NG4K8f2hn+7iulFKxM/cjBkofRo74gAYKJ5CJ+tflOPVBIOf2zCjdyyL+UpstrS/eL n38P2WvcUEfP9BL4CIfY1E31xhUPda7t/qUSCWKSxKsz0FtUFTgyF3LOXQz9OalkS+GZ zBw+2CIKhlOXy/ik/6YyZaTGdJSBHmOp1wMIk4KH5RzetVmnurbv5/I4S6jPZHdMAWHb jUkXcJq66wsRpaxXstvfFnuvcXlsA7m1vZj1tipcX/a8pqLRLMXJ+7QW2RoMfaXBZZNG eaGGsxwaYacB+UGRLolf9YLQC1cJ35qpz4mOFsVekwFKIwF4hsUOPF7EfwKdIiO7mKVt iuZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=etyYJ34m; 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.08; Sun, 25 Feb 2018 21:10:08 -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=etyYJ34m; 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 S1751954AbeBZFKH (ORCPT + 11 others); 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-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 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(-) -- 2.15.0.194.g9af6a3dea062 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);