summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjcs <jcs@openbsd.org>2018-06-22 15:58:26 +0000
committerjcs <jcs@openbsd.org>2018-06-22 15:58:26 +0000
commit4b036c7d389d24576d1c4da4495cf9310a8fb450 (patch)
tree89c8587c3a034aa5d617934ce8e0740fb5b2f114 /sys
parentAdd --dry-run as synonym to -C/--check. (diff)
downloadwireguard-openbsd-4b036c7d389d24576d1c4da4495cf9310a8fb450.tar.xz
wireguard-openbsd-4b036c7d389d24576d1c4da4495cf9310a8fb450.zip
set I2C_F_POLL when acquiring the iic bus in an interrupt handler
found by witness, reported and tested by bentley
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/i2c/iatp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/i2c/iatp.c b/sys/dev/i2c/iatp.c
index 54e9ca75295..189b547e189 100644
--- a/sys/dev/i2c/iatp.c
+++ b/sys/dev/i2c/iatp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iatp.c,v 1.4 2017/10/28 14:44:46 bru Exp $ */
+/* $OpenBSD: iatp.c,v 1.5 2018/06/22 15:58:26 jcs Exp $ */
/*
* Atmel maXTouch i2c touchscreen/touchpad driver
* Copyright (c) 2016 joshua stein <jcs@openbsd.org>
@@ -682,12 +682,12 @@ iatp_read_reg(struct iatp_softc *sc, uint16_t reg, size_t len, void *val)
uint8_t cmd[2] = { reg & 0xff, (reg >> 8) & 0xff };
int ret;
- iic_acquire_bus(sc->sc_tag, 0);
+ iic_acquire_bus(sc->sc_tag, I2C_F_POLL);
ret = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, &cmd,
sizeof(cmd), val, len, I2C_F_POLL);
- iic_release_bus(sc->sc_tag, 0);
+ iic_release_bus(sc->sc_tag, I2C_F_POLL);
return ret;
}