From nobody@FreeBSD.org  Sat May 30 08:11:24 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBB96106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 May 2009 08:11:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 8F80E8FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 May 2009 08:11:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n4U8BNee028279
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 May 2009 08:11:24 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n4U8BNK8028278;
	Sat, 30 May 2009 08:11:23 GMT
	(envelope-from nobody)
Message-Id: <200905300811.n4U8BNK8028278@www.freebsd.org>
Date: Sat, 30 May 2009 08:11:23 GMT
From: Mario Pavlov <freebsd@abv.bg>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [acpi] BIOS resource allocation and FreeBSD ACPI
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         135070
>Category:       kern
>Synopsis:       [acpi] [patch] BIOS resource allocation and FreeBSD ACPI
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 30 08:20:01 UTC 2009
>Closed-Date:    Thu Jul 07 18:57:04 UTC 2011
>Last-Modified:  Thu Jul 07 18:57:04 UTC 2011
>Originator:     Mario Pavlov
>Release:        7-STABLE, 8-CURRENT
>Organization:
>Environment:
FreeBSD  8.0-CURRENT-200905 FreeBSD 8.0-CURRENT-200905 #0: Tue May 19 19:47:24 EEST 2009     root@:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The problem is on many laptops (mostly Acer). If I understand it correctly it's because some BIOSes clear the resources for various hardware when ACPI is enabled. And apparently FreeBSD relies on the BIOS to allocated resources for hardware. Probably FreeBSD would have to be able to allocate resources on its own.
This is a piece of verbose output on my Acer Aspire 5920:

==================================================================================
bge0: <Broadcom NetLink Gigabit Ethernet Controller, ASIC rev. 0xb002> irq 17 at device 0.0 on pci8
pcib3: bge0 requested unsupported memory range 0-0xffffffffffffffff (decoding 0-0, 0-0)
bge0: 0x10000 bytes of rid 0x10 res 3 failed (0, 0xffffffffffffffff).
bge0: couldn't map memory
device_attach: bge0 attach returned 6
==================================================================================

more verbose and complete output can be found here: http://lists.freebsd.org/pipermail/freebsd-mobile/2008-May/010727.html

the same happens with Acer Aspire 3680:

==================================================================================
ath0: <Atheros 5424/2424> irq 17 at device 0.0 on pci3
ath0: 0x10000 bytes of rid 0x10 res 3 failed (0, 0xffffffff).
ath0: cannot map register space
device_attach: ath0 attach returned 6
==================================================================================

complete dmesg output for this laptop can be found here: http://forums.freebsd.org/showthread.php?t=206
as well as more information about the problem

exactly the same problem has been reported with Acer Aspire 6292
I'm positive that other laptops have the same problem.

these are different laptops with different hardware but have the same problem
that's why I think it's the BIOS resource allocation and ACPI
I have updated my laptop's BIOS to the latest version from Acer but this didn't fix the problem...
I tried several operating systems:
FreeBSD - doesn't work
NetBSD - doesn't work
OpenSolaris - works
Linux - works
Windows - works

it would be absolutely fantastic if someone could take a look at this issue!
I'm always available for testing and providing more information
>How-To-Repeat:
the problem can be easily reproduced if you have Acer Aspire 5920, 3680, 6292 or other Acer laptop, possibly laptops from other vendors have this problem...
the problem can be seen when you just boot FreeBSD, it boots fine but you can see the allocation problem in the output
>Fix:
there is a very dirty hack by a guy who has one of the problematic laptops
the patch can be found here: http://lists.freebsd.org/pipermail/freebsd-acpi/2008-May/004905.html

>Release-Note:
>Audit-Trail:

From: Mario Pavlov <freebsd@abv.bg>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/135070 [acpi] BIOS resource allocation and FreeBSD ACPI
Date: Sat, 30 May 2009 11:35:55 +0300 (EEST)

 I forgot to mention, I tested this with i386 and amd64 and the behaviour is identical.
Responsible-Changed-From-To: freebsd-bugs->freebsd-acpi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat May 30 10:37:36 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135070 

From: John Baldwin <jhb@FreeBSD.org>
To: bug-followup@freebsd.org,
 freebsd@abv.bg
