Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759015AbYAFRGv (ORCPT ); Sun, 6 Jan 2008 12:06:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755759AbYAFRGn (ORCPT ); Sun, 6 Jan 2008 12:06:43 -0500 Received: from netrider.rowland.org ([192.131.102.5]:1154 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754577AbYAFRGm (ORCPT ); Sun, 6 Jan 2008 12:06:42 -0500 Date: Sun, 6 Jan 2008 12:06:38 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: "Rafael J. Wysocki" cc: Greg KH , Andrew Morton , Len Brown , Ingo Molnar , ACPI Devel Maling List , LKML , pm list Subject: Re: [PATCH] PM: Acquire device locks on suspend In-Reply-To: <200801061419.52277.rjw@sisk.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1107 Lines: 38 On Sun, 6 Jan 2008, Rafael J. Wysocki wrote: > > If you can figure out a way to disable the warning in device_del() for > > just the one device being unregistered by > > device_pm_destroy_suspended(), > > Something like this, perhaps: > > @@ -905,6 +915,18 @@ void device_del(struct device * dev) > struct device * parent = dev->parent; > struct class_interface *class_intf; > > + if (down_trylock(&dev->sem)) { > + if (pm_sleep_lock()) { > + dev_warn(dev, "Illegal %s during suspend\n", > + __FUNCTION__); > + dump_stack(); > + } else { > + pm_sleep_unlock(); > + } > + } else { > + up(&dev->sem); > + } > + > if (parent) > klist_del(&dev->knode_parent); > if (MAJOR(dev->devt)) Bizarre, but it should work. Be sure to include plenty of explanatory comments -- otherwise nobody will be able to figure it out! :-) Alan Stern -- 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/