From patchwork Fri Oct 17 11:38:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 38852 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 300D92054E for ; Fri, 17 Oct 2014 11:38:42 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b57sf446253eek.8 for ; Fri, 17 Oct 2014 04:38:41 -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=Tueol1PIXC1dxdzvN6eVDy71minNHBLUa0Ckjz8/4Uo=; b=HIk3eeOtyyePNw34rCuwUUM+H0uAWYNHa0vLW004DtOIZylUbuq0/OW8LExP543LBd I++wKwztFTJj87/RAB28Tn7ia85RudEL9e6cZAqQLIvmUS4Kr6iwImYjtf67KOMBQFlJ 35+/7g4XXyVQHOueoap/2qsHo2KsfliGR5wNsVzJWS7vFZCjTVYEDbq2FA2aDGHwKRL9 vyTLOWzBE2+KecPrgs5pFoFIqjqXAj1czw5MsEcx6ZfYf1dP7A15L6XLylNb0fNsoyTB DyFdZn1PDTb0FzI/JTDDNJgP7zk4RyrsJjLX8hf43o40wVORhyB6kvjOpFkpMjeXZwib MgOQ== X-Gm-Message-State: ALoCoQncH/QcCdG0onyZ/XzdzQaUayHTPFKd9KJ1WMBWduc8fEtIH9KNkjeR3qp0AWbMRNQ3SHfn X-Received: by 10.112.217.102 with SMTP id ox6mr207138lbc.19.1413545920985; Fri, 17 Oct 2014 04:38:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.42 with SMTP id k10ls236670lae.66.gmail; Fri, 17 Oct 2014 04:38:40 -0700 (PDT) X-Received: by 10.112.247.43 with SMTP id yb11mr8153296lbc.51.1413545920690; Fri, 17 Oct 2014 04:38:40 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id pw1si1677851lbb.13.2014.10.17.04.38.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 04:38:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id p9so519083lbv.35 for ; Fri, 17 Oct 2014 04:38:40 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr3587994lap.44.1413545920562; Fri, 17 Oct 2014 04:38:40 -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.112.84.229 with SMTP id c5csp208752lbz; Fri, 17 Oct 2014 04:38:39 -0700 (PDT) X-Received: by 10.70.62.74 with SMTP id w10mr7874347pdr.140.1413545918251; Fri, 17 Oct 2014 04:38:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gm1si1030759pbd.6.2014.10.17.04.38.37 for ; Fri, 17 Oct 2014 04:38:38 -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 S1751961AbaJQLic (ORCPT + 27 others); Fri, 17 Oct 2014 07:38:32 -0400 Received: from mail-ob0-f171.google.com ([209.85.214.171]:47207 "EHLO mail-ob0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbaJQLia (ORCPT ); Fri, 17 Oct 2014 07:38:30 -0400 Received: by mail-ob0-f171.google.com with SMTP id va2so448056obc.30 for ; Fri, 17 Oct 2014 04:38:30 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.131.239 with SMTP id op15mr6530891oeb.22.1413545909909; Fri, 17 Oct 2014 04:38:29 -0700 (PDT) Received: by 10.182.233.170 with HTTP; Fri, 17 Oct 2014 04:38:29 -0700 (PDT) In-Reply-To: <543BCF9A.1060603@redhat.com> References: <543BCF9A.1060603@redhat.com> Date: Fri, 17 Oct 2014 17:08:29 +0530 Message-ID: Subject: Re: Locking issues with cpufreq and sysfs From: Viresh Kumar To: Prarit Bhargava Cc: Saravana Kannan , "Rafael J. Wysocki" , "linux-pm@vger.kernel.org" , Linux Kernel , =?UTF-8?Q?Robert_Sch=C3=B6ne?= , Stephen Boyd 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.217.176 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 13 October 2014 18:41, Prarit Bhargava wrote: > There are several issues with the current locking design of cpufreq. Most > notably is the panic reported here: > > http://marc.info/?l=linux-kernel&m=140622451625236&w=2 > > which was introduced by commit 955ef4833574636819cd269cfbae12f79cbde63a, > cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT, which introduces Don't know whats going wrong but I am just not able to reproduce the lockdep again :( I have tried this on two boards and am making sure that all things are correctly configured. I am trying this on two of Exynos boards, One a dual-A15 and another big little with 8 cores.. @@ -2195,9 +2195,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 */ @@ -2206,9 +2204,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); } .config attached too, please let me know what am I missing. diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 1b44496..1a6972a 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -323,6 +323,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, return 0; case CPUFREQ_GOV_POLICY_EXIT: if (!--dbs_data->usage_count) { + pr_info("%s\n", __func__); sysfs_remove_group(get_governor_parent_kobj(policy), get_sysfs_attr(dbs_data));