[Bug 253915] pchtherm0: Sensor enable failed

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Mar 2 14:53:59 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253915

--- Comment #4 from michal at microwave.sk ---
Hi,

I found another bug regarding the "SMI on alert" value. Value is read from
wrong register. Here is the patch fixing both bugs:

diff --git a/sys/dev/intel/pchtherm.c b/sys/dev/intel/pchtherm.c
index 13f0abc54b6..31d06a1bc26 100644
--- a/sys/dev/intel/pchtherm.c
+++ b/sys/dev/intel/pchtherm.c
@@ -163,7 +163,7 @@ static int pchtherm_attach(device_t dev)
                        bus_write_1(sc->tbar, PCHTHERM_REG_TSEL,
                                    PCHTHERM_GEN_ENABLE);
                        sc->enable = bus_read_1(sc->tbar, PCHTHERM_REG_TSEL);
-                       if (!(sc->enable & PCHTHERM_REG_TSEL)){
+                       if (!(sc->enable & PCHTHERM_GEN_ENABLE)) {
                                device_printf(dev, "Sensor enable failed\n");
                                return 0;
                        }
@@ -178,7 +178,7 @@ static int pchtherm_attach(device_t dev)
        if (bootverbose) {
                FLAG_PRINT(dev, "SMBus report", val);
        }
-       val = bus_read_1(sc->tbar, PCHTHERM_REG_TSC);
+       val = bus_read_1(sc->tbar, PCHTHERM_REG_TSMIC);
        if (bootverbose) {
                FLAG_PRINT(dev, "SMI on alert", val);
        }

Honestly, I think this driver is pretty unfinished as of now.

If you decide to commit this, please use "Michal Vanco
<michal.vanco at gmail.com>" in the commit message.

There is another issue. pchtherm(4) man page says that it can be compiled into
kernel (device pchtherm) which doesn't work. It can only compiled as a kernel
module. 

Thanks,
Michal

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list