summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorAnthony J. Bentley <bentley@cvs.openbsd.org>2018-01-17 07:40:30 +0000
committerAnthony J. Bentley <bentley@cvs.openbsd.org>2018-01-17 07:40:30 +0000
commitad3e77f6bed627503807aa805642ed9f00d6fd4e (patch)
treee193721d0177afef1e716f8f74395e323df3fa93 /sys/dev/acpi
parent959ef76b7c4d95820a41d8135de0cfd56c75ec74 (diff)
Disable ACPI burst mode on the 2015 Chromebook Pixel, where it freezes.
Diff from jcs@, ok pirofti@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpidev.h3
-rw-r--r--sys/dev/acpi/acpiec.c21
2 files changed, 22 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpidev.h b/sys/dev/acpi/acpidev.h
index e35992785a4..077a29ee046 100644
--- a/sys/dev/acpi/acpidev.h
+++ b/sys/dev/acpi/acpidev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidev.h,v 1.42 2017/09/06 13:01:48 jcs Exp $ */
+/* $OpenBSD: acpidev.h,v 1.43 2018/01/17 07:40:29 bentley Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
@@ -374,6 +374,7 @@ struct acpiec_softc {
struct acpiec_event sc_events[ACPIEC_MAX_EVENTS];
int sc_gotsci;
int sc_glk;
+ int sc_cantburst;
};
void acpibtn_disable_psw(void);
diff --git a/sys/dev/acpi/acpiec.c b/sys/dev/acpi/acpiec.c
index c39f3028097..ecf0f3f7f99 100644
--- a/sys/dev/acpi/acpiec.c
+++ b/sys/dev/acpi/acpiec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpiec.c,v 1.56 2017/03/11 21:46:32 jcs Exp $ */
+/* $OpenBSD: acpiec.c,v 1.57 2018/01/17 07:40:29 bentley Exp $ */
/*
* Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org>
*
@@ -77,6 +77,8 @@ void acpiec_unlock(struct acpiec_softc *);
int acpiec_reg(struct acpiec_softc *);
+extern char *hw_vendor, *hw_prod;
+
struct cfattach acpiec_ca = {
sizeof(struct acpiec_softc), acpiec_match, acpiec_attach
};
@@ -195,6 +197,9 @@ acpiec_write_1(struct acpiec_softc *sc, u_int8_t addr, u_int8_t data)
void
acpiec_burst_enable(struct acpiec_softc *sc)
{
+ if (sc->sc_cantburst)
+ return;
+
acpiec_write_cmd(sc, EC_CMD_BE);
acpiec_read_data(sc);
}
@@ -202,6 +207,9 @@ acpiec_burst_enable(struct acpiec_softc *sc)
void
acpiec_burst_disable(struct acpiec_softc *sc)
{
+ if (sc->sc_cantburst)
+ return;
+
if ((acpiec_status(sc) & EC_STAT_BURST) == EC_STAT_BURST)
acpiec_write_cmd(sc, EC_CMD_BD);
}
@@ -273,6 +281,7 @@ acpiec_attach(struct device *parent, struct device *self, void *aux)
sc->sc_acpi = (struct acpi_softc *)parent;
sc->sc_devnode = aa->aaa_node;
+ sc->sc_cantburst = 0;
if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "_STA", 0, NULL, &st))
st = STA_PRESENT | STA_ENABLED | STA_DEV_OK;
@@ -294,6 +303,16 @@ acpiec_attach(struct device *parent, struct device *self, void *aux)
return;
}
+ /*
+ * Some Chromebooks using the Google EC do not support burst mode and
+ * cause us to spin forever waiting for the acknowledgment. Don't use
+ * burst mode at all on these machines.
+ */
+ if (hw_vendor != NULL && hw_prod != NULL &&
+ strcmp(hw_vendor, "GOOGLE") == 0 &&
+ strcmp(hw_prod, "Samus") == 0)
+ sc->sc_cantburst = 1;
+
acpiec_get_events(sc);
dnprintf(10, "%s: GPE: %d\n", DEVNAME(sc), sc->sc_gpe);