From patchwork Thu Sep 12 05:25:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19987 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0235420F59 for ; Thu, 12 Sep 2013 05:27:27 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ht10sf11372994vcb.9 for ; Wed, 11 Sep 2013 22:27:27 -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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=7+nEy1LVtnHlkF/e43IA32r7M+J72I3IAUgNeQFnh78=; b=hP3ABKXtoe9XP7T+KbTAdErOrKwNhfxziQmf2YCK4w9qBZtOmPMwYuZnXikL03PVZU 5wwmFtqhk5BlCB2zG+P5xkEnkB0vpLbQbmeZMM/+uHoOAngrrGLjwTWvrr6YdZBk7Np8 pTgyQ7uvZi0Tk8y3m7Z46Fb41foURXEo1fPTo2lnkPOyyp8CsxbLz6MT8h68pdctyYxr p7ayJsAn+3GrvgCrLm6p2qC7qkEVeXYlzNa2/iMknTnjfJpYhj4WwhPE/MNX5RX775Sm T6CmeR26HXlUK6aC8BG1tcXw678VNZpQiACymsnB/6STahkQjk1dDKQ54KLE8m3CwYqR /ogA== X-Gm-Message-State: ALoCoQnD6Jfl+Ad2KRIcXeKRWC2lxOqfYM+84R+0Ugdamz89Czd098OFqGxPDjg9W2TDwytLP/ey X-Received: by 10.236.90.67 with SMTP id d43mr2135756yhf.36.1378963647794; Wed, 11 Sep 2013 22:27:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.70 with SMTP id i6ls588641qei.26.gmail; Wed, 11 Sep 2013 22:27:27 -0700 (PDT) X-Received: by 10.220.10.194 with SMTP id q2mr4836554vcq.2.1378963647570; Wed, 11 Sep 2013 22:27:27 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id tm8si657976vdc.46.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 22:27:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id x14so7161193vbb.9 for ; Wed, 11 Sep 2013 22:27:27 -0700 (PDT) X-Received: by 10.220.181.136 with SMTP id by8mr4963500vcb.11.1378963647481; Wed, 11 Sep 2013 22:27:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp874vcz; Wed, 11 Sep 2013 22:27:27 -0700 (PDT) X-Received: by 10.68.225.232 with SMTP id rn8mr5693998pbc.32.1378963646627; Wed, 11 Sep 2013 22:27:26 -0700 (PDT) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id ar2si1377944pbc.352.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 22:27:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id bg4so611899pad.18 for ; Wed, 11 Sep 2013 22:27:26 -0700 (PDT) X-Received: by 10.66.154.1 with SMTP id vk1mr7595276pab.85.1378963646155; Wed, 11 Sep 2013 22:27:26 -0700 (PDT) Received: from localhost ([106.197.36.204]) by mx.google.com with ESMTPSA id w6sm2131332pbt.32.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Sep 2013 22:27:25 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl, swarren@wwwdotorg.org, srivatsa.bhat@linux.vnet.ibm.com Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 4/5] cpufreq: don't update policy->cpu while removing while removing other CPUs Date: Thu, 12 Sep 2013 10:55:47 +0530 Message-Id: <0475c234b6ca2849c8a69dad0446d82b065b4161.1378963070.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , With a recent change the logic here is changed a bit and I just figured out it is something we don't want. Consider we have four CPUs (0,1,2,3) managed by a policy and policy->cpu is set to 0. Now we are suspending and hence we call __cpufreq_remove_dev_prepare() for cpu 1, 2 & 3.. With the current code we always call cpufreq_nominate_new_policy_cpu() for cpu 1, 2 & 3 whereas we should skipped most of __cpufreq_remove_dev_prepare() routine. Lets fix it by moving the check for !frozen inside the first if block. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5e0a82e..0e11fcb 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1182,8 +1182,9 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, cpumask_clear_cpu(cpu, policy->cpus); unlock_policy_rwsem_write(cpu); - if (cpu != policy->cpu && !frozen) { - sysfs_remove_link(&dev->kobj, "cpufreq"); + if (cpu != policy->cpu) { + if (!frozen) + sysfs_remove_link(&dev->kobj, "cpufreq"); } else if (cpus > 1) { new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu, frozen); if (new_cpu >= 0) {