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: 877681 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zqVS817J8z9s25 for ; Mon, 26 Feb 2018 16:16:56 +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="S/5TVUJL"; 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 3zqVS75rCwzDqhd for ; Mon, 26 Feb 2018 16:16:55 +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="S/5TVUJL"; 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::243; helo=mail-pl0-x243.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="S/5TVUJL"; dkim-atps=neutral Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (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 3zqVJM0WsjzF1P9 for ; Mon, 26 Feb 2018 16:10:10 +1100 (AEDT) Received: by mail-pl0-x243.google.com with SMTP id x19so8655034plr.13 for ; Sun, 25 Feb 2018 21:10:10 -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=thdACvVUOgxUI58sbkUn1F5aGQNqDdd+UJDpwhmzIRmBAyDhfKFTcZKDQmT0+NylKw XX6AKx6DNIqBabJ7A5VzrjBD6kZuNm4uhMFWNEdTtbk2Ie0CfdtvSGNZrr0NyRhkL0vx dT7fhsawhWzUMxeMQ6hd/HhskvkWH/rnLwb+sMn1Wk42I0Vt2d3BsCLnPnp0s67A+w3d VBaAdEVeKY/AoDz+WdMP1xQmxjzgAsqhDZfJWcAWnuxGdd9YQ16oIxCFPmG8yuQgPQuX Ry48Q+xD6n8bY8pnmuTVTIDHZqqmKEjezCmvU/ME+WzmSujemmplcrLvGl+v1PkSm2dX Q6vQ== X-Gm-Message-State: APf1xPBH1yCzGoDZaB5oejFkkCjtqa6EzsAm7A3Cb+AvtNbj/dWXrnZe 1uPdm5XLu/jT22DSQNw4HDSm8g8Ue6Y= X-Google-Smtp-Source: AH8x227o1Co9rjJASJH0KqvxEx6gUWQPgD22UuAbHztAtKFiWI8jTa1xFwpCumNDIPFLLwoUR9IKNA== 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 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: 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 powerenv driver. Signed-off-by: Viresh Kumar --- 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)