From patchwork Mon Jun 22 08:02:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50142 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 08C8421594 for ; Mon, 22 Jun 2015 08:03:52 +0000 (UTC) Received: by wiea6 with SMTP id a6sf8100965wie.1 for ; Mon, 22 Jun 2015 01:03:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=IeB2iem3aZvm9eOHqge7hQEVAf4fzEeILWoXikxVc2o=; b=l1ksbfQ2wne1Zoy2z6w8/s/S0INRUo4XGwdzZQ+d/JUbsd+VmGoi453kMDZvVuF9VX B5c96poSQwrSrNNS8Xama3JHyVWC7c4jWVc3cprqDsFElsIkSqZXCUtKU2EIbZUXEAS0 5xduMZ9B+/Rp8Ko1b+TrHQEOV1Ih+EujIkkIisX/fDCkDeNzUdJ8F4wpxqjDbhgFNE/a CrDw/Y3wYInuv28FmTSU99YjvzeItWwdQiYuoO5vg0f9f2xPKgQCgFv6sgmqGx90vOKZ Iczlg4Ag8GM2YYpdzTknKkLbvirmJq/ZYdLBKmJH26WMWx/Nv/kf01BU/SbC1akLXf0N r51A== X-Gm-Message-State: ALoCoQlhM0tTPKyMq+2IRDmsgIV4okL7mEOH/2u4yx3FQiJfRhnFjSdeBttz1kb819eosd0kvga3 X-Received: by 10.112.28.111 with SMTP id a15mr26774018lbh.21.1434960231033; Mon, 22 Jun 2015 01:03:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.97 with SMTP id c1ls809533laf.66.gmail; Mon, 22 Jun 2015 01:03:50 -0700 (PDT) X-Received: by 10.152.87.148 with SMTP id ay20mr6717942lab.45.1434960230892; Mon, 22 Jun 2015 01:03:50 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id mk5si15913354lbc.47.2015.06.22.01.03.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 01:03:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbti3 with SMTP id ti3so103606969lbb.1 for ; Mon, 22 Jun 2015 01:03:50 -0700 (PDT) X-Received: by 10.152.87.33 with SMTP id u1mr29408918laz.35.1434960230518; Mon, 22 Jun 2015 01:03:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2208951lbb; Mon, 22 Jun 2015 01:03:49 -0700 (PDT) X-Received: by 10.70.45.168 with SMTP id o8mr56232978pdm.152.1434960225593; Mon, 22 Jun 2015 01:03:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si28457864pdl.134.2015.06.22.01.03.44; Mon, 22 Jun 2015 01:03:45 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756201AbbFVIDn (ORCPT + 11 others); Mon, 22 Jun 2015 04:03:43 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33980 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756168AbbFVIDn (ORCPT ); Mon, 22 Jun 2015 04:03:43 -0400 Received: by pabvl15 with SMTP id vl15so82806735pab.1 for ; Mon, 22 Jun 2015 01:03:42 -0700 (PDT) X-Received: by 10.66.63.33 with SMTP id d1mr57388460pas.33.1434960222655; Mon, 22 Jun 2015 01:03:42 -0700 (PDT) Received: from localhost ([122.167.71.211]) by mx.google.com with ESMTPSA id nq2sm18907380pdb.70.2015.06.22.01.03.41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 22 Jun 2015 01:03:41 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Preeti U Murthy Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar Subject: [PATCH 10/10] cpufreq: Get rid of ->governor_enabled and its lock Date: Mon, 22 Jun 2015 13:32:57 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Invalid state-transitions is verified by governor core now and there is no need to replicate that in cpufreq core. Stop verifying the same in cpufreq core. That will get rid of policy->governor_enabled and cpufreq_governor_lock. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 24 ------------------------ include/linux/cpufreq.h | 1 - 2 files changed, 25 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5863db9213aa..7c46c3f3d938 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -102,7 +102,6 @@ static LIST_HEAD(cpufreq_governor_list); static struct cpufreq_driver *cpufreq_driver; static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data); static DEFINE_RWLOCK(cpufreq_driver_lock); -DEFINE_MUTEX(cpufreq_governor_lock); /* Flag to suspend/resume CPUFreq governors */ static bool cpufreq_suspended; @@ -2099,21 +2098,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, pr_debug("%s: for CPU %u, event %u\n", __func__, policy->cpu, event); - mutex_lock(&cpufreq_governor_lock); - if ((policy->governor_enabled && event == CPUFREQ_GOV_START) - || (!policy->governor_enabled - && (event == CPUFREQ_GOV_LIMITS || event == CPUFREQ_GOV_STOP))) { - mutex_unlock(&cpufreq_governor_lock); - return -EBUSY; - } - - if (event == CPUFREQ_GOV_STOP) - policy->governor_enabled = false; - else if (event == CPUFREQ_GOV_START) - policy->governor_enabled = true; - - mutex_unlock(&cpufreq_governor_lock); - ret = policy->governor->governor(policy, event); if (!ret) { @@ -2121,14 +2105,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, policy->governor->initialized++; else if (event == CPUFREQ_GOV_POLICY_EXIT) policy->governor->initialized--; - } else { - /* Restore original values */ - mutex_lock(&cpufreq_governor_lock); - if (event == CPUFREQ_GOV_STOP) - policy->governor_enabled = true; - else if (event == CPUFREQ_GOV_START) - policy->governor_enabled = false; - mutex_unlock(&cpufreq_governor_lock); } if (((event == CPUFREQ_GOV_POLICY_INIT) && ret) || diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 29ad97c34fd5..bb02f9a6bbc5 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -81,7 +81,6 @@ struct cpufreq_policy { unsigned int policy; /* see above */ struct cpufreq_governor *governor; /* see below */ void *governor_data; - bool governor_enabled; /* governor start/stop flag */ char last_governor[CPUFREQ_NAME_LEN]; /* last governor used */ struct work_struct update; /* if update_policy() needs to be