From nobody Fri Jan 19 16:37:46 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 4TGlf31lM8z56rd6; Fri, 19 Jan 2024 16:37:47 +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 4TGlf26rkNz466k; Fri, 19 Jan 2024 16:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705682267; 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=dbVhrgUCaTVRhO29+AxdL3T/WnNPhh1zhBvBVsp0uP8=; b=TbJc2mv4Kth0loEGj1gXCrDvwBBgWv04E4hOQlP9riYxXTxekNYhs0gWHn46NUh32aBsj0 R+6PGizkCClOZkby8ADHtdC9HTLIOcS8RSc5jz0NMqtR6OmD+xloBXLrPvsn0VENxYdts4 SGREgAbagpCdbeSNLrMxvuWunnjG6D+d3w50klfJ+kpnyJIsnZF3BGXmD6/8T2SzT/qnPf WqKqZHAgeW40poT/Gz3oZj+r6va/cgIiv4uhHQjayC6crDUFXRj/Set7nLUlvyBDUO+2G+ TiE9b9TqcbYDHNVNszyEkc/BCH8qqimY9SYdl+654qj1juQAEFx5QfP3D+8+mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705682267; 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=dbVhrgUCaTVRhO29+AxdL3T/WnNPhh1zhBvBVsp0uP8=; b=kMYOQWRmuYlszL8xxF5CFOkUQQw6M0BXxcQ/+lwS3blgqOY7LgVoPzL71+t/b+jwH1SZJ6 8np6SdXswTt1h5TmfxaJ8jCCWi/tRYPJ5381QR+LNjWKV4FJ9wIFPVaRvGQu1xDZzBwE7D 1KrAGJjkvmRYBmMtBro0ykPEjxlkWymuH2sGKQjekb72971imEzEz1F63a7poKzUOplDxM 3PN9GtUnStyChJs66oHgbipmYUVZUMSzX3UJxT7XLNF2HFuLdRNTysyZ48YaW8fBj7hbHs rjvRs5MzEgqO8LFGBypgw/DjPvgC5YZpUbcYcuKjkrPTrKF5J4zMHQW3itFMwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705682267; a=rsa-sha256; cv=none; b=aygla+lFBx0UIu3ywv12EF0tbZFm0V82zDblJ4XdOQyAer6MFAeWLsh+ERCfmFy0wB/+nK F4hXau38d/PLuu+4s1LbgZk2iqwMR1kU9SxlUyCilcXYAhXRwicpZKNMcnQJ9DFCyFxJK8 gIRKhrhGyAv7rYI425toANFTd84w5UZKg3fdqZO7PPUeKKfhk9r6w5cGvkcdZA0kYCR1k5 2p/O94mfDtjGlbCGkD0wslwn7OKSuglRftZIJ+eG7CmX3zkOGn2qSo08yqcBzjLbgGC2dN /k5XgyOZCQLQwnhacpGuORVA19mo1J5gK2qBgQTnUYV/++L46w76w3atYbrZVA== 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 4TGlf25xTqzymN; Fri, 19 Jan 2024 16:37:46 +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 40JGbklA026941; Fri, 19 Jan 2024 16:37:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JGbkNS026938; Fri, 19 Jan 2024 16:37:46 GMT (envelope-from git) Date: Fri, 19 Jan 2024 16:37:46 GMT Message-Id: <202401191637.40JGbkNS026938@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: 354ccf64bf5c - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 354ccf64bf5c5cc2d3276575f6f5537864dc3af8 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=354ccf64bf5c5cc2d3276575f6f5537864dc3af8 commit 354ccf64bf5c5cc2d3276575f6f5537864dc3af8 Author: Alexander Motin AuthorDate: 2023-12-23 23:52:17 +0000 Commit: Alexander Motin CommitDate: 2024-01-19 16:34:58 +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 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();