Subject: Re: panic in ACPI configuration
To: Arne H. Juul <arnej@pvv.ntnu.no>
From: Quentin Garnier <cube@cubidou.net>
List: current-users
Date: 08/23/2007 00:54:59
--j8HTHu8OFBZ8oR7J
Content-Type: multipart/mixed; boundary="5FSjmmofnIBL+CP8"
Content-Disposition: inline


--5FSjmmofnIBL+CP8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 22, 2007 at 11:03:12PM +0200, Arne H. Juul wrote:
> I've recently gotten a new machine running NetBSD/i386,
> and with a current GENERIC kernel I'm getting a panic during
> initial kernel configuration:
>=20
> panic: pci_make_tag: bad request
>=20
> does anyone have any tips for what could be wrong?

Yes.  Try the attached patch (in sys/dev/acpi/acpica).

The full trace would still be interesting, though.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.

--5FSjmmofnIBL+CP8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff
Content-Transfer-Encoding: quoted-printable

Index: OsdHardware.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/dev/acpi/acpica/OsdHardware.c,v
retrieving revision 1.2
diff -u -r1.2 OsdHardware.c
--- OsdHardware.c	14 May 2006 21:42:26 -0000	1.2
+++ OsdHardware.c	22 Aug 2007 22:54:10 -0000
@@ -285,6 +285,7 @@
 	ACPI_OBJECT_TYPE type;
 	ACPI_PCI_ID *id;
 	ACPI_INTEGER v;
+	UINT16 d,f;
 	int bus;
=20
 	id =3D *PciId;
@@ -310,9 +311,15 @@
 		if (ACPI_FAILURE(rv))
 			return bus;
=20
+		d =3D ACPI_HIWORD((ACPI_INTEGER)v);
+		f =3D ACPI_LOWORD((ACPI_INTEGER)v);
+
+		if (d >=3D 32 || f >=3D 8)
+			return bus;
+
 		id->Bus =3D bus;
-		id->Device =3D ACPI_HIWORD((ACPI_INTEGER)v);
-		id->Function =3D ACPI_LOWORD((ACPI_INTEGER)v);
+		id->Device =3D d;
+		id->Function =3D f;
=20
 		/* read HDR_TYPE register */
 		rv =3D AcpiOsReadPciConfiguration(id, 0x0e, &v, 8);

--5FSjmmofnIBL+CP8--

--j8HTHu8OFBZ8oR7J
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)

iQEVAwUBRsy+w9goQloHrPnoAQImxgf/a4cMYHuqsKUbhi/nRwNwflOhFQ+ylwep
HDaoY3hZWAh7G83MQH+u+YnAWbJ2Trio4rhhvFr4MzXS572RGnIYG+rkkN3JQqLc
F+aLYVaNKva4ycX5qKleOebopTISQKNQbV13zCMW6I7+s1/YgoUccFRzrPKr5jse
Qq/jpQGTCovVVTZvzLSZIPsoYzD6CGvSLTAbQ4Qa7hGvKK598Z8ww6ExgW2YYbPq
Zc0gjaI1K9IQdRfOKzwfDNPtUfYYjLnjygqfq0oePn2dfZHk4PsGnyr99D0G75wd
ZaL14yjFhY9sWArIIY0kugkpX1GxDTnzqKPZn5DIct5pbc73SHJSig==
=wq49
-----END PGP SIGNATURE-----

--j8HTHu8OFBZ8oR7J--