From patchwork Thu Aug 7 06:36:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 35015 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4EDBE20523 for ; Thu, 7 Aug 2014 06:36:51 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kx10sf23471437pab.4 for ; Wed, 06 Aug 2014 23:36:50 -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=jZBYoeXdRNc5WppfS9FjlGPojy5NYvWEnIAd7NbU56I=; b=fnIQ2NwuOdHnJKnJEG7pzPlf6Ep2KHXs1RjGv0aElP92d3XszEoG/QtSwygC4L/oVj z6Wo+sUnC5kgjiWUCqdfKEbYPz77X6WalPD5JfGCKMrLAqcJ14AR5hbUyBn6ho1wYWiR sR4INWH+sSfmh2v3BjNy07585DJJlIwkRAojcxTIpT3DmK7UR0r4yAkNs8GfcToFmG7c ZoJQqsDSgeKfaMYdGsExTkPUvheodGH9NYsv7jYD5QloJVaMhVYbrllTxkyBTXUlVI68 iGTiAw8ajVB+t5r5qVlJfSKNl+QzEQSvL8ExUON9smFewZzYGOlv3y9DyWwCOoRE/vDH DgKQ== X-Gm-Message-State: ALoCoQmTESheDc/8gVSbN6PA1ExI9Z+em4H6HkD3bSzQsexd6IqUGaqRbZHOk9Dt9AAoSlunz4iF X-Received: by 10.66.66.196 with SMTP id h4mr8294008pat.22.1407393410631; Wed, 06 Aug 2014 23:36:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.12 with SMTP id 12ls66761qga.25.gmail; Wed, 06 Aug 2014 23:36:50 -0700 (PDT) X-Received: by 10.221.21.201 with SMTP id qt9mr14614927vcb.39.1407393410496; Wed, 06 Aug 2014 23:36:50 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id fg6si1435248vcb.46.2014.08.06.23.36.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Aug 2014 23:36:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so5590652vcb.2 for ; Wed, 06 Aug 2014 23:36:50 -0700 (PDT) X-Received: by 10.220.114.5 with SMTP id c5mr14793128vcq.28.1407393406702; Wed, 06 Aug 2014 23:36:46 -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 tc5csp4720vcb; Wed, 6 Aug 2014 23:36:44 -0700 (PDT) X-Received: by 10.70.38.134 with SMTP id g6mr15840782pdk.135.1407393402941; Wed, 06 Aug 2014 23:36:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qz9si2679266pab.152.2014.08.06.23.36.41 for ; Wed, 06 Aug 2014 23:36:42 -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 S1757233AbaHGGgk (ORCPT + 26 others); Thu, 7 Aug 2014 02:36:40 -0400 Received: from mail-oa0-f45.google.com ([209.85.219.45]:40549 "EHLO mail-oa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbaHGGgi (ORCPT ); Thu, 7 Aug 2014 02:36:38 -0400 Received: by mail-oa0-f45.google.com with SMTP id i7so2664615oag.4 for ; Wed, 06 Aug 2014 23:36:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.20.177 with SMTP id o17mr20956601obe.59.1407393398041; Wed, 06 Aug 2014 23:36:38 -0700 (PDT) Received: by 10.182.233.166 with HTTP; Wed, 6 Aug 2014 23:36:37 -0700 (PDT) In-Reply-To: <20140806150831.GB32301@codeaurora.org> References: <53DB6B81.6050400@redhat.com> <53DBCBE8.6010809@codeaurora.org> <53DBE764.8050109@redhat.com> <53DBEC27.7050803@codeaurora.org> <53E0B657.4070007@redhat.com> <53E1556B.5070304@codeaurora.org> <53E1FEE5.80305@redhat.com> <20140806150831.GB32301@codeaurora.org> Date: Thu, 7 Aug 2014 12:06:37 +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: Stephen Boyd Cc: Prarit Bhargava , 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.171 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 6 August 2014 20:38, Stephen Boyd wrote: > On 08/06, Prarit Bhargava wrote: > > Are you sure you're not seeing another lockdep warning? That was my problem -- > > there was an xfs related lockdep warning which then resulted in lockdep being > > disabled from that point on. There is a fair chance that I might be doing something really really stupid, but I couldn't get the lockdep warning.. > Are we talking about the lockdep splat or the crash that started > this thread or something else? For the lockdep splat you need the > corrected patch in this thread and the per policy governor flag. > I'm not sure how to recreate the crash that started this thread. We are talking about the lockdep splat that would happen if we don't drop locking around EXIT.. This is my full diff over mainline and my .config is attached. Please enlighten me on what am I missing :) .target_index = exynos_target, .get = cpufreq_generic_get, diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6f02485..fa11a7d 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2200,9 +2200,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, /* end old governor */ if (old_gov) { __cpufreq_governor(policy, CPUFREQ_GOV_STOP); - up_write(&policy->rwsem); __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); - down_write(&policy->rwsem); } /* start new governor */ @@ -2211,9 +2209,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, if (!__cpufreq_governor(policy, CPUFREQ_GOV_START)) goto out; - up_write(&policy->rwsem); __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); - down_write(&policy->rwsem); } /* new governor failed, so re-start old one */ diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 1e0ec57..027b6f7 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -139,7 +139,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) } static struct cpufreq_driver exynos_driver = { - .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK, + .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_HAVE_GOVERNOR_PER_POLICY, .verify = cpufreq_generic_frequency_table_verify,