Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757990AbYAEVLt (ORCPT ); Sat, 5 Jan 2008 16:11:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757231AbYAEVLl (ORCPT ); Sat, 5 Jan 2008 16:11:41 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:57811 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756954AbYAEVLk (ORCPT ); Sat, 5 Jan 2008 16:11:40 -0500 From: "Rafael J. Wysocki" To: Alan Stern Subject: Re: [PATCH] PM: Acquire device locks on suspend Date: Sat, 5 Jan 2008 22:13:38 +0100 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) Cc: Greg KH , Andrew Morton , Len Brown , Ingo Molnar , ACPI Devel Maling List , LKML , pm list References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801052213.39891.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1243 Lines: 31 On Saturday, 5 of January 2008, Alan Stern wrote: > On Sat, 5 Jan 2008, Rafael J. Wysocki wrote: > > > > Another thing to watch out for: Just in case somebody ends up calling > > > destroy_suspended_device(dev) from within dev's own resume method, you > > > should interchange the resume_device() and the list_move_tail() > > > calls in dpm_resume(). > > > > However, if we unregister them all at once after releasing pm_sleep_rwsem, > > that shouldn't be necessary, right? > > It's still necessary, because destroy_suspended_device() still has to > move the device from one list to another. You don't want it to end up > on the dpm_locked list. Hmm. That means we'd have to do the same thing in dpm_power_up() in case someone calls destroy_suspended_device() from resume_device_early(dev). Still, even doing that is not enough, since someone can call destroy_suspended_device() from a .suspend() routine and then the device will end up on a wrong list just as well. Greetings, Rafael -- 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/