From owner-acpi-jp@jp.FreeBSD.org Wed Mar 31 09:36:25 2004
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id i2V0aPf72309;
	Wed, 31 Mar 2004 09:36:25 +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 i2V0aOd72304
	for <acpi-jp@jp.FreeBSD.org>; Wed, 31 Mar 2004 09:36:24 +0900 (JST)
	(envelope-from nate@root.org)
Received: (qmail 83939 invoked by uid 1000); 31 Mar 2004 00:36:20 -0000
From: Nate Lawson <nate@root.org>
To: "M. Warner Losh" <imp@bsdimp.com>
cc: acpi-jp@jp.FreeBSD.org
In-Reply-To: <20040330.161234.88818967.imp@bsdimp.com>
Message-ID: <20040330162525.V83888@root.org>
References: <20040330.134534.82839532.imp@bsdimp.com> <20040330.145814.04787623.imp@bsdimp.com>
 <20040330144040.R83277@root.org> <20040330.161234.88818967.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 16:36:20 -0800
X-Sequence: acpi-jp 3176
Subject: [acpi-jp 3176] 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:
> : 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.
>
> Yes there is a way.  You allocate it.  But you don't activate the
> resource.  That what the pci patches that I post do: it allocates the
> resource and has it owned by the pci bus.  When the driver wants it,
> it transfers ownership to the driver.  Then activation happens
> normally.  On release, the ownership is returned to the bus (that's
> the part that isn't happening at the moment).

It appears your work is simplified since you don't reserve resources up
front and can't sub-divide resources owned by the bus to multiple
children.

I'll take another look at my code and see what I can do about separating
the activation step.

-Nate
