From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751878AbcAMGHv (ORCPT ); Wed, 13 Jan 2016 01:07:51 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35645 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867AbcAMGHu (ORCPT ); Wed, 13 Jan 2016 01:07:50 -0500 Date: Wed, 13 Jan 2016 11:37:46 +0530 From: Viresh Kumar To: Juri Lelli Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, peterz@infradead.org, rjw@rjwysocki.net, mturquette@baylibre.com, steve.muckle@linaro.org, vincent.guittot@linaro.org, morten.rasmussen@arm.com, dietmar.eggemann@arm.com Subject: Re: [RFC PATCH 08/19] cpufreq: fix warning for cpufreq_init_policy unlocked access to cpufreq_governor_list Message-ID: <20160113060746.GI6050@ubuntu> References: <1452533760-13787-1-git-send-email-juri.lelli@arm.com> <1452533760-13787-9-git-send-email-juri.lelli@arm.com> <20160112100945.GZ1084@ubuntu> <20160112155200.GC18734@e106622-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160112155200.GC18734@e106622-lin> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12-01-16, 15:52, Juri Lelli wrote: > Other users (i.e., cpufreq_parse_governor and cpufreq_register_governor) > needs to take the mutex externally. So, we need to unify this behaviour. No they don't have to. And that's why I have been saying that we better nail down the exact thing the mutex is supposed to protect. There can be two cases here: - It protects the governor list, in that case we can move it to find_governor(). - It guarantees that the governor pointer stays valid: That's not true as we are using the governor pointer outside of the lock. And so I said, "No they don't have to" :) -- viresh