OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: -current amd64 intel core 2 overheat w/ acpi

From: Marco Peereboom (slashpeereboom.us)
Date: Mon Dec 17 2007 - 15:43:47 CST


I am looking for machines that have a line in dmesg that has the values
set to something else than -1. I do have a test machine with _PSV != -1
so don't bother with that one.
acpitz0: _HOT: -1 _TC1: -1 _TC2: -1 _PSV: -1

If you have a machine with _HOT and/or _TC? set to something different
than -1 let me know.

Index: acpitz.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpitz.c,v
retrieving revision 1.20
diff -u -p -u -p -r1.20 acpitz.c
--- acpitz.c 12 Nov 2007 21:38:31 -0000 1.20
+++ acpitz.c 12 Dec 2007 19:12:14 -0000
-35,6 +35,11
 
 #define ACPITZ_MAX_AC 10
 
+/* XXX kill me !!!! */
+#undef dnprintf
+#define dnprintf(n,x...) do { if (acpi_debug > (n)) printf(x); } while (0)
+int acpi_debug = 99;
+
 struct acpitz_softc {
         struct device sc_dev;
 
-110,7 +115,7 acpitz_attach(struct device *parent, str
 
         if ((sc->sc_crt = acpitz_getreading(sc, "_CRT")) == -1) {
                 printf(": no critical temperature defined\n");
- sc->sc_crt = 0;
+ return;
         } else
                 printf(": critical temperature %d degC\n",
                     (sc->sc_crt - 2732) / 10);
-119,12 +124,15 acpitz_attach(struct device *parent, str
                 snprintf(name, sizeof name, "_AC%d", i);
                 sc->sc_ac[i] = acpitz_getreading(sc, name);
                 sc->sc_ac_stat[0] = -1;
+ dnprintf(10, "%s: _AC%d: %d\n", DEVNAME(sc), i, sc->sc_ac[i]);
         }
 
         sc->sc_hot = acpitz_getreading(sc, "_HOT");
         sc->sc_tc1 = acpitz_getreading(sc, "_TC1");
         sc->sc_tc2 = acpitz_getreading(sc, "_TC2");
         sc->sc_psv = acpitz_getreading(sc, "_PSV");
+ dnprintf(10, "%s: _HOT: %d _TC1: %d _TC2: %d _PSV: %d\n", DEVNAME(sc),
+ sc->sc_hot, sc->sc_tc1, sc->sc_tc2, sc->sc_psv);
 
         strlcpy(sc->sc_sensdev.xname, DEVNAME(sc),
             sizeof(sc->sc_sensdev.xname));
-244,20 +252,20 acpitz_refresh(void *arg)
         int i, trend;
         extern int acpi_s5;
 
- dnprintf(30, "%s: %s: refresh\n", DEVNAME(sc),
- sc->sc_devnode->parent->name);
-
         if (-1 == (sc->sc_tmp = acpitz_getreading(sc, "_TMP"))) {
                 dnprintf(30, "%s: %s: failed to read temp\n", DEVNAME(sc),
                     sc->sc_devnode->parent->name);
                 sc->sc_tmp = 0; /* XXX */
         }
+ dnprintf(30, "%s: %s: refresh _TMP: %d\n", DEVNAME(sc),
+ sc->sc_devnode->parent->name, sc->sc_tmp);
 
         if (sc->sc_crt != -1 && sc->sc_crt <= sc->sc_tmp) {
                 /* Do critical shutdown */
                 printf("%s: Critical temperature, shutting down\n",
                     DEVNAME(sc));
- acpi_s5 = 1;
+ printf("%ld %ld\n", sc->sc_crt, sc->sc_tmp);
+ acpi_s5 = acpi_s5;
                 psignal(initproc, SIGUSR1);
         }
         if (sc->sc_hot != -1 && sc->sc_hot <= sc->sc_tmp)
-292,16 +300,19 acpitz_refresh(void *arg)
 int
 acpitz_getreading(struct acpitz_softc *sc, char *name)
 {
- struct aml_value res;
         int rv = -1;
+ struct aml_value res;
 
         if (aml_evalname(sc->sc_acpi, sc->sc_devnode, name, 0, NULL, &res)) {
                 dnprintf(10, "%s: no %s\n", DEVNAME(sc), name);
- goto out;
+ } else {
+ rv = aml_val2int(&res);
+ /* less than 0K is invalid */
+ if (rv < 2732)
+ rv = -1;
         }
- rv = aml_val2int(&res);
- out:
- aml_freevalue(&res);
+
+ aml_freevalue(&res);
         return (rv);
 }
 

On Mon, Dec 17, 2007 at 04:55:23PM -0500, Sean Kennedy wrote:
> > Subject: Re: -current amd64 intel core 2 overheat w/ acpi
> >
> > I am working on a diff for acpitz to add some more cooling. Are you
> > going to be able to test diffs for me?
>
> I'll try if possible.
> I have an ASUS Aspire 5002WLMi with a scratchable hard disk. (Philips screw
> Swap disk...)
>
> I have not moved to -current with anything due to another laptop [Thinkpad
> T21] that needs to be re-loaded from a snapshot, since I have a broken make
> build compile in the DNS acl tree.
>
> I noticed that APM on the asus was "not good" and could not even do good
> shutdowns.
>
> If you wish for dmesg on -stable, I can send that on too.
> ACPI enabled and Not if you wish.
>
> -sean
> _________________________________________________________________
> Use fowl language with Chicktionary. Click here to start playing!
> http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig