From nobody Wed Dec 22 06:59:21 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 1B5C518FA980; Wed, 22 Dec 2021 06:59:23 +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 4JJkhT3tfWz3PDg; Wed, 22 Dec 2021 06:59:21 +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 4758418B4C; Wed, 22 Dec 2021 06:59:21 +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 1BM6xLAS036935; Wed, 22 Dec 2021 06:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BM6xL9h036934; Wed, 22 Dec 2021 06:59:21 GMT (envelope-from git) Date: Wed, 22 Dec 2021 06:59:21 GMT Message-Id: <202112220659.1BM6xL9h036934@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: 99f6b0e44073 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 99f6b0e44073656dbc6ea78f4522590843150777 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640156361; 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=vTk5REimMdt8VswXSkuR6lehV3ALFRGaqF8E+0OQlz0=; b=IkYvV3tO0eUiOrEVAs3XAgdgWfbmT+UnlxrCYuKfbk9rxCts+bmkR05C5on60bmfDVYYKG zZAx8sywzpUNvgxqMvTTxs4IsuNLMuYrFPTVpeYEJkRBv0k7bKlJxAKDWlhvTYdhHGxAbI NSV4ibtfD0UR5GQYUWs87o7l/R7JeGCiyRfd/hB8Go20Xer1JZUf8TORIdqoS4fWvF1xzv lg9i6eWQxZOHdpxYX1OCO6Xnt6Zwhl/ObsLJix5UM27cJZjdO8jSUYmih/39eM4bDJqb1g NA+P+kuNL4V5ImEdO4iA1oRLSidhQE7WteDCSbOFhhwgcXa+3aqarU25kC1zgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640156361; a=rsa-sha256; cv=none; b=idkxlt0LPr+1Bl/Ln0tW7misNzkP4327Ocrf2tP4gp1ArOmdjIdMF2hRqfvm31HYE2vQ+I eP+Rsdpf8KTTbMepEFFyQKHfMKw7R+QjHjztgi8lkuwXPr671TRJq6rlIkqpu+W66W0vHS pHGzEuT2/3Ha8F2jfk+qBY3uRuKU0uGBIS5y5X5DDEWkJOfw1XrrXgZf7ZDe3joWiPEwml BVt4dlqbYUuxKuJsP2730AIeQoo3ZYPwKcp25+7neVePMWq3zUd8heBltL9GA/bPRP17X3 MlecjE84+DWtM5C41XCHHnL6mz8Q7H9RTDemt2d/ZIrxBu4FaNlYBCLXVxl11w== 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=99f6b0e44073656dbc6ea78f4522590843150777 commit 99f6b0e44073656dbc6ea78f4522590843150777 Author: Andriy Gapon AuthorDate: 2021-12-15 08:59:22 +0000 Commit: Andriy Gapon CommitDate: 2021-12-22 06:57:18 +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 078f0be52ec0..9158eb8222eb 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -432,6 +432,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); @@ -551,6 +552,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); }