From patchwork Mon Feb 26 05:09:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 129549 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3230800lja; Sun, 25 Feb 2018 21:10:32 -0800 (PST) X-Google-Smtp-Source: AH8x225REWHsZPSYd+jBdcLQxiNymmgByTO39QxlhidECnW2rd3EJ21GfuCMJRI/CvV4tNv/kGrM X-Received: by 10.99.110.131 with SMTP id j125mr7557032pgc.382.1519621832693; Sun, 25 Feb 2018 21:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519621832; cv=none; d=google.com; s=arc-20160816; b=UGgDNlTRi60Mdy49l3QKpe5tW7oBUPvciEAB3pFcDzUVTRsA+WpQU4Bmf/o6qVitiz XJq75sPkTtI5yeb87PDFlSFNL20obEvjb/vJH1hvrfMmdwW/QIi5kHwMFbQdijL2BdsQ VWBG+hMDc/W9d3lWkJn2bMYpguatM0cwzZ8pP4Ba9RZE+/AnJUOUAbjpmVbmBSNQXRD0 tjmps/iAhvZgYst6I97v7OVychSTPw2zmks1G3oKfUyyTYCcMbprlDBJqtBs+ed77zvv C+nLCQPAIb1GtxNs5nGjgGs3bYPrvJmASsq4Y8ETW+f9+c10fr+nSEeyASBgwcPySR71 qXiA== 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=dPFAnfwJ79b/mg1j2ql0DFEFr1wlX2nawEdtrqpDD5A=; b=MRVoJFAjLwewJRk1KaJ9vSlKkzosFTHnRE51A5gjL83WK2Mo91678wpmnszmSFSnLz 37ddeMXro+WfChYdfSgDOnDgfFIsRRbEtWmbOot3VAX/BNYm8I6MmSgwXkDjf3gdLA8w pzkdVdBxSuAh8Jmkoc8V6Qa6w6L8FNi5I5xhH48ezjlWx2nbXex9zNRinO271AgNB156 fM2zGnircvAReE/vI+qX0joksUezRuzaIp/a7VWFpSSn+LzvJoNICy1aI3LX/nNVeB9l IRmv3tseXC7Tn+kfraws8eB0elNYVuYQaofWU/ShwwYVUOcMXCPIDGt9fRlX8/HPkSqt m9ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IsVe88z3; 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.32; Sun, 25 Feb 2018 21:10:32 -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=IsVe88z3; 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 S1750877AbeBZFKb (ORCPT + 11 others); Mon, 26 Feb 2018 00:10:31 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44295 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750748AbeBZFKb (ORCPT ); Mon, 26 Feb 2018 00:10:31 -0500 Received: by mail-pl0-f67.google.com with SMTP id w21so8654851plp.11 for ; Sun, 25 Feb 2018 21:10:31 -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=dPFAnfwJ79b/mg1j2ql0DFEFr1wlX2nawEdtrqpDD5A=; b=IsVe88z3+TJtBGVGTk/oyT3JNrNwWyxxb/gluOHSiFt5ZWxxXNFrR/tizeytZyt53t qqywxrDjYN4pZGWBKWDxOisN3rAHuIerUsciE2QkKxImMVknDe3lPqdXtiUvFCTQ5Kw+ YpK78RZt5ZI5q31OjP1ewEQaS5A5oeViHHiPA= 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=dPFAnfwJ79b/mg1j2ql0DFEFr1wlX2nawEdtrqpDD5A=; b=AVTiQLgY9ap5VDGrQot5786tIhi9ISLv9kvIxbpnpuStn7s3YzS7neb6tEiYJeN4q+ 40z/8K9EF6/uJpDpCpkAU+ddBuCc5krJAvHJXME8Da9x1HBQ50QmG5Uu+HwfGkchCMZo HjmJ4XbkfhAdMG6d4iC4CO954V7AtfBs08yWDrFIYPaVccOgR6GUOb2tJXzXCUQ8W7Bp tSyhCV+nOWg88sHn0keaQjobmRVHgBXEVHlBBTQnrsF+c3C72KdvbmTSvlvgVPr7lv2/ j75VsAvv1tFBeowG/+8Lj2TWXDpaxqU/eTggWJ/odMGuT2T1Q4aKu5z0ZzEBTIrtZ5uf O7JA== X-Gm-Message-State: APf1xPB3Jue9v4j47l1VC2V4iiRKTa2PZU+UixJyZ1gvRDfqiuX2uTGu /CY3N9KjeAV1ucWHm+KnMqX8wg== X-Received: by 2002:a17:902:50e:: with SMTP id 14-v6mr9391194plf.360.1519621830801; Sun, 25 Feb 2018 21:10:30 -0800 (PST) Received: from localhost ([122.172.92.38]) by smtp.gmail.com with ESMTPSA id p14sm4387458pgu.44.2018.02.25.21.10.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Feb 2018 21:10:30 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot Subject: [PATCH 23/27] cpufreq: sh: Don't validate the frequency table twice Date: Mon, 26 Feb 2018 10:39:06 +0530 Message-Id: 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 sh-cpufreq driver. The driver though prints the min/max frequency values and the same is done from the ->ready() callback now to keep the behavior unchanged. Signed-off-by: Viresh Kumar --- drivers/cpufreq/sh-cpufreq.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index 28893d435cf5..5096c0ab781b 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c @@ -122,11 +122,7 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; if (freq_table) { - int result; - - result = cpufreq_table_validate_and_show(policy, freq_table); - if (result) - return result; + policy->freq_table = freq_table; } else { dev_notice(dev, "no frequency table found, falling back " "to rate rounding.\n"); @@ -137,11 +133,6 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; } - dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " - "Maximum %u.%03u MHz.\n", - policy->min / 1000, policy->min % 1000, - policy->max / 1000, policy->max % 1000); - return 0; } @@ -155,6 +146,16 @@ static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy) return 0; } +static void sh_cpufreq_cpu_ready(struct cpufreq_policy *policy) +{ + struct device *dev = get_cpu_device(policy->cpu); + + dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " + "Maximum %u.%03u MHz.\n", + policy->min / 1000, policy->min % 1000, + policy->max / 1000, policy->max % 1000); +} + static struct cpufreq_driver sh_cpufreq_driver = { .name = "sh", .flags = CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING, @@ -163,6 +164,7 @@ static struct cpufreq_driver sh_cpufreq_driver = { .verify = sh_cpufreq_verify, .init = sh_cpufreq_cpu_init, .exit = sh_cpufreq_cpu_exit, + .ready = sh_cpufreq_cpu_ready, .attr = cpufreq_generic_attr, };