From owner-acpi-jp@jp.FreeBSD.org Wed Mar 31 07:49:45 2004
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id i2UMnjW55874;
	Wed, 31 Mar 2004 07:49:45 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from root.org (root.org [67.118.192.226])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with SMTP/inet id i2UMnjd55869
	for <acpi-jp@jp.FreeBSD.org>; Wed, 31 Mar 2004 07:49:45 +0900 (JST)
	(envelope-from nate@root.org)
Received: (qmail 83375 invoked by uid 1000); 30 Mar 2004 22:49:40 -0000
From: Nate Lawson <nate@root.org>
To: "M. Warner Losh" <imp@bsdimp.com>
cc: acpi-jp@jp.FreeBSD.org
In-Reply-To: <20040330.145814.04787623.imp@bsdimp.com>
Message-ID: <20040330144040.R83277@root.org>
References: <20040330.133504.94843223.imp@bsdimp.com> <20040330124038.L82530@root.org>
 <20040330.134534.82839532.imp@bsdimp.com> <20040330.145814.04787623.imp@bsdimp.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Tue, 30 Mar 2004 14:49:40 -0800
X-Sequence: acpi-jp 3172
Subject: [acpi-jp 3172] Re: hot after resume
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: nate@root.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+040307

On Tue, 30 Mar 2004, M. Warner Losh wrote:
> In message: <20040330.134534.82839532.imp@bsdimp.com>
>             "M. Warner Losh" <imp@bsdimp.com> writes:
> : Both!  They are so interrelated that I have trouble teasing them
> : apart.  Let people in current suffer :-)  Clearly people aren't
> : testing my patches.
> :
> : Actually, that's not entirely true.  There's an easy way to disable
> : some of the power stuff, and I'll likely do that as a first shot.
>
> BTW, you can find my patches here:
>
> http://people.freebsd.org/~imp/power-20040330.diff.gz
>
> They have the following problems:

0a) diff not in format patch can understand
0b) s/EvaluateInteger/GetInteger

> 1) Need to handle the !acpi host bridge case of resource allocation.

If you can give me some guidance on the changes I need to make for acpi
rman, you can just copy the approach I took.  There are sticky problems
that show up in implementing it that indicate no one has worked on actual
child rman pools that map a subset of the space (not 0-inf as nexus does).
For instance, acpi gets a resource from nexus with BUS_ALLOC_RESOURCE and
adds it to the local rman (rman_manage_region), but it then needs to be
partially released before doing the rman_reserve_resource, otherwise it's
allocated to both acpi and the child and you get a panic.  There's no
current way to tell nexus that acpi owns a region but it's not currently
allocated as a resource.  We probably need a BUS_MANAGE_REGION to pull a
region out of the parent without allocating a resource for it.  Or there
needs to be a way to take a resource received via BUS_ALLOC_RESOURCE and
free the resource data while leaving the region reserved on the parent.

> 2) unloading a driver that has resources reserved causes them to be
>    really freed, not merely returned to the reserved pool.  This can
>    cause problems.

They should just be released.  Why is that harder than freeing them?

-Nate
