From patchwork Tue Sep 30 04:03:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 38113 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D17D202DB for ; Tue, 30 Sep 2014 04:03:57 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf5730430lab.6 for ; Mon, 29 Sep 2014 21:03:56 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=X3KU35qllBE4GaUAvZ2jo1MpftWkSuzHWHZWIczkShc=; b=dZWEaOai1a95/xgHI9Vi6K4s2lL/ja+Iyi2Fe+OKNPOAeVh2vYjlx1fYEFjpbcxS8c EK3K/0LS2ssdqu3WWvfdnsYpGb9Vf2aNCUilD7ELogFV8Eja0aT7kPsToirHIIhjEhd3 NTjevetJmeknSh16Qai3HHWIduX1LwfP5BzhRVkxe0i6vsz3dfnCkkl9dr9m9bLgb6uf ItrchpAm4ULrMSy1VpbNmYnw45DfI9MvPYAUX+XT+KKn5+Hz/4wUz4slS9EpHy7OM7PO fjRcAdL8159fWZTQGgltSZ0KLsoAYhx5AJ2oSqeAYirW3mkTYLVpPS0iJsY5p5cDpa4T cm+g== X-Gm-Message-State: ALoCoQmmjKBBE75pD9BAihAD4tU8SIWh7XTH4EhJUaDDoBi323M55jBi1cz64QWbux393xlhA3bT X-Received: by 10.152.2.97 with SMTP id 1mr125496lat.6.1412049836035; Mon, 29 Sep 2014 21:03:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.226 with SMTP id d2ls648664lab.66.gmail; Mon, 29 Sep 2014 21:03:55 -0700 (PDT) X-Received: by 10.112.25.65 with SMTP id a1mr41746976lbg.85.1412049835802; Mon, 29 Sep 2014 21:03:55 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by mx.google.com with ESMTPS id jo8si20773351lab.25.2014.09.29.21.03.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Sep 2014 21:03:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id mc6so19031768lab.6 for ; Mon, 29 Sep 2014 21:03:55 -0700 (PDT) X-Received: by 10.152.42.136 with SMTP id o8mr43737701lal.71.1412049835651; Mon, 29 Sep 2014 21:03:55 -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.130.169 with SMTP id of9csp280733lbb; Mon, 29 Sep 2014 21:03:54 -0700 (PDT) X-Received: by 10.66.139.106 with SMTP id qx10mr66317395pab.126.1412049834204; Mon, 29 Sep 2014 21:03:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xg2si25802217pab.67.2014.09.29.21.03.53 for ; Mon, 29 Sep 2014 21:03:54 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750760AbaI3EDw (ORCPT + 1 other); Tue, 30 Sep 2014 00:03:52 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:35208 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbaI3EDv (ORCPT ); Tue, 30 Sep 2014 00:03:51 -0400 Received: by mail-pd0-f174.google.com with SMTP id y13so2123039pdi.33 for ; Mon, 29 Sep 2014 21:03:51 -0700 (PDT) X-Received: by 10.66.121.65 with SMTP id li1mr64233931pab.128.1412049831156; Mon, 29 Sep 2014 21:03:51 -0700 (PDT) Received: from localhost ([122.167.74.155]) by mx.google.com with ESMTPSA id kk7sm13863503pab.31.2014.09.29.21.03.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 29 Sep 2014 21:03:50 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , tianyu.lan@intel.com Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar , "3.15+" Subject: [PATCH] cpufreq: update 'cpufreq_suspended' after stopping governors Date: Tue, 30 Sep 2014 09:33:17 +0530 Message-Id: <999a633cbd722157ab80611b98c26107ddc7bd9c.1412049692.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@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.215.47 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: , Commit 8e30444e1530 ("cpufreq: fix cpufreq suspend/resume for intel_pstate") introduced a bug where the governors wouldn't be stopped anymore for ->target{_index}() drivers during suspend. This happens because 'cpufreq_suspended' is updated before stopping the governors during suspend and due to this __cpufreq_governor() would return early due to this check: /* Don't start any governor operations if we are entering suspend */ if (cpufreq_suspended) return 0; This patch tries to fix this bug. Fixes: 8e30444e1530 ("cpufreq: fix cpufreq suspend/resume for intel_pstate") Cc: 3.15+ # 3.15+ Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6e93e7f..61190f6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1658,10 +1658,8 @@ void cpufreq_suspend(void) if (!cpufreq_driver) return; - cpufreq_suspended = true; - if (!has_target()) - return; + goto suspend; pr_debug("%s: Suspending Governors\n", __func__); @@ -1674,6 +1672,9 @@ void cpufreq_suspend(void) pr_err("%s: Failed to suspend driver: %p\n", __func__, policy); } + +suspend: + cpufreq_suspended = true; } /**