From nobody Fri Jan 19 17:09:51 2024 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 4TGmM42Gq3z56wj2; Fri, 19 Jan 2024 17:09:52 +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 4TGmM40LGYz4K5b; Fri, 19 Jan 2024 17:09:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684192; 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=xf0y8h2xUhP+fWDdJFgAtev6Ix/SS89C78331bYWxRI=; b=Em3TbxHIBLIxS+pvt8Oz/0K7NvSdNmDpv5a9eWqWR/GjJyszB+iXVW+D9OxLjGCeeBgbY+ fHEQ3HRQFAV0fqWL1S1TQkci2Ijb1myLG2SzyyraoL8N3UjtPVk2dOBftS/6SmOuhZAZgC RuQej1n1mfN3doWbm8tuR4SQLyj98zNVMNcg5nMVWA3n4LmQTxNA+4ul3vvzKIAwUnLBLw jWJ7PcImzSgjzqZQBBNB+LOZxuQ6BQkZqlU5y39aVG1WJxMSZb7sXhT1RFvb0wNFCmaJzA 0qDpOzlTBOTcxLnbiTpClV7XKHEN/y/2mpfXn2ffRwqqILZON/or/hJscAJE7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684192; 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=xf0y8h2xUhP+fWDdJFgAtev6Ix/SS89C78331bYWxRI=; b=MJ/nQl3FcGsXbijKB+qvCPLagOkuYKz+I8Owqfj5k6UQOtumkTD7m/np8uqZURA41hhbmW jV33V4siYE/3qZVDdqRkmF2QNupyyaEn7GvzO8dFCoA9HyutcmabLnVyU4s7K9zJ7gViJS J9TMYv62LDYYc3GWNaKEncnk9q9tVc3dIS2pQvj/iNSwP0IowJpvaq+XVquoe5vxGwEqoJ k92shMPFtzuRH6hCKK8hijeE3CPcdzY7tc0Nl3vA1q9ioBuEdXm6UzxQbhnxeN/9sxocZX 6NixzF5EWx/REN/wnwc05X+pgVDuEw9mWihYKOB1wd2c77UMmNpz1OGJmQIOuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705684192; a=rsa-sha256; cv=none; b=I1g1WCaEhQ/2UviLpR6HKsCX5FRYObgjgxOHS5RSWvLS1CU4NQm87fV+axRwyvqjSmKsfZ W7pePJl4ENyNfUhNxvCa/LewjijRrzB1QbvNTEotZ7focctFdPoHyeqTUQwntwafsc8Hpc J2UMTPy3/OitTMFUHBOaF53+zMJ0HskkGQY3SLh/Ykmp+3mn214G836dhGoVNWJcGUd4bq VqvpBB3aqCg7EGnmGqmQwp7m+mvvFsaYx5oh483n4xQiABGYFLa3OAqOrsyH7tPubYj52E rbepI1Om6Nx+39KB+mpJo8z/i+o+S2I83jyvnSHhQ1E8Rm3zlBSxwje2l77naQ== 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 4TGmM36ZF1z10bL; Fri, 19 Jan 2024 17:09:51 +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 40JH9p32079624; Fri, 19 Jan 2024 17:09:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JH9pPF079621; Fri, 19 Jan 2024 17:09:51 GMT (envelope-from git) Date: Fri, 19 Jan 2024 17:09:51 GMT Message-Id: <202401191709.40JH9pPF079621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 4061a0e5b273 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4061a0e5b2734c2c466bb7a7917645b913499e49 Auto-Submitted: auto-generated The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=4061a0e5b2734c2c466bb7a7917645b913499e49 commit 4061a0e5b2734c2c466bb7a7917645b913499e49 Author: Alexander Motin AuthorDate: 2023-12-23 23:52:17 +0000 Commit: Alexander Motin 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 #include #include +#include #ifdef FDT #include @@ -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();