From patchwork Thu Feb 19 11:32:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 44822 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83BCA21554 for ; Thu, 19 Feb 2015 11:33:56 +0000 (UTC) Received: by wesu56 with SMTP id u56sf4662965wes.1 for ; Thu, 19 Feb 2015 03:33:55 -0800 (PST) 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=eJpX+kSLOBLhHX7sVk0Loji3vBtR2sN/53DVCKiPA0s=; b=Blf1iGw/L8+WQ0hrxBd/ro5wOB02PT0ogF9m+KkmOnrt5z2fLFhVVXnbSjyTo9FNP5 avwhlPtVXq3M+BwtgEPCZ9TFrqNlNhDKuqggEU5HA6w8b0Ri8Kd/MX5X4Smfv/45j54D 2cfC9J5Od4B/h4xpgMd4ACGNNOq49Gxq5bavyrkbDyeud+7mIzTVfmjamk8iC/PFt8Mt mp98joyn0Ro/nHgHU22BmrH9c/sF2e8v3o3rgZxynwS79gBjh9XVPlk7ILSyFaGsjQv2 gIuIZK150SAbhPcCmtp7VfdZzdWPat/N+oCd73eeFO1kq2gYNMl3SuvYfpZO8o7NhPs6 3iOQ== X-Gm-Message-State: ALoCoQlahD3FSQkKGqneXyCGpWKMgHKTBp60N3wbZk+slC03KSHbbqeHsl5zJ+EVyuKsqeOlZmRe X-Received: by 10.180.94.134 with SMTP id dc6mr962646wib.2.1424345635886; Thu, 19 Feb 2015 03:33:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.242.164 with SMTP id wr4ls156089lac.79.gmail; Thu, 19 Feb 2015 03:33:55 -0800 (PST) X-Received: by 10.152.5.101 with SMTP id r5mr3520114lar.33.1424345635713; Thu, 19 Feb 2015 03:33:55 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id b5si17021668laa.156.2015.02.19.03.33.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 03:33:55 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labhz20 with SMTP id hz20so6985380lab.0 for ; Thu, 19 Feb 2015 03:33:55 -0800 (PST) X-Received: by 10.112.42.225 with SMTP id r1mr86876lbl.72.1424345635614; Thu, 19 Feb 2015 03:33:55 -0800 (PST) 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.35.133 with SMTP id h5csp431644lbj; Thu, 19 Feb 2015 03:33:54 -0800 (PST) X-Received: by 10.68.191.2 with SMTP id gu2mr6495897pbc.149.1424345633962; Thu, 19 Feb 2015 03:33:53 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id on3si3330575pac.16.2015.02.19.03.33.52; Thu, 19 Feb 2015 03:33:53 -0800 (PST) Received-SPF: none (google.com: linux-pm-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 S1753237AbbBSLdu (ORCPT + 11 others); Thu, 19 Feb 2015 06:33:50 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:38018 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752793AbbBSLdt (ORCPT ); Thu, 19 Feb 2015 06:33:49 -0500 Received: by pdbfp1 with SMTP id fp1so8275373pdb.5 for ; Thu, 19 Feb 2015 03:33:49 -0800 (PST) X-Received: by 10.70.37.202 with SMTP id a10mr7065826pdk.108.1424345629213; Thu, 19 Feb 2015 03:33:49 -0800 (PST) Received: from localhost ([122.172.249.58]) by mx.google.com with ESMTPSA id ux7sm20518003pab.19.2015.02.19.03.33.47 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Feb 2015 03:33:48 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, sboyd@codeaurora.org, prarit@redhat.com, skannan@codeaurora.org, Viresh Kumar Subject: [PATCH V2 07/20] cpufreq: Call schedule_work() for the last active policy Date: Thu, 19 Feb 2015 17:02:09 +0530 Message-Id: X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d 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.215.52 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: , We need to call schedule_work() only for the policy belonging to boot CPU, i.e. CPU0. Checking for list_is_last() wouldn't work anymore as there can be inactive policies present in the list after the last active one. 'policy' still points to the last active policy at the termination of the for_each_active_policy() loop, use that to call schedule_work(). Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index d3f9ce3b94d3..e728c796c327 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1779,15 +1779,14 @@ void cpufreq_resume(void) || __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS)) pr_err("%s: Failed to start governor for policy: %p\n", __func__, policy); - - /* - * schedule call cpufreq_update_policy() for boot CPU, i.e. last - * policy in list. It will verify that the current freq is in - * sync with what we believe it to be. - */ - if (list_is_last(&policy->policy_list, &cpufreq_policy_list)) - schedule_work(&policy->update); } + + /* + * schedule call cpufreq_update_policy() for boot CPU, i.e. last + * policy in list. It will verify that the current freq is in + * sync with what we believe it to be. + */ + schedule_work(&policy->update); } /**