[issue557] 1.9.0-DEVELOPMENT hangs with ACPI enabled

YONETANI Tomokazu qhwt+dfly at les.ath.cx
Tue Mar 6 04:38:53 PST 2007


On Tue, Mar 06, 2007 at 08:16:18AM -0300, Mariano Aliaga wrote:
> On 3/4/07, YONETANI Tomokazu <qhwt+dfly at les.ath.cx> wrote:
> >Anyway, I wrote another patch to narrow down the location.  Please undo
> >any changes to files under /sys/dev/acpica5, apply the patch attached
> >to this message, and reinstall the driver.  Now you have knobs 1 to 5.
> >This time, please add the following two lines in /boot/loader.conf:
> >  debug.acpi.layer="ACPI_PROCESSOR"
> >  debug.acpi.layer="ACPI_LV_INFO"
> 
> I think you forgot to attach the patch ;-)

Oops, sorry.
Index: acpi_cpu.c
===================================================================
RCS file: /home/source/dragonfly/cvs/src/sys/dev/acpica5/acpi_cpu.c,v
retrieving revision 1.19
diff -u -p -r1.19 acpi_cpu.c
--- acpi_cpu.c	22 Feb 2007 04:02:50 -0000	1.19
+++ acpi_cpu.c	4 Mar 2007 16:51:20 -0000
@@ -182,10 +182,15 @@ static devclass_t acpi_cpu_devclass;
 DRIVER_MODULE(cpu, acpi, acpi_cpu_driver, acpi_cpu_devclass, 0, 0);
 MODULE_DEPEND(cpu, acpi, 1, 1, 1);
 
+static int acpi_cpu_probe_debug_knob = 0;
+TUNABLE_INT("debug.acpi.cpu.knob", &acpi_cpu_probe_debug_knob);
+#define DEBUG_KNOB(n)	\
+    if (acpi_cpu_probe_debug_knob == (n)) return(ENXIO)
+
 static int
 acpi_cpu_probe(device_t dev)
 {
-    int			   acpi_id, cpu_id, cx_count;
+    int			   acpi_id, cpu_id, proc_id, cx_count;
     ACPI_BUFFER		   buf;
     ACPI_HANDLE		   handle;
     char		   msg[32];
@@ -221,11 +226,17 @@ acpi_cpu_probe(device_t dev)
      * ProcId as a key, however, some boxes do not have the same values
      * in their Processor object as the ProcId values in the MADT.
      */
-    acpi_id = obj->Processor.ProcId;
+    acpi_id = proc_id = obj->Processor.ProcId;
     AcpiOsFree(obj);
-    if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0)
+    if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0) {
+	if (bootverbose)
+	    device_printf(dev, "ProcId %d: can't find cpu_id\n", proc_id);
 	return (ENXIO);
-
+    }
+    if (bootverbose) {
+	device_printf(dev, "ProcId %d: acpi_id=%d, cpu_id=%d\n", proc_id,
+		      acpi_id, cpu_id);
+    }
     /*
      * Check if we already probed this processor.  We scan the bus twice
      * so it's possible we've already seen this one.
@@ -313,19 +324,25 @@ acpi_cpu_attach(device_t dev)
      * Probe for throttling and Cx state support.
      * If none of these is present, free up unused resources.
      */
+DEBUG_KNOB(1);
     thr_ret = acpi_cpu_throttle_probe(sc);
+DEBUG_KNOB(2);
     cx_ret = acpi_cpu_cx_probe(sc);
+DEBUG_KNOB(3);
     if (thr_ret == 0 || cx_ret == 0) {
 	status = AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY,
 					  acpi_cpu_notify, sc);
+DEBUG_KNOB(4);
 	if (device_get_unit(dev) == 0)
 	    AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL);
     } else {
 	sysctl_ctx_free(&acpi_cpu_sysctl_ctx);
     }
+DEBUG_KNOB(5);
 
     return_VALUE (0);
 }
+#undef DEBUG_KNOB
 
 /*
  * Find the nth present CPU and return its pc_cpuid as well as set the




More information about the Bugs mailing list