Cc:  
Subject: Re: kern/135070: [acpi] [patch] BIOS resource allocation and FreeBSD ACPI
Date: Mon, 1 Jun 2009 08:07:53 -0400

 Note that the patch is a hack for a very-specific laptop, it is not a general 
 solution.  I hope to be able to provide a framework in 8.0 to help address 
 the resource issue and then implement the proper solution in 9.0 (and 
 hopefully backport it to 8.x.).
 
 -- 
 John Baldwin

From: Mario Pavlov <freebsd@abv.bg>
To: bug-followup@FreeBSD.org
Cc: John Baldwin <jhb@FreeBSD.org>
Subject: Re: kern/135070: [acpi] [patch] BIOS resource allocation and
 FreeBSD ACPI
Date: Tue, 2 Jun 2009 07:42:24 +0300 (EEST)

 Yes, indeed
 that's why I stated in the Fix section that this is a very dirty hack but someone put a [patch] tag in the Synopsis
 Is this framework you mentioned planned or is work on it going on already ?

From: Mario Pavlov <freebsd@abv.bg>
To: bug-followup@FreeBSD.org
Cc: freebsd-acpi@freebsd.org, John Baldwin <jhb@freebsd.org>
Subject: Re: kern/135070: [acpi] [patch] BIOS resource allocation and
 FreeBSD ACPI
Date: Tue, 2 Jun 2009 22:25:41 +0300 (EEST)

 wow great work!
 if I understand correctly this falls into the "PCI-PCI Bridge Problem" right ?
 please let me know if you think I can help with something!

From: metazyst analyst <metazyst@gmail.com>
To: bug-followup@FreeBSD.org, freebsd@abv.bg
Cc:  
Subject: Re: kern/135070: [acpi] [patch] BIOS resource allocation and FreeBSD 
	ACPI
Date: Fri, 9 Jul 2010 16:01:25 +0200

 --0016e659f8e6b6e35d048af4d6e3
 Content-Type: text/plain; charset=ISO-8859-1
 
 Same problem on Toshiba P300 :/
 
 --0016e659f8e6b6e35d048af4d6e3
 Content-Type: text/html; charset=ISO-8859-1
 
 Same problem on Toshiba P300 :/<br>
 
 --0016e659f8e6b6e35d048af4d6e3--

From: John Baldwin <jhb@FreeBSD.org>
To: bug-followup@FreeBSD.org, freebsd@abv.bg
Cc:  
Subject: Re: kern/135070: [acpi] [patch] BIOS resource allocation and FreeBSD
 ACPI
Date: Tue, 03 May 2011 14:28:56 -0400

 Missed this PR.  I have committed a rework of the PCI-PCI bridge driver 
 that should resolve this issue to HEAD today in change 221393.
 
 -- 
 John Baldwin
State-Changed-From-To: open->patched 
State-Changed-By: jhb 
State-Changed-When: Tue May 3 18:35:13 UTC 2011 
State-Changed-Why:  
Probable fix committed to HEAD. 


Responsible-Changed-From-To: freebsd-acpi->jhb 
Responsible-Changed-By: jhb 
Responsible-Changed-When: Tue May 3 18:35:13 UTC 2011 
Responsible-Changed-Why:  
Probable fix committed to HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135070 

From: Mario Pavlov <freebsd@abv.bg>
To: John Baldwin <jhb@FreeBSD.org>
Cc: bug-followup@FreeBSD.org, freebsd@abv.bg
Subject: Re: Re: kern/135070: [acpi] [patch] BIOS resource allocation and FreeBSD ACPI
Date: Wed, 4 May 2011 07:57:23 +0300 (EEST)

 Thank you!However  I cannot verify the fix. I don't have this laptop any more, I sold it.
 
 
 
 
  >-------- Оригинално писмо --------
  >От: John Baldwin jhb@FreeBSD.org
  >Относно: Re: kern/135070: [acpi] [patch] BIOS resource allocation and FreeBSD
  ACPI
  >До: bug-followup@FreeBSD.org, freebsd@abv.bg
  >Изпратено на: Вторник, 2011, Май 3 21:28:56 EEST
 
  > Missed this PR.  I have committed a rework of the PCI-PCI bridge driver 
  > that should resolve this issue to HEAD today in change 221393.
  > 
  > -- 
  > John Baldwin
State-Changed-From-To: patched->closed 
State-Changed-By: jhb 
State-Changed-When: Thu Jul 7 18:56:35 UTC 2011 
State-Changed-Why:  
Fix merged to 8, but note that a custom kernel has to be compiled with 
options NEW_PCIB to enable it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135070 
>Unformatted:
