From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031344AbbKDWL3 (ORCPT ); Wed, 4 Nov 2015 17:11:29 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:40199 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031067AbbKDWL1 (ORCPT ); Wed, 4 Nov 2015 17:11:27 -0500 Date: Wed, 4 Nov 2015 14:11:25 -0800 From: Stephen Boyd To: Viresh Kumar Cc: Rafael Wysocki , mturquette@baylibre.com, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Bartlomiej Zolnierkiewicz , Dan Carpenter , Dmitry Torokhov , Greg Kroah-Hartman , Len Brown , open list , Nishanth Menon , Pavel Machek Subject: Re: [PATCH] PM / OPP: Protect updates to list_dev with mutex Message-ID: <20151104221125.GU19782@codeaurora.org> References: <5f8fac4ad84716ef68fc50ab0b78e11ad2837524.1446205160.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5f8fac4ad84716ef68fc50ab0b78e11ad2837524.1446205160.git.viresh.kumar@linaro.org> 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 10/30, Viresh Kumar wrote: > dev_opp_list_lock is used everywhere to protect device and OPP lists, > but dev_pm_opp_set_sharing_cpus() is missed somehow. And instead we used > rcu-lock, which wouldn't help here as we are adding a new list_dev. > > This also fixes a problem where we have called kzalloc(..., GFP_KERNEL) > from within rcu-lock, which isn't allowed as kzalloc can sleep when > called with GFP_KERNEL. > > With CONFIG_DEBUG_ATOMIC_SLEEP set, we will see the caller vomiting. > > Fixes: 8d4d4e98acd6 ("PM / OPP: Add helpers for initializing CPU OPPs") > Reported-by: Michael Turquette > Signed-off-by: Viresh Kumar > --- Reviewed-by: Stephen Boyd I assume some other patch will come to fix the comment and/or add the lockdep check. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project