Date: Sun, 30 Sep 2007 12:10:11 -0700 From: Nate Lawson <nate@root.org> To: Abdullah Ibn Hamad Al-Marri <almarrie@gmail.com> Cc: freebsd-acpi@freebsd.org Subject: Re: INTEL D946GZIS acpi issues. Message-ID: <46FFF493.3070800@root.org> In-Reply-To: <46FC3CB3.3060202@root.org> References: <499c70c0709271301g500d1d08gefe126bc65300d6c@mail.gmail.com> <46FC28DA.5090703@root.org> <499c70c0709271546i494a98au1a5d9dce4630a56c@mail.gmail.com> <46FC355A.1060807@root.org> <499c70c0709271559v515d1f7ev1a88acca94b68c4c@mail.gmail.com> <46FC3CB3.3060202@root.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Nate Lawson wrote:
>> devinfo -rv
>> nexus0
>> acpi0
> ...
>> I/O memory addresses:
>> 0xc0000-0xdffff
>> 0xe0000-0xfffff
>> 0xf0000000-0xf7ffffff
>> 0xfed13000-0xfed13fff
>> 0xfed14000-0xfed17fff
>> 0xfed18000-0xfed18fff
>> 0xfed19000-0xfed19fff
>> 0xfed1c000-0xfed1ffff
>> 0xfed20000-0xfed9ffff
>> acpi_hpet0 pnpinfo unknown at unknown
>> I/O memory addresses:
>> 0xfed00000-0xfed003ff
>
> Ok, that's one problem. acpi_hpet is attaching before the system
> resource object. So the resources are already allocated from nexus
> before acpi0 can get to them.
>
> To test, set this hint at the loader prompt and the message will go away
> (but you won't have the HPET timer):
>
> debug.acpi.disabled="hpet"
Please try the attached patch for 7-current. You should not see the
message any more but will still have an acpi_hpet0 device. Please send
me dmesg and devinfo -rv output after testing.
-Nate
[-- Attachment #2 --]
Index: sys/dev/acpica/acpi.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/acpica/acpi.c,v
retrieving revision 1.242
diff -u -r1.242 acpi.c
--- sys/dev/acpica/acpi.c 13 Sep 2007 01:37:17 -0000 1.242
+++ sys/dev/acpica/acpi.c 30 Sep 2007 19:01:45 -0000
@@ -509,7 +509,6 @@
* a problem but should be addressed eventually.
*/
acpi_ec_ecdt_probe(dev);
- acpi_hpet_table_probe(dev);
/* Bring device objects and regions online. */
if (ACPI_FAILURE(status = AcpiInitializeObjects(flags))) {
Index: sys/dev/acpica/acpi_hpet.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/acpica/acpi_hpet.c,v
retrieving revision 1.11
diff -u -r1.11 acpi_hpet.c
--- sys/dev/acpica/acpi_hpet.c 30 Jul 2007 15:21:26 -0000 1.11
+++ sys/dev/acpica/acpi_hpet.c 30 Sep 2007 19:07:26 -0000
@@ -83,14 +83,18 @@
}
/* Discover the HPET via the ACPI table of the same name. */
-void
-acpi_hpet_table_probe(device_t parent)
+static void
+acpi_hpet_identify(driver_t *driver, device_t parent)
{
ACPI_TABLE_HPET *hpet;
ACPI_TABLE_HEADER *hdr;
ACPI_STATUS status;
device_t child;
+ /* Only one HPET device can be added. */
+ if (devclass_get_device(acpi_hpet_devclass, 0))
+ return;
+
/* Currently, ID and minimum clock tick info is unused. */
status = AcpiGetTable(ACPI_SIG_HPET, 1, (ACPI_TABLE_HEADER **)&hdr);
@@ -105,7 +109,7 @@
if (hpet->Sequence != 0)
printf("ACPI HPET table warning: Sequence is non-zero (%d)\n",
hpet->Sequence);
- child = BUS_ADD_CHILD(parent, 0, "acpi_hpet", 0);
+ child = BUS_ADD_CHILD(parent, 10, "acpi_hpet", 0);
if (child == NULL) {
printf("%s: can't add child\n", __func__);
return;
@@ -115,8 +119,6 @@
acpi_set_magic(child, (uintptr_t)&acpi_hpet_devclass);
bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address,
HPET_MEM_WIDTH);
- if (device_probe_and_attach(child) != 0)
- device_delete_child(parent, child);
}
static int
@@ -254,6 +256,7 @@
static device_method_t acpi_hpet_methods[] = {
/* Device interface */
+ DEVMETHOD(device_identify, acpi_hpet_identify),
DEVMETHOD(device_probe, acpi_hpet_probe),
DEVMETHOD(device_attach, acpi_hpet_attach),
DEVMETHOD(device_detach, acpi_hpet_detach),
Index: sys/dev/acpica/acpivar.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/acpica/acpivar.h,v
retrieving revision 1.107
diff -u -r1.107 acpivar.h
--- sys/dev/acpica/acpivar.h 21 Jun 2007 22:50:37 -0000 1.107
+++ sys/dev/acpica/acpivar.h 30 Sep 2007 19:01:18 -0000
@@ -432,8 +432,6 @@
/* Embedded controller. */
void acpi_ec_ecdt_probe(device_t);
-/* HPET table probe*/
-void acpi_hpet_table_probe(device_t);
/* AC adapter interface. */
int acpi_acad_get_acline(int *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46FFF493.3070800>
