From owner-acpi-jp@jp.FreeBSD.org Wed Oct 30 04:48:17 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g9TJmHH38724;
	Wed, 30 Oct 2002 04:48:17 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g9TJmF338706
	for <acpi-jp@jp.FreeBSD.org>; Wed, 30 Oct 2002 04:48:15 +0900 (JST)
	(envelope-from jhb@FreeBSD.org)
Received: (qmail 11831 invoked from network); 29 Oct 2002 19:48:18 -0000
Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63])
          (envelope-sender <jhb@FreeBSD.org>)
          by mail14.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP
          for <acpi-jp@jp.FreeBSD.org>; 29 Oct 2002 19:48:18 -0000
Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1])
	by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id g9TJmBn5092377;
	Tue, 29 Oct 2002 14:48:11 -0500 (EST)
	(envelope-from jhb@FreeBSD.org)
Message-ID: <XFMail.20021029144810.jhb@FreeBSD.org>
X-Mailer: XFMail 1.5.2 on FreeBSD
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
In-Reply-To: <20021018.094406.52157886.iwasaki@jp.FreeBSD.org>
From: John Baldwin <jhb@freebsd.org>
To: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>
Cc: acpi-jp@jp.FreeBSD.org
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Tue, 29 Oct 2002 14:48:10 -0500
X-Sequence: acpi-jp 1919
Subject: [acpi-jp 1919] Re: multiple host-PCI bridges
Errors-To: owner-acpi-jp@jp.FreeBSD.org
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: jhb@FreeBSD.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+021028


On 17-Oct-2002 Mitsuru IWASAKI wrote:
># Forward a unsent message from Andy which was rejected by our ML
># system (somewhat wrong mail header)

Ah, I seemed to have missed this the first time.

> ---- unsent message header follows ----
> 
>> From: John Baldwin [mailto:jhb@freebsd.org] 
>> Ok, this is somewhat targeted at the Intel guys at least the
>> first part.  It seems that most systems with multiple host-PCI
>> bridges in them have decided to set the _BBN to zero for all
>> host-PCI bridges effectively making _BBN worthless in that case.
>> The problem is that we need a way to determine what the bus
>> number of a host-PCI bridge is.  The BIOS's in question do seem
>> to include valid _ADR's, so if we assume that the bridges are
>> on bus 0, we can address and read their PCI config registers.
>> However, we then have the problem that there doesn't seem to be
>> a standard way for obtaining the bus number from a host-PCI
>> bridge, only for doing so with PCI-PCI bridges.  So, like, what
>> are we supposed to do?  I'm thinking of sharing some code between
>> our non-ACPI PCI bus code and the ACPI PCI bus code that uses
>> the vendor ID's to read the bus number for PCI chipsets that we
>> know about.  However, this seems kind of gross at best.  Would
>> be nice if APCI actually worked in this regard. :(
> 
> Can you say specifically what systems you are seeing this on? And now many?

Don't have that in front of me right now.  The only machine I personally
have with multiple Host-PCI bridges does work fine, but apparently there
are many other machiens out in the wild that don't do this right. :(
 
> My first inclination is to chalk them up to a bad BIOS. Does FBSD have an
> ACPI bad BIOS blacklist?

I don't think we currently do.

> If these systems are very numerous, we may need to think longer on a better
> solution.

Well, currently I have a "solution" where if we find that a host-PCI
bridge has a _BBN of 0 and we've already found a host-PCI bridge for
bus 0 we call a function that uses the vendor ID to try and read the
bus number via config registers from Host-PCI bridges where we know
which register to read to do that.  It's basically the same thing we
do in the non-ACPI case.  I've had at least one person report success
with it and will probably commit it.  The patch in question is at
http://www.FreeBSD.org/~jhb/patches/acpi_pci.patch for those who wish
to test it.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
