From patchwork Tue Feb 2 10:57:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 61007 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp651152lbb; Tue, 2 Feb 2016 02:58:08 -0800 (PST) X-Received: by 10.66.166.73 with SMTP id ze9mr45320836pab.67.1454410687848; Tue, 02 Feb 2016 02:58:07 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uh6si1296141pab.3.2016.02.02.02.58.07; Tue, 02 Feb 2016 02:58:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754819AbcBBK6A (ORCPT + 30 others); Tue, 2 Feb 2016 05:58:00 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:35235 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754499AbcBBK55 (ORCPT ); Tue, 2 Feb 2016 05:57:57 -0500 Received: by mail-pf0-f176.google.com with SMTP id 65so101422044pfd.2 for ; Tue, 02 Feb 2016 02:57:56 -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=faKzDMgRq4XlRIW65rELxAmFdJ06uV+ijUdHvf74NNw=; b=Qb10ej8zstLKq13PNuE0+v+kLarx/1snSkD6U4l9GhabvpEh2/DlzCzYaDunjj1TIU JF5Fye8k3O5/3A00AB1Lrp2icymKSZ/RG/6bgy6xTmUuiIFOMv0WNne3k9PnHf2D+1yR sbC00r6JWTAYUGbNdJg+xsntjIjGvYoqk50D4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=faKzDMgRq4XlRIW65rELxAmFdJ06uV+ijUdHvf74NNw=; b=BbhrtfhKeEnuq8pDNTWobW/X92sFzELgWQLFFESjJ48XYe7KP0+9OE7Mb4wc+/i5S0 PI5CeGn7pZZoSpQlkH6fpKuJYXSxJtrsSteL5gnmIjF3acGtJYEonbCblxKoELp2Hf5P /PDKjMRyhI0nGMK1jBOc+BMgAduIHoAuf14SRyfa4x6VY4K3NWjfqSE6raIkqP7ElowX /FhPmkaMcGNiXuzvwBHmS4pWrYJzspGDcIkPYqdduhxkxWbWscUAQx3PFvWsDCnmx9hV DySoBGdtyRLjuInHg+eyVhjXHslBuK4PZhEl31gqHa45MowwEL6PfPIUc0lA7KRBcXf+ n+cw== X-Gm-Message-State: AG10YOQxwIcJOdFg3FKqG3KBHuDeyP7IfapeG0ITIEs1HHRYvYfuw0om4pnidWqjP/JdfGxz X-Received: by 10.98.67.153 with SMTP id l25mr46184826pfi.111.1454410676721; Tue, 02 Feb 2016 02:57:56 -0800 (PST) Received: from localhost ([122.172.22.246]) by smtp.gmail.com with ESMTPSA id n8sm1793917pfj.46.2016.02.02.02.57.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Feb 2016 02:57:56 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , juri.lelli@arm.com Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, skannan@codeaurora.org, peterz@infradead.org, mturquette@baylibre.com, steve.muckle@linaro.org, vincent.guittot@linaro.org, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 4/5] cpufreq: Don't drop rwsem before calling CPUFREQ_GOV_POLICY_EXIT Date: Tue, 2 Feb 2016 16:27:24 +0530 Message-Id: <3d58d4f0bec5e8e941cf96e159c8c21e68956cad.1454410226.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.0.79.gdc08a19 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 955ef4833574 ("cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT") dropped these because of some ABBA lockup issues. The previous commit has fixed them all and we don't need to drop these locks anymore. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 5 ----- include/linux/cpufreq.h | 4 ---- 2 files changed, 9 deletions(-) -- 2.7.0.79.gdc08a19 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index e979ec78b695..5f7e24567e0e 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2155,10 +2155,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, return ret; } - up_write(&policy->rwsem); ret = __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); - down_write(&policy->rwsem); - if (ret) { pr_err("%s: Failed to Exit Governor: %s (%d)\n", __func__, old_gov->name, ret); @@ -2174,9 +2171,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, if (!ret) goto out; - up_write(&policy->rwsem); __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); - down_write(&policy->rwsem); } /* new governor failed, so re-start old one */ diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 88a4215125bc..79b87cebaa9c 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -100,10 +100,6 @@ struct cpufreq_policy { * - Any routine that will write to the policy structure and/or may take away * the policy altogether (eg. CPU hotplug), will hold this lock in write * mode before doing so. - * - * Additional rules: - * - Lock should not be held across - * __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT); */ struct rw_semaphore rwsem;