Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756269Ab2HGWJi (ORCPT ); Tue, 7 Aug 2012 18:09:38 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:47104 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752994Ab2HGWJh (ORCPT ); Tue, 7 Aug 2012 18:09:37 -0400 From: "Rafael J. Wysocki" To: Colin Cross Subject: Re: [PATCH] cpuidle: coupled: fix sleeping while atomic in cpu notifier Date: Wed, 8 Aug 2012 00:15:31 +0200 User-Agent: KMail/1.13.6 (Linux/3.5.0+; KDE/4.6.0; x86_64; ; ) Cc: Len Brown , Len Brown , Kevin Hilman , Santosh Shilimkar , linux-kernel@vger.kernel.org References: <1343251216-24106-1-git-send-email-ccross@android.com> In-Reply-To: <1343251216-24106-1-git-send-email-ccross@android.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Message-Id: <201208080015.31359.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1379 Lines: 47 On Wednesday, July 25, 2012, Colin Cross wrote: > The cpu hotplug notifier gets called in both atomic and non-atomic > contexts, it is not always safe to lock a mutex. Filter out all events > except the six necessary ones, which are all sleepable, before taking > the mutex. > > Signed-off-by: Colin Cross Has this been applied already? Rafael > --- > drivers/cpuidle/coupled.c | 12 ++++++++++++ > 1 files changed, 12 insertions(+), 0 deletions(-) > > diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c > index 2c9bf26..c24dda0 100644 > --- a/drivers/cpuidle/coupled.c > +++ b/drivers/cpuidle/coupled.c > @@ -678,6 +678,18 @@ static int cpuidle_coupled_cpu_notify(struct notifier_block *nb, > int cpu = (unsigned long)hcpu; > struct cpuidle_device *dev; > > + switch (action & ~CPU_TASKS_FROZEN) { > + case CPU_UP_PREPARE: > + case CPU_DOWN_PREPARE: > + case CPU_ONLINE: > + case CPU_DEAD: > + case CPU_UP_CANCELED: > + case CPU_DOWN_FAILED: > + break; > + default: > + return NOTIFY_OK; > + } > + > mutex_lock(&cpuidle_lock); > > dev = per_cpu(cpuidle_devices, cpu); > -- 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/