From owner-freebsd-arch@FreeBSD.ORG Wed May 15 10:56:05 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E4669AA for ; Wed, 15 May 2013 10:56:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4621C6 for ; Wed, 15 May 2013 10:56:05 +0000 (UTC) Received: from John-Baldwins-MacBook-Air.local (unknown [24.114.252.241]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 72FB4B926; Wed, 15 May 2013 06:56:04 -0400 (EDT) Message-ID: <519369C4.6060402@FreeBSD.org> Date: Wed, 15 May 2013 06:56:04 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Justin Hibbits Subject: Re: late suspend/early resume References: <51913B7D.1040801@freebsd.org> <288C9B9E-E943-4C5B-BCFB-15B721CBE94C@bsdimp.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 15 May 2013 06:56:04 -0400 (EDT) Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2013 10:56:05 -0000 On 5/14/13 1:14 PM, Justin Hibbits wrote: > You are right that the late suspend could lead to silly proliferation, and > an ordered list is much better, but another API would need to be added to > do that as well. > > My north bridge is first in the top list of the tree, right under the > nexus, so to suspend it last I wrote the nexus suspend to traverse its > children in reverse. The problem comes that the clock controller is under a > later PCI bus, not even the immediate following one, and the north bridge > children are i2c devices, so suspending them after their clock head away is > problematic. We can discuss this more at bsdcan, where it may be easier to > describe. But essentially I need the north bridge and that pesky clock > controller to be the last to suspend and the first to resume. I guess we > can take this as the starting discussion for modeling this relationship on > all platforms, since you mention it is common in embedded platforms. I think you can do this by having a notion of passes with drivers having a suspend pass level and doing passes over the tree suspending devices at each pass level and then walking the passes back up in reverse during resume. You could borrow from the multipass stuff used on probe/attach for this. -- John Baldwin