From nobody Sun Dec 19 10:06:03 2021 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 DFC8B1903ABC; Sun, 19 Dec 2021 10:06:03 +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 4JGyzH3nNXz3pL1; Sun, 19 Dec 2021 10:06:03 +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 5E175207F4; Sun, 19 Dec 2021 10:06:03 +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 1BJA635p000231; Sun, 19 Dec 2021 10:06:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BJA63Qp000230; Sun, 19 Dec 2021 10:06:03 GMT (envelope-from git) Date: Sun, 19 Dec 2021 10:06:03 GMT Message-Id: <202112191006.1BJA63Qp000230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: e5268c3d435e - main - twsi: fix handling of consecuitve write messages in transaction 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: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5268c3d435e0a0f0fef64e6213504dd189272f6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639908363; 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=DqHkCeMvNNERWu3EKE6j3Et0n8cdsul0MzXdb3cW86g=; b=waypgfFcWkp67pwF6UEnfUYIS93V9w23YrkdpZRA/YjI6pVkstatiuBFbw6tyIyC2zTaOb Ir08r11RZUq/GZFuDWY8VzywDOwMF87pj8i1cc1/aLFeoPno+WQxEyBa2Tfj/jcr8CtQ9o gb1cwog7uzvbmCiUnTWVCb/T7d2kBuD6pXVHRlU6d1Melp9iA/uLaDeY4vc/a1nJJugAuJ m0wRTJ43WS3xQI8KSS9Yoy3y0bRxriY0XdjI1JxxZx+72HVafkKINrN+/ZJ0cJ24OIlVEg 5WJcI7KcdjHfHjM1/xE3e+C+HZbvjQH1z1you79cDKBtW/Sy6jAmz7FRdzN/Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639908363; a=rsa-sha256; cv=none; b=Sm0d3iq21YvNUsgXZ/oVUzw7M91iW5qOGC9c8IpErGUsazAOPv66I2fn6ZqeTHU/h84/aI 8/Szoogb4K/ah4bbvUpa9e/UI6NNZFS9bfMfDaJzwB6b8OcPsRVa+qWkSZwybZSeTH1xbO 2/I50j7bU0vOWUM7B4APkpM+keybt9VuPeA8F8Chejib3U4K8Ip7EU89VJBDxetLQ2CQe5 Sn2RiSYB6up+tyUefUo1u7r7daHA5FtbMuDpc/IULGOpMh99GukwjyKfg6djPufCorApLF B9jzfYe+dNSWmc9nzWJkM6V0214O/2M/2xjRf02pxpSNItIDEQh0FfCnYs0HZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=e5268c3d435e0a0f0fef64e6213504dd189272f6 commit e5268c3d435e0a0f0fef64e6213504dd189272f6 Author: Andriy Gapon AuthorDate: 2021-12-19 09:26:40 +0000 Commit: Andriy Gapon CommitDate: 2021-12-19 10:05:52 +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 MFC after: 4 days --- 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: