acpi/pstate: Be lenient about wrong # of processors in the power domain
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 11 Oct 2012 06:54:52 +0000 (14:54 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 11 Oct 2012 06:57:10 +0000 (14:57 +0800)
Some stupid BIOSes seem to consider two logic CPUs (hyperthreading) as
one CPU.  Don't bail out; just print some error messages.

Reported-by: dillon@
sys/dev/acpica5/acpi_cpu_pstate.c

index bd54049..6410b88 100644 (file)
@@ -357,7 +357,15 @@ acpi_pst_attach(device_t dev)
                device_printf(dev, "Domain%u already contains %d P-States, "
                              "invalid _PSD package\n",
                              dom->pd_dom, dom->pd_nproc);
+#if 0
+               /*
+                * Some stupid BIOSes will set wrong "# of processors",
+                * e.g. 1 for CPU w/ hyperthreading; Be lenient here.
+                */
                return ENXIO;
+#else
+               dom->pd_nproc++;
+#endif
        }
        KKASSERT(i < dom->pd_nproc);
 
@@ -622,11 +630,19 @@ acpi_pst_domain_create_pkg(device_t dev, ACPI_OBJECT *obj)
                            "Package _PSD\n");
                        return NULL;
                }
-               if (dom->pd_coord != coord || dom->pd_nproc != nproc) {
-                       device_printf(dev, "Inconsistent _PSD information "
-                                     "cross Processor objects\n");
+               if (dom->pd_coord != coord) {
+                       device_printf(dev, "Inconsistent _PSD coord "
+                           "information cross Processor objects\n");
                        return NULL;
                }
+               if (dom->pd_nproc != nproc) {
+                       device_printf(dev, "Inconsistent _PSD nproc "
+                           "information cross Processor objects\n");
+                       /*
+                        * Some stupid BIOSes will set wrong "# of processors",
+                        * e.g. 1 for CPU w/ hyperthreading; Be lenient here.
+                        */
+               }
                return dom;
        }