From owner-freebsd-arch@FreeBSD.ORG Mon May 13 19:19:44 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 247E3FA9 for ; Mon, 13 May 2013 19:19:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com [IPv6:2607:f8b0:4003:c01::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 55652346 for ; Mon, 13 May 2013 19:19:43 +0000 (UTC) Received: by mail-ob0-f173.google.com with SMTP id eh20so1354089obb.4 for ; Mon, 13 May 2013 12:19:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=Iw9SeY9+4UxhsSh4q2Z8nZlgvDR63bUUi6YoIxzlJiM=; b=cmnYEHYbgfKGW2bXiSKhuF3cWt6B4q9iwLsiDfif9ryNdhkWHKEjVEEl0ePrfvscl1 Wcw/lTf6zylxls0/jRsglzP/1Vq0VGlRDSaWphZkRMNWU08Xnb877/9Q83kVnzL52NUk apFymrEFuq3AK4BGeeMozAU41H7oHEDjFzD/ZXQ0YI7+6KyVDkNzet0uHS4nOyYwwBPS dx41IMfjT+ty3OJerNgN2D/zs/Zk40vA9X1mMJIDKIZJ1gBebBGDW0bM+evYHG0RsJvK M4q4aw41NrY5bJ3WZ3j6dlUpfEWT3hXL+ujeEUBCX8unlc7O8agvf7xYzoBEi9nrsHPi hShg== X-Received: by 10.60.118.68 with SMTP id kk4mr6233653oeb.67.1368472782856; Mon, 13 May 2013 12:19:42 -0700 (PDT) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id qj8sm18108354oeb.2.2013.05.13.12.19.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 May 2013 12:19:41 -0700 (PDT) Sender: Warner Losh Subject: Re: late suspend/early resume Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <51913B7D.1040801@freebsd.org> Date: Mon, 13 May 2013 13:19:39 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <288C9B9E-E943-4C5B-BCFB-15B721CBE94C@bsdimp.com> References: <51913B7D.1040801@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQnmcqIBLLiCGoOzSLjIUxILSItrM3y8nNM+fJBZhCfCtp4+MnLyjDo+QirsG5NaUv52S735 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: Mon, 13 May 2013 19:19:44 -0000 On May 13, 2013, at 1:14 PM, Julian Elischer wrote: > On 5/13/13 6:53 AM, Warner Losh wrote: >> Where is the northbridge in the object tree hierarchy? >>=20 >> Since you are asking this, I'm guessing it isn't at the top of the = tree, and can't easily be. >>=20 >> I don't like this idea. I think it is is silly and will lead only to = additional proliferation of late late late early late calls. >>=20 >> Much better would be for the suspend routine to return a number = indicating how late to be called (and correspondingly how early resume = should be called). this way the tree walking code can insert these = devices into an ordered list that can then be walked at the end of = suspend and traversed backwards at the start of resume. >>=20 >> There are many embedded systems where there's a bit of a partial = ordering between clock generation blocks and power blocks that need to = be handled specially since there's no ACPI on those platforms to do = things last. We don't model them well at all (or even at all), and = having some mechanism in place to help with that would be useful. >>=20 >> So in short I understand the need, but feel that the kobj extensions = you propose are little better than the hard-coded calls and would like = to see something a little more generic since the in-order traversal of = the device tree seems a poor fit to 'special cases' like this. >=20 > would not some dependency graph be more 'correct'? not sure how one = would express it. Maybe by default it would go with the device hierarchy = but with the ability to add extra dependencies. A numeric value would completely encapsulate the graph and avoid loops = in said graph. Expressing the dependency graph would likely be a heavier = lift as well... Warner >> Warner >>=20 >>=20 >> On May 13, 2013, at 1:20 AM, Justin Hibbits wrote: >>=20 >>> I'd like to solicit opinions on adding new kobj device API calls, >>> device_late_suspend and device_early_resume. >>>=20 >>> I've been working on PowerPC suspend/resume, and certain devices = must be >>> suspended last and resumed first on Apple hardware, namely the = chipsets. >>> It happens that one device (uninorth) appears first in the devinfo = chain, >>> while the other (mac-io) appears off a later PCI bus. So, rather = than >>> special casing this to suspend the mac-io and its children, as well = as the >>> uninorth, last with specific calls, I'd like to add a = device_suspend_late >>> and device_resume_early, that would simply be identical to >>> device_suspend/device_resume, but could be called after and before, >>> respectively, to do last minute order suspend and first pass >>> initialization, to initialize things like clocks required for other = devices. >>>=20 >>> It's not difficult to explicitly call suspend and resume functions = on the >>> chipsets, but I think it's cleaner to do it through the newbus/kobj >>> interface, and it might be useful for other architectures as well. >>>=20 >>> Thoughts? >>>=20 >>> - Justin >>> _______________________________________________ >>> freebsd-arch@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-arch >>> To unsubscribe, send any mail to = "freebsd-arch-unsubscribe@freebsd.org" >> _______________________________________________ >> freebsd-arch@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-arch >> To unsubscribe, send any mail to = "freebsd-arch-unsubscribe@freebsd.org" >>=20 >=20 > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to = "freebsd-arch-unsubscribe@freebsd.org"