From owner-acpi-jp@jp.freebsd.org  Sat Sep 15 09:01:44 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id JAA92086;
	Sat, 15 Sep 2001 09:01:44 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from mass.dis.org (mass.dis.org [216.240.45.41])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id JAA92081
	for <acpi-jp@jp.freebsd.org>; Sat, 15 Sep 2001 09:01:43 +0900 (JST)
	(envelope-from msmith@mass.dis.org)
Received: from mass.dis.org (localhost [127.0.0.1])
	by mass.dis.org (8.11.6/8.11.3) with ESMTP id f8F09G505193;
	Fri, 14 Sep 2001 17:09:17 -0700 (PDT)
	(envelope-from msmith@mass.dis.org)
Message-Id: <200109150009.f8F09G505193@mass.dis.org>
To: acpi-jp@jp.freebsd.org
cc: ache@freebsd.org
In-Reply-To: Message from David Malone <dwmalone@maths.tcd.ie> 
   of "Fri, 14 Sep 2001 19:53:10 BST." <20010914195310.A16340@walton.maths.tcd.ie> 
Date: Fri, 14 Sep 2001 17:09:16 -0700
From: Mike Smith <msmith@freebsd.org>
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: acpi-jp 1282
Subject: [acpi-jp 1282] Re: Phantom serial ports with -current acpi. 
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: msmith@freebsd.org

> 
> I seem to have one of those unfortunate machines that doesn't work
> very well with ACPI. With the previous version of ACPI in -current
> it did not detect my floppy drive. With the -current version it
> detects an extra serial port and then freezes.
> 
> sio0 port 0x3f8-0x3ff irq4 on acpi 0
> sio0: type  16550A
> sio1 port 0x2f8-0x2ff irq 3 on acpi 0
> sio1: type 16550A
> sio2: configured irq 0 not in bitmap of probed irqs
> sio2 port 0-0x87 irq 0 on acpi0
> sio2: type 8250
> 
> I'm not terribly supriesd that it freezes after this! I've tried
> deleting the hints for the serial ports and that doesn't help.
> 
> The motherboard is a Gigabyte GA-5AX with "ALi Aladdin V AGPset"
> according to the manual. I've included the output of acpidump and
> the dmesg from a nonacpi boot.

Thanks.  The ACPI dump makes what's going on fairly clear; the
infrared port is declared as a separate device with some _STA magic.

Try the attached patch; this will prevent us from assigning resources,
probing or attaching to a non-present device.

Index: acpi.c
===================================================================
RCS file: /local0/cvs/src/sys/dev/acpica/acpi.c,v
retrieving revision 1.38
diff -u -r1.38 acpi.c
--- acpi.c	2001/09/12 08:37:00	1.38
+++ acpi.c	2001/09/14 17:00:49
@@ -786,6 +786,16 @@
 	    acpi_set_handle(child, handle);
 
 	    /*
+	     * Check that the device is present.  If it's not present,
+	     * leave it disabled (so that we have a device_t attached to
+	     * the handle, but we don't probe it).
+	     */
+	    if (!acpi_DeviceIsPresent(child)) {
+		device_disable(child);
+		break;
+	    }
+
+	    /*
 	     * Get the device's resource settings and attach them.
 	     * Note that if the device has _PRS but no _CRS, we need
 	     * to decide when it's appropriate to try to configure the

And let me know if this works.

Andrey, this should fix your bogus serial port problem as well; please test
and let me know.

Regards,
Mike
