From 9013445558ca6a1f486610d882aaa9c805685b88 Mon Sep 17 00:00:00 2001 From: Joshua Stein Date: Fri, 22 Jun 2018 15:58:27 +0000 Subject: set I2C_F_POLL when acquiring the iic bus in an interrupt handler found by witness, reported and tested by bentley --- sys/dev/i2c/iatp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/i2c/iatp.c') 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 @@ -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; } -- cgit v1.2.3