summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcs <jcs@openbsd.org>2017-03-11 21:46:32 +0000
committerjcs <jcs@openbsd.org>2017-03-11 21:46:32 +0000
commit49357ad474189bbdf05bca9b7e02d36ebd1f5ea0 (patch)
tree8336f07e71fa12e1cc6637a0d41a3f3fc6cce6dc
parentUse sizeof directly instead of a macro from the scary <struct.h> (diff)
downloadwireguard-openbsd-49357ad474189bbdf05bca9b7e02d36ebd1f5ea0.tar.xz
wireguard-openbsd-49357ad474189bbdf05bca9b7e02d36ebd1f5ea0.zip
Revert 1.54, go back to always trying to enable burst mode
Selectively enabling burst mode seems to have broken more machines than it helped. On MacBooks, EC_STAT_OBF occasionally won't show up when trying to read a byte of data when bursting hasn't been enabled, so acpiec_wait can spin forever. This again breaks on ECs that don't do burst at all, like the Chrome EC, but those are much more scarce than MacBooks at this time. A machine/bios-dependent check could be added later to disable bursting on certain machines. Discussed with deraadt
-rw-r--r--sys/dev/acpi/acpiec.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/acpi/acpiec.c b/sys/dev/acpi/acpiec.c
index 0132a8a91b6..c39f3028097 100644
--- a/sys/dev/acpi/acpiec.c
+++ b/sys/dev/acpi/acpiec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpiec.c,v 1.55 2016/10/25 06:55:59 pirofti Exp $ */
+/* $OpenBSD: acpiec.c,v 1.56 2017/03/11 21:46:32 jcs Exp $ */
/*
* Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org>
*
@@ -218,12 +218,10 @@ acpiec_read(struct acpiec_softc *sc, u_int8_t addr, int len, u_int8_t *buffer)
*/
dnprintf(20, "%s: read %d, %d\n", DEVNAME(sc), (int)addr, len);
sc->sc_ecbusy = 1;
- if (len > 1)
- acpiec_burst_enable(sc);
+ acpiec_burst_enable(sc);
for (reg = 0; reg < len; reg++)
buffer[reg] = acpiec_read_1(sc, addr + reg);
- if (len > 1)
- acpiec_burst_disable(sc);
+ acpiec_burst_disable(sc);
sc->sc_ecbusy = 0;
}
@@ -239,12 +237,10 @@ acpiec_write(struct acpiec_softc *sc, u_int8_t addr, int len, u_int8_t *buffer)
*/
dnprintf(20, "%s: write %d, %d\n", DEVNAME(sc), (int)addr, len);
sc->sc_ecbusy = 1;
- if (len > 1)
- acpiec_burst_enable(sc);
+ acpiec_burst_enable(sc);
for (reg = 0; reg < len; reg++)
acpiec_write_1(sc, addr + reg, buffer[reg]);
- if (len > 1)
- acpiec_burst_disable(sc);
+ acpiec_burst_disable(sc);
sc->sc_ecbusy = 0;
}