cvs commit: src/sys/dev/acpica acpi.c

John Baldwin jhb at freebsd.org
Thu Apr 26 16:02:41 UTC 2007


On Wednesday 25 April 2007 05:57:13 pm Nate Lawson wrote:
> John Baldwin wrote:
> > On Wednesday 25 April 2007 12:48:50 pm Nate Lawson wrote:
> >> John Baldwin wrote:
> >>> jhb         2007-04-25 16:22:18 UTC
> >>>
> >>>   FreeBSD src repository
> >>>
> >>>   Modified files:
> >>>     sys/dev/acpica       acpi.c 
> >>>   Log:
> >>>   Use a tighter check to see if a resource allocation request is for a
> >>>   specific request and thus should first try to be allocated from the
> >>>   sys_resource pool.  This avoids using the sys_resource pool for 
wildcard
> >>>   requests that have bounded ranges coming from cbb(4) and Host-PCI 
> > pcib(4)
> >>>   drivers.
> >>>   
> >>>   Tested by:      Andrea Bittau <a.bittau of cs.ucl.ac.uk fame>
> >>>   Sleuthing by:   Andrea Bittau as well
> >>>   
> >>>   Revision  Changes    Path
> >>>   1.235     +1 -1      src/sys/dev/acpica/acpi.c
> >>>
> >>>
> >>> Index: src/sys/dev/acpica/acpi.c
> >>> diff -u src/sys/dev/acpica/acpi.c:1.234 src/sys/dev/acpica/acpi.c:1.235
> >>> --- src/sys/dev/acpica/acpi.c:1.234	Thu Mar 22 18:16:40 2007
> >>> +++ src/sys/dev/acpica/acpi.c	Wed Apr 25 16:22:18 2007
> >>> @@ -1034,7 +1034,7 @@
> >>>       * the request from our system resource regions.  If we can't, pass 
> > the
> >>>       * request up to the parent.
> >>>       */
> >>> -    if (!(start == 0UL && end == ~0UL) && rm != NULL)
> >>> +    if (start + count - 1 == end && rm != NULL)
> >>>  	res = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE,
> >>>  	    child);
> >>>      if (res == NULL) {
> >> I think I'll test this to see if it helps my via 8235 ata survive boot.
> > 
> > I wonder if in fact the algorithm shouldn't be changed to always try to 
alloc 
> > the resource from the parent first, and only fall back to the sys_resource 
> > rmans if that fails?  In theory any resource requests that should be done 
via 
> > sys_resource will fail the request in the parent, yes?
> > 
> 
> Yes, that should be ok but why not do local first and then push up tree 
> if it fails?  Semantically, a child of your bus requested the resource 
> so most of the time you should be able to handle it.

Very few resources should really be alloc'd from sysresource though.  No PCI 
device should be alloc'ing from that for example.  It's really only for 
special drivers like IPMI (when it's not enumerated as an ACPI device, but 
only via SMBIOS tables) where a system resource is reserving it because it is 
in use and needs to keep another device (like on PCI where resources aren't 
fixed) from using it.  Thus, really only a specific allocation of a resource 
in sys_resource should ever alloc from that, and all those specific 
allocations will fail up in nexus since sys_resource has already claimed 
those regions.

-- 
John Baldwin


More information about the cvs-src mailing list