> From: Kasper Steensig Jensen <[email protected]>
> Date: Thu, 8 Jan 2015 15:38:12 +0000
> 
> >On Debian I also got the error "Wrong checksum for XDST",
> >I can still read the battery on Debian which I can't on OpenBSD.
> >
> >I also found the "return NULL" that I am hitting in 
> >sys/dev/acpi.c:acpi_maptable()
> >It is the 4th NULL which is in the codeblock:
> >
> >        if (acpi_checksum(hdr, len)) {
> >                acpi_unmap(&handle);
> >                return NULL;
> >        }
> >
> >It is definitely the checksum that something is wrong with,
> >I don't know how to fix it though.
> 
> By commenting the code segmenting out which makes it ignore the checksum
> I could get apm to detect my battery and batterylife.
> This is bad practice and I would like not to do it this way but it makes it 
> work.
> 
> Is it possible that my laptop doesn't live up to the ACPI specs or something?

Yes, it certainly looks like the BIOS in this machine violates the
ACPI spec.  Nothing new there; engineering standards are pretty low in
this areea :(.  People suspect that Windows doesn't verify these
checksums.  And it seems Linux and FreeBSD only print a warning if the
checksum fails.

Can you test the diff below?  Please send me a complete dmesg, and let
me know if there are any remaining problem with that machine.

Thanks,

Mark


Index: acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.278
diff -u -p -r1.278 acpi.c
--- acpi.c      18 Dec 2014 16:31:50 -0000      1.278
+++ acpi.c      10 Jan 2015 20:49:32 -0000
@@ -1042,10 +1042,9 @@ acpi_maptable(struct acpi_softc *sc, pad
        if (acpi_map(addr, len, &handle))
                return NULL;
        hdr = (struct acpi_table_header *)handle.va;
-       if (acpi_checksum(hdr, len)) {
-               acpi_unmap(&handle);
-               return NULL;
-       }
+       if (acpi_checksum(hdr, len))
+               printf("\n%s: %s checksum error", DEVNAME(sc), sig);
+
        if ((sig && memcmp(sig, hdr->signature, 4)) ||
            (oem && memcmp(oem, hdr->oemid, 6)) ||
            (tbl && memcmp(tbl, hdr->oemtableid, 8))) {

Reply via email to