Date: Mon, 7 Sep 2020 06:29:41 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365396 - head/sys/dev/iicbus/twsi Message-ID: <202009070629.0876Tfro033683@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Mon Sep 7 06:29:41 2020 New Revision: 365396 URL: https://svnweb.freebsd.org/changeset/base/365396 Log: twsi: use tsleep instead of pause for better responsiveness wakeup() does not have any effect on pause(), so if a transfer was not finished by the time of the first check, then the thread would sleep full 30 ms. To do: protect the transfer and interrupt code with the mutex, switch from tsleep from msleep Reviewed by: manu MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D26309 Modified: head/sys/dev/iicbus/twsi/twsi.c Modified: head/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.c Mon Sep 7 06:27:18 2020 (r365395) +++ head/sys/dev/iicbus/twsi/twsi.c Mon Sep 7 06:29:41 2020 (r365396) @@ -510,7 +510,7 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint sc->control_val &= ~TWSI_CONTROL_ACK; TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); while (sc->error == 0 && sc->transfer != 0) { - pause_sbt("twsi", SBT_1MS * 30, SBT_1MS, 0); + tsleep_sbt(sc, 0, "twsi", SBT_1MS * 30, SBT_1MS, 0); } debugf(sc->dev, "pause finish\n");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009070629.0876Tfro033683>