From patchwork Tue Aug 5 10:53:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 34938 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AFDDE20523 for ; Tue, 5 Aug 2014 10:53:54 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at20sf3229586iec.7 for ; Tue, 05 Aug 2014 03:53:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=zoH+0M/tHQzhpAAWHDgM/5c20LoI5a4ym1aXxsR28Hw=; b=DHQ3ui0qBT9lIzMvOBhF1sIDIOwNaFS0mssyL1Z9cEwyobv00vzZLa9PHWtLKzTpi/ 8NQ3sAYfhAPy2HQ5ZFRH44hM17FLO/hQbSGx7uQ6aCpt/C0NiSFAUNYMBzZ+kC5IBfFj 1EEBR7XVQS9Mcu45FKoTkH1SbWezsFFtVGP6AErnhSbUYckgV3AjNcBe7BM0EC65saq4 CO2/NAjxzIm3B/GzMM1p67hR4+tyihmQ5aYdjVTRA2tLeV6RnVgSC104qBtkWKji7q6y X74/Y2mfElyzD7uBZgdJhTyq/LnOF+VxqdH8lEf0pkWRlX4/CVjqB4b647SbGrONqDGh 5fdw== X-Gm-Message-State: ALoCoQls1kOjBw9pNCgeQPDI3cCEh8567nk1xHU7ZtjCc8SylLl5yw7yhaAeElKcV2yIqBeKaFsP X-Received: by 10.182.126.198 with SMTP id na6mr1594970obb.4.1407236034235; Tue, 05 Aug 2014 03:53:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.35 with SMTP id g32ls233122qgd.53.gmail; Tue, 05 Aug 2014 03:53:54 -0700 (PDT) X-Received: by 10.52.244.138 with SMTP id xg10mr2032632vdc.40.1407236034130; Tue, 05 Aug 2014 03:53:54 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id x5si786003vcy.51.2014.08.05.03.53.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 03:53:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so1100011vcb.24 for ; Tue, 05 Aug 2014 03:53:54 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr1034897vcb.48.1407236034013; Tue, 05 Aug 2014 03:53:54 -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.221.37.5 with SMTP id tc5csp374875vcb; Tue, 5 Aug 2014 03:53:53 -0700 (PDT) X-Received: by 10.68.130.38 with SMTP id ob6mr3149297pbb.141.1407236032461; Tue, 05 Aug 2014 03:53:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dt16si762854pdb.495.2014.08.05.03.53.51 for ; Tue, 05 Aug 2014 03:53:52 -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 S933211AbaHEKxp (ORCPT + 21 others); Tue, 5 Aug 2014 06:53:45 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:59545 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755191AbaHEKxm (ORCPT ); Tue, 5 Aug 2014 06:53:42 -0400 Received: by mail-oi0-f50.google.com with SMTP id a141so492686oig.37 for ; Tue, 05 Aug 2014 03:53:41 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.80.33 with SMTP id o1mr4236919obx.78.1407236021625; Tue, 05 Aug 2014 03:53:41 -0700 (PDT) Received: by 10.182.233.166 with HTTP; Tue, 5 Aug 2014 03:53:41 -0700 (PDT) In-Reply-To: <53E0B657.4070007@redhat.com> References: <1406634362-811-1-git-send-email-prarit@redhat.com> <2066166.pXm4lKLOID@vostro.rjw.lan> <53DA8389.80804@redhat.com> <1917362.abr2Y4p7vh@vostro.rjw.lan> <53DA8A41.2030601@redhat.com> <53DAA60B.6040802@codeaurora.org> <53DAA749.5080506@redhat.com> <53DAA95B.2040505@codeaurora.org> <53DAB038.3050007@redhat.com> <53DABFA6.6090503@codeaurora.org> <53DACA26.1000908@redhat.com> <53DAE592.2030909@codeaurora.org> <53DB6B81.6050400@redhat.com> <53DBCBE8.6010809@codeaurora.org> <53DBE764.8050109@redhat.com> <53DBEC27.7050803@codeaurora.org> <53E0B657.4070007@redhat.com> Date: Tue, 5 Aug 2014 16:23:41 +0530 Message-ID: Subject: Re: [PATCH] cpufreq, store_scaling_governor requires policy->rwsem to be held for duration of changing governors [v2] From: Viresh Kumar To: Prarit Bhargava Cc: Stephen Boyd , Saravana Kannan , "Rafael J. Wysocki" , Linux Kernel Mailing List , Lenny Szubowicz , "linux-pm@vger.kernel.org" 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 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: , On 5 August 2014 16:17, Prarit Bhargava wrote: > Nope, not a stupid question. After reproducing (finally!) yesterday I've been > wondering the same thing. Good to know that :) > I've been looking into *exactly* this. On any platform where > cpu_weight(affected_cpus) == 1 for a particular cpu this lockdep trace should > happen. > That's what I'm wondering too. I'm going to instrument the code to find out > this morning. I'm wondering if this comes down to a lockdep class issue > (perhaps lockdep puts globally defined locks like cpufreq_global_kobject in a > different class?). Maybe, I tried this Hack to make this somewhat similar to the other case on my platform with just two CPUs: This should result in something similar to setting that per-policy-governor flag (Actually I could have done that too :)), and I couldn't see that crash :( That needs more investigation now, probably we can get some champ of sysfs stuff like Tejun/Greg into discussion now.. --- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6f02485..6b4abac 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -98,7 +98,7 @@ static DEFINE_MUTEX(cpufreq_governor_mutex); bool have_governor_per_policy(void) { - return !!(cpufreq_driver->flags & CPUFREQ_HAVE_GOVERNOR_PER_POLICY); + return !(cpufreq_driver->flags & CPUFREQ_HAVE_GOVERNOR_PER_POLICY); } EXPORT_SYMBOL_GPL(have_governor_per_policy);