From patchwork Fri Jan 2 07:04:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 42681 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 21BFE26CD1 for ; Fri, 2 Jan 2015 07:05:35 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id w61sf2044521wes.8 for ; Thu, 01 Jan 2015 23:05:34 -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=EMI4b9GN7e6W0Q3zCenwFT2aW3bzItmO5TvN7CXqpR4=; b=h//VCarmi9VzBZr6k/s1CUg9lG43SFfPtBjj8MJc/MDLh8mm/qkKLhZ2/zXt1HUj2a rrs3yhPTyEpFmVxxdvbvc1bdJpIAvC+59M+D/wFK2rYnaoZ03GnGPrQUqwzWVqkZc7bg bjDZPYitB22RNB9PTFJm7SauBwO9DEj99W7XJiVQa3k3DQFVSAOGx0rXTSC6IWCsJtSQ xqPe8qTMZMzZXjCmNPmpXxwHmfm2Ur2jot8gVFRkrZsmdebnJyi17K9PSK3n9GIdSa7b bwk0gBUKP/foQOrm1KCQIrjjRzXbDS2xYkoNu+JvAjDQRJ+5iP9oZv6/6bzGHZE0QQpt K0CQ== X-Gm-Message-State: ALoCoQkhOSE3c1j5cls1effHzTomviHi0gNHezfv5TVRAg+y5A2QSdMpjsnsojZci242VaIO5Cv3 X-Received: by 10.112.148.198 with SMTP id tu6mr6329976lbb.3.1420182334105; Thu, 01 Jan 2015 23:05:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.137 with SMTP id w9ls1938095lal.5.gmail; Thu, 01 Jan 2015 23:05:33 -0800 (PST) X-Received: by 10.112.12.134 with SMTP id y6mr33342709lbb.34.1420182333903; Thu, 01 Jan 2015 23:05:33 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id zp10si50415314lbb.104.2015.01.01.23.05.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:33 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ms9so15167486lab.10 for ; Thu, 01 Jan 2015 23:05:33 -0800 (PST) X-Received: by 10.152.37.7 with SMTP id u7mr75499782laj.74.1420182333814; Thu, 01 Jan 2015 23:05:33 -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.9.200 with SMTP id c8csp126165lbb; Thu, 1 Jan 2015 23:05:32 -0800 (PST) X-Received: by 10.68.217.97 with SMTP id ox1mr119166356pbc.53.1420182332036; Thu, 01 Jan 2015 23:05:32 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dl1si29047854pbb.67.2015.01.01.23.05.30; Thu, 01 Jan 2015 23:05:32 -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 S1750756AbbABHF3 (ORCPT + 12 others); Fri, 2 Jan 2015 02:05:29 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:64644 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbbABHF3 (ORCPT ); Fri, 2 Jan 2015 02:05:29 -0500 Received: by mail-pd0-f175.google.com with SMTP id g10so23299947pdj.20 for ; Thu, 01 Jan 2015 23:05:28 -0800 (PST) X-Received: by 10.69.1.37 with SMTP id bd5mr52383843pbd.129.1420182328674; Thu, 01 Jan 2015 23:05:28 -0800 (PST) Received: from localhost ([122.167.116.151]) by mx.google.com with ESMTPSA id ut7sm45623292pbc.8.2015.01.01.23.05.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:28 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, prarit@redhat.com, skannan@codeaurora.org, Viresh Kumar Subject: [PATCH 09/17] cpufreq: update driver_data->flags only if we are registering driver Date: Fri, 2 Jan 2015 12:34:30 +0530 Message-Id: <05f9c739f27a395152220a75963258e52183582e.1420181916.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.2.0 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.51 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 should first check if a cpufreq driver is already registered or not before updating driver_data->flags. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 35d4734ce856..9595107477a6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2427,9 +2427,6 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) pr_debug("trying to register driver %s\n", driver_data->name); - if (driver_data->setpolicy) - driver_data->flags |= CPUFREQ_CONST_LOOPS; - write_lock_irqsave(&cpufreq_driver_lock, flags); if (cpufreq_driver) { write_unlock_irqrestore(&cpufreq_driver_lock, flags); @@ -2438,6 +2435,9 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) cpufreq_driver = driver_data; write_unlock_irqrestore(&cpufreq_driver_lock, flags); + if (driver_data->setpolicy) + driver_data->flags |= CPUFREQ_CONST_LOOPS; + if (cpufreq_boost_supported()) { /* * Check if driver provides function to enable boost -