summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/dsdt.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-07-20 12:20:39 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-07-20 12:20:39 +0000
commitacda3aecbe922cd831d3c026c738efbc29b46f5e (patch)
treeda22eaf5ded8e3eb0aa49f9c002f9e6227c6f3d2 /sys/dev/acpi/dsdt.c
parent44c89de53c99f01730b08447333749e202894ba7 (diff)
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@
Diffstat (limited to 'sys/dev/acpi/dsdt.c')
-rw-r--r--sys/dev/acpi/dsdt.c5
1 files changed, 3 insertions, 2 deletions
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 <jordan@openbsd.org>
*
@@ -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) {