From patchwork Wed Jul 8 05:53:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50857 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 587A622A03 for ; Wed, 8 Jul 2015 05:54:12 +0000 (UTC) Received: by wipp2 with SMTP id p2sf48724737wip.2 for ; Tue, 07 Jul 2015 22:54:11 -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=TbzJ+c6iP/sdPSD94NkjIq4XvBs33iaiEpLX+AvGMZY=; b=AOBs8Bd7q+4JHRMt0TxB0B6WdzeDbbnVITFspLfK0NeIzJeDNjBCq0Al6xRu9PyR1O 5qQb3UMNauBDoSLQtg9dNn9pXeJVRVuEJmDpGHpY7HJHk4L9CSihNTwq/V4wQSbPWHR/ G299P91zbQD9GvR+Kb1cqAH2iUWplEg07yLbyEsDllA6OTaoTBLtU7lPOAVdE3t4Zid0 TfZ4c+Z8LBPjTpIYJ4rBqYeWPIgM2lkAWD11ePR63/dU4+mhBOJmzq8wJH6p2NaqDZyA Xj+tJVB/Rf3ILOYJoQXmg17Y5KBCdN+2h/K+m+h8YC+DK/bI2I5JTqtSTfSViVjD0kPq JdQg== X-Gm-Message-State: ALoCoQnAuTAgAnuUGAeYA++/ilHlCN9b4QIa4CAvMsIYVOu4Byy2Dc4sYumf3nzcrNo3IZboynHS X-Received: by 10.180.97.9 with SMTP id dw9mr19784819wib.2.1436334851704; Tue, 07 Jul 2015 22:54:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.3 with SMTP id ky3ls67091lab.70.gmail; Tue, 07 Jul 2015 22:54:11 -0700 (PDT) X-Received: by 10.152.43.69 with SMTP id u5mr7423875lal.119.1436334851541; Tue, 07 Jul 2015 22:54:11 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id a4si871629lae.4.2015.07.07.22.54.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 22:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagc2 with SMTP id c2so215210048lag.3 for ; Tue, 07 Jul 2015 22:54:11 -0700 (PDT) X-Received: by 10.112.55.207 with SMTP id u15mr7492076lbp.88.1436334851415; Tue, 07 Jul 2015 22:54:11 -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 hn6csp2837770lbb; Tue, 7 Jul 2015 22:54:10 -0700 (PDT) X-Received: by 10.67.29.175 with SMTP id jx15mr16504062pad.99.1436334849751; Tue, 07 Jul 2015 22:54:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zw9si2111743pbc.206.2015.07.07.22.54.08; Tue, 07 Jul 2015 22:54:09 -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 S1753749AbbGHFyF (ORCPT + 11 others); Wed, 8 Jul 2015 01:54:05 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:35502 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752910AbbGHFyE (ORCPT ); Wed, 8 Jul 2015 01:54:04 -0400 Received: by pdrg1 with SMTP id g1so7897997pdr.2 for ; Tue, 07 Jul 2015 22:54:04 -0700 (PDT) X-Received: by 10.68.223.165 with SMTP id qv5mr16960082pbc.82.1436334844014; Tue, 07 Jul 2015 22:54:04 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id f8sm1049847pas.10.2015.07.07.22.54.02 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 07 Jul 2015 22:54:03 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , Pi-Cheng Chen , "Jon Medhurst (Tixy)" , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] cpufreq: Initialize the governor again while restoring policy Date: Wed, 8 Jul 2015 11:23:58 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 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.42 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: , When all CPUs of a policy are hot-unplugged, we EXIT the governor but don't mark policy->governor as NULL. This was done in order to keep last used governor's information intact in sysfs, while the CPUs are offline. We also missed marking policy->governor as NULL while restoring the policy. Because of that, we call __cpufreq_governor(CPUFREQ_GOV_LIMITS) for an uninitialized policy. Which eventually returns -EBUSY. Fix this by setting policy->governor to NULL while restoring the policy. Reported-by: Pi-Cheng Chen Reported-by: "Jon Medhurst (Tixy)" Fixes: 18bf3a124ef8 ("cpufreq: Mark policy->governor = NULL for inactive policies") Signed-off-by: Viresh Kumar Tested-by: "Pi-Cheng Chen " Tested-by: Jon Medhurst --- For 4.2-rc drivers/cpufreq/cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index b612411655f9..2c22e3902e72 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1132,6 +1132,7 @@ static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu) down_write(&policy->rwsem); policy->cpu = cpu; + policy->governor = NULL; up_write(&policy->rwsem); }