Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755698AbZFVOQp (ORCPT ); Mon, 22 Jun 2009 10:16:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751994AbZFVOQi (ORCPT ); Mon, 22 Jun 2009 10:16:38 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:37307 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750731AbZFVOQh (ORCPT ); Mon, 22 Jun 2009 10:16:37 -0400 Date: Mon, 22 Jun 2009 10:16:40 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Rafael J. Wysocki" cc: Magnus Damm , Greg KH , LKML , ACPI Devel Maling List , Linux-pm mailing list , Ingo Molnar Subject: Re: [linux-pm] [patch update 2 fix] PM: Introduce core framework for run-time PM of I/O devices In-Reply-To: <200906211332.46249.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: 1309 Lines: 30 On Sun, 21 Jun 2009, Rafael J. Wysocki wrote: > > Seriously, there _are_ places where drivers get bound to device before > > those devices are registered. This happens for example in USB when a > > bunch of related interfaces are present in the same physical device. > > When the first interface is registered, its driver binds itself to all > > the others even though they haven't been registered yet. > > Well, the suspend functions could be protected against that under the > assumption that no suspend is possible for resume_counter = 0 (then, the "good > to go" value would be -1). > > Still, the resume functions start from acquring a spinlock, which is not going > to work if that spinlock is uninitialized. The initialization needs to be improved. Most of the code in pm_runtime_init() should be called from device_pm_init(), and the rest should be moved into a separate pm_runtime_add() routine to be called from device_pm_add(). One of the things pm_runtime_add() could do is change the status from RPM_UNREGISTERED to RPM_ACTIVE. 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/