From patchwork Mon Mar 24 06:48:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 26917 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F148202E7 for ; Mon, 24 Mar 2014 06:48:46 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id r5sf12838534qcx.1 for ; Sun, 23 Mar 2014 23:48:46 -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=PaMNm1ofzXP6DNMH6wXfupGgYz/ayxpRlYe70fVl8qM=; b=eJXJP7U++tVQOQGc2GVoXf3icbRAQ4DS9XjhO2IauRyuqBr/T+frlHBIUYyE1LMpQZ hF8d51T6AxLNrIb1IwJMYCVL8iN06y8X/gRt+0oOnsPdEeWoDZOto+JeudekVrVZbVmG 5N3VULZHf9s9FdCXxxbBRgWVGhEBcsplYImPNF8cOBws3CdMXHbd85C4rcakLRev/F5W wXMvXH9uKRRxGmDGeRa+FBVz+wN4KCo/piSComMt5JSlROIKWT/gdFuLyL+Cr216SHIe 0bN3wGABizf7HxWfFMG49Sxo/bMIb0D2cBZFWehhQTskpLaPllKJeModzzKI9vxyBUkx aZyA== X-Gm-Message-State: ALoCoQlg4M4GbSbQJeY91Wu0K04IAbB3AuaRirxGUE36FhBDJz4lzoeb+iTR8tgMmau4JhWzPVtD X-Received: by 10.236.84.141 with SMTP id s13mr18335381yhe.5.1395643725959; Sun, 23 Mar 2014 23:48:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.75 with SMTP id 69ls1580895qgm.94.gmail; Sun, 23 Mar 2014 23:48:45 -0700 (PDT) X-Received: by 10.58.122.164 with SMTP id lt4mr49049953veb.2.1395643725828; Sun, 23 Mar 2014 23:48:45 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id fi2si2911538vdb.190.2014.03.23.23.48.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Mar 2014 23:48:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so5253550veb.14 for ; Sun, 23 Mar 2014 23:48:45 -0700 (PDT) X-Received: by 10.59.7.228 with SMTP id df4mr5716843ved.11.1395643725674; Sun, 23 Mar 2014 23:48:45 -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.220.78.9 with SMTP id i9csp200901vck; Sun, 23 Mar 2014 23:48:45 -0700 (PDT) X-Received: by 10.66.149.37 with SMTP id tx5mr68505122pab.81.1395643724600; Sun, 23 Mar 2014 23:48:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si8466970pbn.390.2014.03.23.23.48.44; Sun, 23 Mar 2014 23:48:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of cpufreq-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 S1750988AbaCXGsa (ORCPT + 6 others); Mon, 24 Mar 2014 02:48:30 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:54598 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751934AbaCXGs2 (ORCPT ); Mon, 24 Mar 2014 02:48:28 -0400 Received: by mail-we0-f171.google.com with SMTP id t61so3063743wes.2 for ; Sun, 23 Mar 2014 23:48:26 -0700 (PDT) X-Received: by 10.180.96.200 with SMTP id du8mr13348348wib.43.1395643706785; Sun, 23 Mar 2014 23:48:26 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id em1sm34055733wid.5.2014.03.23.23.48.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 23 Mar 2014 23:48:26 -0700 (PDT) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, srivatsa.bhat@linux.vnet.ibm.com, ego@linux.vnet.ibm.com, svaidy@linux.vnet.ibm.com, l.majewski@samsung.com, Viresh Kumar Subject: [PATCH] cpufreq: set value of CPUFREQ_BOOST_FREQ to 0xABABABAB Date: Mon, 24 Mar 2014 12:18:14 +0530 Message-Id: <78187ea173460c871eef31432ec2a80ec657fe30.1395643393.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e Sender: cpufreq-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: cpufreq@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=neutral (google.com: 209.85.128.169 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 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: , Ideally, .driver_data field of struct cpufreq_frequency_table must not be used by core at all. But during a recent change if its value is same as CPUFREQ_BOOST_FREQ macro, then it is treated specially by core. The value of this macro was set to ~2 earlier, i.e. 0xFFFFFFFD. In case some driver is using this field for its own data and sets this field to -3, then with two's complement that value will also become 0xFFFFFFFD. To fix this issue, lets change value of this flag to a very uncommon value which shouldn't be used by any driver unless they want to use BOOST feature. Along with this update comments to make this more clear. Signed-off-by: Viresh Kumar --- Gautham/Vaidy: I hope this fixes the problem we discussed for your patchset. include/linux/cpufreq.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index c48e595..9f25d9d 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -455,12 +455,18 @@ extern struct cpufreq_governor cpufreq_gov_conservative; * FREQUENCY TABLE HELPERS * *********************************************************************/ +/* Special Values of .frequency field */ #define CPUFREQ_ENTRY_INVALID ~0 #define CPUFREQ_TABLE_END ~1 -#define CPUFREQ_BOOST_FREQ ~2 +/* Special Values of .driver_data field */ +#define CPUFREQ_BOOST_FREQ 0xABABABAB struct cpufreq_frequency_table { - unsigned int driver_data; /* driver specific data, not used by core */ + /* + * driver specific data, not used by core unless it is set to + * CPUFREQ_BOOST_FREQ. + */ + unsigned int driver_data; unsigned int frequency; /* kHz - doesn't need to be in ascending * order */ };