From nobody Thu Dec 23 08:47:45 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 324A3190D1C4; Thu, 23 Dec 2021 08:47:46 +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 4JKP356cD7z3LkX; Thu, 23 Dec 2021 08:47:45 +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 C4460575E; Thu, 23 Dec 2021 08:47:45 +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 1BN8ljDM011328; Thu, 23 Dec 2021 08:47:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BN8ljKs011327; Thu, 23 Dec 2021 08:47:45 GMT (envelope-from git) Date: Thu, 23 Dec 2021 08:47:45 GMT Message-Id: <202112230847.1BN8ljKs011327@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: 49fcbe98762b - stable/12 - 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 49fcbe98762b7236f1215bd7d989c779e136be9a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640249266; 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=Dtl+y8p6SZmNO8FgXtIqZQoRhn83CA7LdENjvzYfV4g=; b=nUx8SJzR/qz3L7+tKD5mrA0yGAYDJ+Ec9Fkr3AT5Zc+xh1+spgH+Z1xXRbX3QTMnXIXGNu 5HXyiM7enhrvQSBnyiSRGMqbnFRFk5fwLXhZ4i3Jp4gpbtST2PFXuOj6I4VVAvP8tzPEat nbDSLv7/p5+sdbRO6T35sPn1w5hCHSj81LvxeWlBW57wQIzbkNOhmDbmpZJ6xaRpIGB02B 45oUDI2AlIrfI/i8MqP86FKVlv9hqyx062CU1i2BBSvIvwjaRoRZZTxQggqJxK4cZpPkK7 zfbdEFO5+B6jxgqZ0RXbplTkGuQknNKowG5c3EaXDOIyVE5muSGfiT8zYzKkMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640249266; a=rsa-sha256; cv=none; b=HB4nPTimFTeeegDp7Imckk3tV7SssJVITZym5nSseClt6p9bEhhz5lwlr2Key8NkmU4k9u Y45/lE2+NxxU5ZcSRAPa6wFL0jMWHpNNla5YqAiIoWSL5mq1SMbTtJwc1uaCB/9JIaDus6 p6/A17kliHz9KYOUFI6Yt8wgPXbA3GZospcvxSLnO0u64JGBHrHRRBoHPk/VTURzAG3tMe AYSMSJ8F6DiR5/RElC+4PJG/I4PVdCtVc9zP8WUc6Mm0Rsus2daTwdEHZ1au7nkH7SOEaK j5JwKvum/VKl2zMWF1vg5YZSw5kocUqjmiukkdClAgMF694SjkMactcI2DoMJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=49fcbe98762b7236f1215bd7d989c779e136be9a commit 49fcbe98762b7236f1215bd7d989c779e136be9a Author: Andriy Gapon AuthorDate: 2021-12-19 09:26:40 +0000 Commit: Andriy Gapon CommitDate: 2021-12-23 08:47:21 +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: