From nobody Sat Dec 23 23:59:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SyLjy0bVSz55BHr; Sat, 23 Dec 2023 23:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SyLjy03jbz3Fxd; Sat, 23 Dec 2023 23:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703375958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uYvArKtdx6eRogCkDIEkV0ybyVF6Ga1Q9xXwwQhRyhU=; b=lB5YEsYnmd6hgu4BGVD4eGz72AWaiyciuWSJL/MaCrE7I8qrxqm4ElrzdqJkG6QrHQCqE7 /W2f1G60cPYvsY/D3EIaQmRKRJHBHHDwpYFqUb/Aq1DRwnzQQxKDzIEG6vdKedPxJ/gkiu q0CBTvvW6QEUOUSzLLrmXks1UCZAGLysgi2+v/+8WV623Fx/uMKiYVTFQbiplU0NhVypNV 0IwRmZMdeE89YOUsN2NYq6BLpOrnWJa34s4IgyKKI0zASIto7YGYmRvbpXUoB+2UZNRTsU ziASwYGLbn16lAehWLgUP6oxeRnAwjDZrwolUy9coG5gClQ7yfniYDKuKCDYYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703375958; a=rsa-sha256; cv=none; b=ayguaXE9QTTATZC+Q5S1/g1EWW+y5TcI9xDuI0sa4dDRR+cDk0nRStsNF0e3RnVhH42sNR oeDos/nseKkue2eSk/BsZojUdKkN9jJlHSYNgznPFOMsPEW6uNpUzLSlcs1ftObBaPsM7s 0QFXaodz7I2Rc4D7H2cwh84JdAjh4eJ5/tfQhz3I6SBz9vg0xR0TLvckTb3fZPD19lnc/K j/ujFwvEIcdI7+7MCiNTYRj1sk75Rwar45iddvwuBUMK3r47v4DSydRHm8pPiwygPN1Bm9 G8Sb6bxqLsR4LBWddIDFeHxZbz96S5yfOfH6CRer4RgqE3ZES7EbpLT6wx0YWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703375958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uYvArKtdx6eRogCkDIEkV0ybyVF6Ga1Q9xXwwQhRyhU=; b=lB58qX4knyenGxA4B5Vuc0mll/W9QFuKYOf1XYSDm10hs1eDztTii10md+MpxSwckzFiEw iLkmUPz5qAAFekib7Vi5N/i5X6APLhsqzSUbAAJmEJTK2MVE9tdp1w/05l1eUvZUCnEPHM KQkrDf02YKUu+RqllOH89pxqAIqY3sOpkRn3d5o1VDihsm8TYR5XLQRSwrUFhLZxV1jGxd rrw9rwCJdkNwtPIFRwDvIUM9UyTqp2zM6W3bYoEtRil5gtbl5GsVQRwk6R5+8y84J7+U6s h5Q49PBTUP8tFSXMebMBu+xgtiEwtwq6NuXajsLKHpSEdlsyoZbDnw8VtVAGBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SyLjx6DyZz1JyM; Sat, 23 Dec 2023 23:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BNNxHAt032197; Sat, 23 Dec 2023 23:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BNNxHvg032194; Sat, 23 Dec 2023 23:59:17 GMT (envelope-from git) Date: Sat, 23 Dec 2023 23:59:17 GMT Message-Id: <202312232359.3BNNxHvg032194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: a74df3f96e3e - main - iicbb: Fix pause_sbt() arguments order List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a74df3f96e3ea4cc632088be870d9b0b0198859c Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=a74df3f96e3ea4cc632088be870d9b0b0198859c commit a74df3f96e3ea4cc632088be870d9b0b0198859c Author: Alexander Motin AuthorDate: 2023-12-23 23:52:17 +0000 Commit: Alexander Motin CommitDate: 2023-12-23 23:58:51 +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 --- 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 3948d5d5a9f6..5d6ac48d4543 100644 --- a/sys/dev/iicbus/iicbb.c +++ b/sys/dev/iicbus/iicbb.c @@ -52,6 +52,7 @@ #include #include #include +#include #ifdef FDT #include @@ -254,11 +255,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();