Date: Fri, 19 Jan 2024 17:09:51 GMT From: Alexander Motin <mav@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 4061a0e5b273 - stable/13 - iicbb: Fix pause_sbt() arguments order Message-ID: <202401191709.40JH9pPF079621@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=4061a0e5b2734c2c466bb7a7917645b913499e49 commit 4061a0e5b2734c2c466bb7a7917645b913499e49 Author: Alexander Motin <mav@FreeBSD.org> AuthorDate: 2023-12-23 23:52:17 +0000 Commit: Alexander Motin <mav@FreeBSD.org> CommitDate: 2024-01-19 17:08:13 +0000 iicbb: Fix pause_sbt() arguments order It should make pause interval less strict. While there, add cpu_spinwait() into a tight spin wait loop to burn less power and let other SMT thread work more. MFC after: 1 month (cherry picked from commit a74df3f96e3ea4cc632088be870d9b0b0198859c) --- sys/dev/iicbus/iicbb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/iicbus/iicbb.c b/sys/dev/iicbus/iicbb.c index 043da64f1d04..608c38688acd 100644 --- a/sys/dev/iicbus/iicbb.c +++ b/sys/dev/iicbus/iicbb.c @@ -52,6 +52,7 @@ #include <sys/bus.h> #include <sys/sysctl.h> #include <sys/uio.h> +#include <machine/cpu.h> #ifdef FDT #include <dev/ofw/ofw_bus.h> @@ -256,11 +257,12 @@ iicbb_waitforscl(device_t dev) do { if (I2C_GETSCL(dev)) return (0); + cpu_spinwait(); now = sbinuptime(); } while (now < fast_timeout); do { I2C_DEBUG(printf(".")); - pause_sbt("iicbb-scl-low", SBT_1MS, C_PREL(8), 0); + pause_sbt("iicbb-scl-low", SBT_1MS, 0, C_PREL(2)); if (I2C_GETSCL(dev)) return (0); now = sbinuptime();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401191709.40JH9pPF079621>