From: kettenis Date: Sun, 20 Jul 2014 12:20:38 +0000 (+0000) Subject: Skip reading bits from a region marked as "Preserve" if all bits will be X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a3963bb58ef72f5015656e3b420125f3e040f187;p=openbsd Skip reading bits from a region marked as "Preserve" if all bits will be modified. Some Sony and Asus laptops don't like this; the read seems to trigger an unwanted SMI that makes the machine hang. Diagnosed by mpi@ ok mpi@ --- diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 89179f9fae6..20dd8af22d7 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.212 2014/07/12 18:48:17 tedu Exp $ */ +/* $OpenBSD: dsdt.c,v 1.213 2014/07/20 12:20:38 kettenis Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave * @@ -2311,7 +2311,8 @@ aml_rwgas(struct aml_value *rgn, int bpos, int blen, struct aml_value *val, aml_bufcpy(vbit, 0, tbit, bpos, blen); } else { /* Write bits to opregion */ - if (AML_FIELD_UPDATE(flag) == AML_FIELD_PRESERVE) { + if (AML_FIELD_UPDATE(flag) == AML_FIELD_PRESERVE && + (bpos != 0 || blen != tlen)) { acpi_gasio(acpi_softc, ACPI_IOREAD, type, pi.addr, sz, tlen >> 3, tbit); } else if (AML_FIELD_UPDATE(flag) == AML_FIELD_WRITEASONES) {