From patchwork Fri Apr 25 07:52:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 29032 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 97C2A203AC for ; Fri, 25 Apr 2014 07:52:44 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lh14sf12655934vcb.6 for ; Fri, 25 Apr 2014 00:52:44 -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=mEx9rWVYCU6tDmS1Ru/wBkgCq1Aiv7GdRl3/LPCnLrg=; b=hjpssHZ537dLSeVYw42Wz8do/zuYItNUkySiqNsB1G32ckkRtUNfTR7EXWjWR107pB mfbG5lpC0qltnqWVopSwvHICgf/ZS6rKa9+9rY1dW/7t3q0yWuqTpTAgIvTDKITyfQG2 V72Ntzi5UoNZ4EdAQFW35X/0c1ATWUFyIW5EvNBVlb4DZNC/LUgizsi9HEHfN05fy0c3 TIWqfLDsbzU6sGiZ4KbOjlwuW+mJL8pnbYQ1pIy2YDy17bJQFFRcT+aA6Zl9uL4nTWwz 4YkWDfWtOR546STBHyxvFRDn8+RFxfJ1sA12fQxaLzJ3W4MEwDisEl6Vk6Vqe7Pson9V mG0A== X-Gm-Message-State: ALoCoQnLH1PAvUa8qzpiJd39FoBPl33YsvhNo+As1Ql0AzXkX5V3jvkdCJO+hmP0tde80GXYIGOS X-Received: by 10.58.112.97 with SMTP id ip1mr3896225veb.32.1398412364357; Fri, 25 Apr 2014 00:52:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.163 with SMTP id d32ls1343357qgd.44.gmail; Fri, 25 Apr 2014 00:52:44 -0700 (PDT) X-Received: by 10.221.20.199 with SMTP id qp7mr5498234vcb.24.1398412364218; Fri, 25 Apr 2014 00:52:44 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id u5si1528769vdo.76.2014.04.25.00.52.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Apr 2014 00:52:44 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id jw12so4190319veb.23 for ; Fri, 25 Apr 2014 00:52:44 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr5546740vcb.16.1398412364134; Fri, 25 Apr 2014 00:52:44 -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.221.72 with SMTP id ib8csp77767vcb; Fri, 25 Apr 2014 00:52:42 -0700 (PDT) X-Received: by 10.68.254.103 with SMTP id ah7mr5712352pbd.159.1398412361759; Fri, 25 Apr 2014 00:52:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wh9si4231270pac.459.2014.04.25.00.52.41; Fri, 25 Apr 2014 00:52:41 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1752151AbaDYHw3 (ORCPT + 27 others); Fri, 25 Apr 2014 03:52:29 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:53578 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736AbaDYHw0 (ORCPT ); Fri, 25 Apr 2014 03:52:26 -0400 Received: by mail-wi0-f173.google.com with SMTP id z2so2263091wiv.0 for ; Fri, 25 Apr 2014 00:52:25 -0700 (PDT) X-Received: by 10.194.205.161 with SMTP id lh1mr5432688wjc.40.1398412345155; Fri, 25 Apr 2014 00:52:25 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id fi2sm4230022wib.2.2014.04.25.00.52.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 25 Apr 2014 00:52:24 -0700 (PDT) From: Viresh Kumar To: rjw@rjwysocki.net, mroos@linux.ee 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, Viresh Kumar Subject: [PATCH] cpufreq: Set CPUFREQ_ASYNC_NOTIFICATION for drivers handling notification Date: Fri, 25 Apr 2014 13:22:04 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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: , CPUFREQ_ASYNC_NOTIFICATION was initially designed for drivers which don't want core to send notifications for them as they wouldn't finish frequency transitions in ->target_index(). But there were other kinds of drivers as well who don't have straight forward implementations of ->target_index() routines and wanted to handle notifications themselves. Patch: 7dbf694 (cpufreq: distinguish drivers that do asynchronous notifications) missed addressing these drivers and that caused these drivers to send double notifications. Initially cpufreq core sends a notification for these and then the drivers themselves. It might not cause a big problem for kernels (3.13/3.14) which doesn't have this patch in: 12478cf (cpufreq: Make sure frequency transitions are serialized), as this came in v3.15-rc1. Reason being, we are sending an extra notification for the same frequency, and so other kernel code that depends on it shouldn't behave badly. Above patch broke things as it forces serialization of notifications, so that we aren't configuring same hardware registers simultaneously. Reported-by: Meelis Roos Signed-off-by: Viresh Kumar --- Hi Rafael, This one is for rc3 surely :) Also, as I mentioned above it might not create any problems for 3.13 and 3.14. And so I havne't cc'd stable for those kernels. Please add them in case you feel its still better to get it fixed. drivers/cpufreq/longhaul.c | 1 + drivers/cpufreq/powernow-k6.c | 1 + drivers/cpufreq/powernow-k7.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index d00e5d1..41f3d28 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c @@ -909,6 +909,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) } static struct cpufreq_driver longhaul_driver = { + .flags = CPUFREQ_ASYNC_NOTIFICATION, .verify = cpufreq_generic_frequency_table_verify, .target_index = longhaul_target, .get = longhaul_get, diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c index 49f120e..080bbb9 100644 --- a/drivers/cpufreq/powernow-k6.c +++ b/drivers/cpufreq/powernow-k6.c @@ -242,6 +242,7 @@ static unsigned int powernow_k6_get(unsigned int cpu) } static struct cpufreq_driver powernow_k6_driver = { + .flags = CPUFREQ_ASYNC_NOTIFICATION, .verify = cpufreq_generic_frequency_table_verify, .target_index = powernow_k6_target, .init = powernow_k6_cpu_init, diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index f911645..fccfc25 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c @@ -677,6 +677,7 @@ static int powernow_cpu_exit(struct cpufreq_policy *policy) } static struct cpufreq_driver powernow_driver = { + .flags = CPUFREQ_ASYNC_NOTIFICATION, .verify = cpufreq_generic_frequency_table_verify, .target_index = powernow_target, .get = powernow_get,