From nobody Wed Dec 22 06:51:30 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 E69B618F7B92; Wed, 22 Dec 2021 06:51:32 +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 4JJkWR2RNCz3LK0; Wed, 22 Dec 2021 06:51:31 +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 0870B18A67; Wed, 22 Dec 2021 06:51:31 +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 1BM6pUxW036039; Wed, 22 Dec 2021 06:51:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BM6pUwb036038; Wed, 22 Dec 2021 06:51:30 GMT (envelope-from git) Date: Wed, 22 Dec 2021 06:51:30 GMT Message-Id: <202112220651.1BM6pUwb036038@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: 9a95029ea797 - stable/13 - rk_i2c: do not hide NACK condition from consumers 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/13 X-Git-Reftype: branch X-Git-Commit: 9a95029ea7975d755f02cddef5618a9f7e079694 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640155891; 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=c/i6CJz5HwGPCqoqrFVSHsh5wPSdUScePBB7O5Z2zIA=; b=F5qytNgdNcOBqa/NjMRsc7R6B+4CnDl1fXNcuTyHtmLy+RPKS0TSGv+iVXfYmpY3IiVQuD uY9WwqBws1xfaD1wv5be0i0ADc8ra7stxzqrDJ3IY4J5bRjJDGHkKYMLjKo6ez2ZR2Klgz lOsZBsXih2pR4IJc8ZOTNOfwneHkiTlSRbbTgTpQGI4aV7OSuuvfR7U2w8XzC6leyfXmju GgzCGccq/OhknQUNSXQLXE8qI+zX9j/7jN4YTyntHEkK5YB8LNSO4oGJ0F3lxN1gEt8ooz WELm+/X2OOwKE5QkGfQyZ6lvgv2teoZ94d8zPcmm92X+Cuwy8BvFoI4OKImPig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640155891; a=rsa-sha256; cv=none; b=WxydxV3QgRhC695BpraubnxmO9agc1Y1mhuseDn+SB5Gcapp9HH/9+pbzkmimXxR7N+jAh 7QNK0ArJLQWf7iHzmxNdoNDO/5r1+lD0zieREtyzhUwpk3jRxT9m42Y+vWa7EKhtCVsora uGAvaNjmfVdSoidRt33lAI26YtQL8G4dg9oJC7WOe9IcXfYqif23lCKm3K1HS8fywQIQ/s L2zx3VRprFFBIqmOYSj7sscvOl5w/WbuhLdosygG4/wGuabaY01NnB7WwPiQNgHhsHisP/ oGLVBcdchq9PES4Xo+MVn99Wdmi6PoDD9G9YpZh13zSToCxi5ykEp60rIU5NPw== 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=9a95029ea7975d755f02cddef5618a9f7e079694 commit 9a95029ea7975d755f02cddef5618a9f7e079694 Author: Andriy Gapon AuthorDate: 2021-12-15 08:59:22 +0000 Commit: Andriy Gapon CommitDate: 2021-12-22 06:49:15 +0000 rk_i2c: do not hide NACK condition from consumers Previously the driver would happily talk to addresses with no device returning some garbage for reads and sending bits into the void for writes. (cherry picked from commit 4501b0707198e7ad1da792639a8b164f9380b95d) --- sys/arm64/rockchip/rk_i2c.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c index 171b28a8b617..2be6716af4eb 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -430,6 +430,7 @@ rk_i2c_start_xfer(struct rk_i2c_softc *sc, struct iic_msg *msg, boolean_t last) RK_I2C_IEN_NAKRCVIEN); } } + reg |= RK_I2C_CON_NAKSTOP; reg |= sc->mode << RK_I2C_CON_MODE_SHIFT; reg |= RK_I2C_CON_EN; RK_I2C_WRITE(sc, RK_I2C_CON, reg); @@ -549,6 +550,9 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) sc->busy = 0; + if (sc->nak_recv) + err = IIC_ENOACK; + RK_I2C_UNLOCK(sc); return (err); }