From nobody Thu Dec 23 08:46:22 2021 X-Original-To: dev-commits-src-branches@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 CB4AF190CB38; Thu, 23 Dec 2021 08:46:22 +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 4JKP1V3fjlz3L69; Thu, 23 Dec 2021 08:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 5D98F5989; Thu, 23 Dec 2021 08:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BN8kMlN011007; Thu, 23 Dec 2021 08:46:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BN8kMF9011006; Thu, 23 Dec 2021 08:46:22 GMT (envelope-from git) Date: Thu, 23 Dec 2021 08:46:22 GMT Message-Id: <202112230846.1BN8kMF9011006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: a520d08538a8 - stable/13 - twsi: fix handling of consecuitve write messages in transaction List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a520d08538a89355c07dc55b4eb16a921340c8d0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640249182; 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=xc8Ojti7A5C9xnlGOSVcmg/yhDsmnFqwRWw739hqGtQ=; b=lL1yuHN0X0l6saEu54YanOnDVYX2uY2j6sUwDaxgqaMnyTTEJ/Dh7v145PSGqV6U8ZtD5u Cxqxza54YIady48zLaCg7hvzB7JCayd5K2krmEFHMBbCZeis7zmlfwXX4VY3JHSEIXVk+6 qm0J31bBf1PD9LKltZkfckbrYkJWhu+NJesgrW6Xjm473qTZGGlbyaNk5J9WgiNu2NQ0uQ rV25vGQLrKBFJ4d7KrjVJx3Ckvj6/JDHgDt6rsZdWHFlIa68nK0vH3cV0Qk3y6dScNVqaK lxnasoj+1jdehUqaFORmL+fmgDxB+yju2ghXQO1HhAcmExv457ZPfqiD+BCI8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640249182; a=rsa-sha256; cv=none; b=jE1jvC7Ha/7r0bNE9egm4T763wEsjwrVZkkn1yPrBRdLLY3NtxbWpZn3IjaGnvTjSY9NL6 UyevFdyQ/N37tk3SElzvMmZLMhPE08uXf1jpt8kMZ56gPGCLdrhZe0CkDc9CEgBMSBhZZm u3lX3IY3d0N6YRD26AeJz7IJpGNMCFXlXCyrmC7pT0gAcUkg4kYoWWYaIu/N3s2H9LkVb4 tM8dUQZDQWOhAJlNTr6XLouEjqgOyYJIoooxu0g4K4fB5XGt2Cgr838ek8kE1BUGAKRUKV J1saUf9/MtQ25qzjO5jZm1bhMkiUmCxyc441Sh7cm0I73UvxEgW527k1V+SxMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=a520d08538a89355c07dc55b4eb16a921340c8d0 commit a520d08538a89355c07dc55b4eb16a921340c8d0 Author: Andriy Gapon AuthorDate: 2021-12-19 09:26:40 +0000 Commit: Andriy Gapon CommitDate: 2021-12-23 08:45:38 +0000 twsi: fix handling of consecuitve write messages in transaction Make sure to reset 'message_done' flag when jumping from a message to the next one within the same interrupt handler call. This happens only when a write with no-stop flag message is followed by a write with no-start flag message. Without this fix the second message would be prematurely "completed" without waiting for an ACK (or NACK) for its first byte and without sending subsequent bytes (if any). Fixes: ff1e8581 twsi: support more message combinations in transfers (cherry picked from commit e5268c3d435e0a0f0fef64e6213504dd189272f6) --- sys/dev/iicbus/twsi/twsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/iicbus/twsi/twsi.c b/sys/dev/iicbus/twsi/twsi.c index ab0bb3f26961..740c7e14a31f 100644 --- a/sys/dev/iicbus/twsi/twsi.c +++ b/sys/dev/iicbus/twsi/twsi.c @@ -563,7 +563,6 @@ twsi_intr(void *arg) bool send_start; sc = arg; - message_done = false; send_start = false; mtx_lock(&sc->mutex); @@ -582,6 +581,8 @@ twsi_intr(void *arg) } restart: + message_done = false; + switch (status) { case TWSI_STATUS_START: case TWSI_STATUS_RPTD_START: