From nobody Wed Dec 15 11:16: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 119AD18E9B99; Wed, 15 Dec 2021 11:16:47 +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 4JDXkj72D7z4qrT; Wed, 15 Dec 2021 11:16: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 64F041B175; Wed, 15 Dec 2021 11:16: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 1BFBGjsZ081702; Wed, 15 Dec 2021 11:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BFBGj68081701; Wed, 15 Dec 2021 11:16:45 GMT (envelope-from git) Date: Wed, 15 Dec 2021 11:16:45 GMT Message-Id: <202112151116.1BFBGj68081701@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: 4501b0707198 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 4501b0707198e7ad1da792639a8b164f9380b95d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639567006; 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=4yV4vceeJ9FWc8kcGMHcCYPByruZYXLBOBb1vOstMr8=; b=A3CRVtlwHe37rp98/8S+FqV02E/kBKo8u9QrY4lPgy+AraeK/YIfEBVG9tzB8RptmBnJII v+JiZASFgzHnRVpXBd+hYJcq1f4YEFTEYnFX979B9jKp2/cPaLux0yhRzP/QgNMOGKaB3/ sEs70L3ZCTOVK5wrLWd6w3RP3tVTvEqdckUDURzo0H+SyXHvi7bxaSASIaIRXNiGwaWwa1 YlzdVGS6Ax/DYOc02dVYgulylI38eJs8r7SeJ66GKP2jpYpWeWhmkuOMmHotbnQtJ4YctQ jCZZ83VrXRkvFBNYCuIIzd5qJBeYebHyGi2jw24yZIYkSLSNS1lu73GdBYducA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639567006; a=rsa-sha256; cv=none; b=RiG1h6+bX9lo7Ju6q35sYCjV6gE27Fh2qs2XjcVx6A/kVcLeHN0NYSK/qUsO3EdPS4tgq2 oiufgn9K7Ja4WodaHXwW9/qgqNZjYvX4mn7sf9sjX7TB2peC9JumywJSA0E15P9OR+U0ao j5jjXfixRvZZ9q1fhJF3OCQAGSj1lWhf4yO12inI8PLz1XvKwpGock36Bk8j5/WNwXM5LQ S5DYSAwxBwctw9DOqnknGLVjNC/+DYWr3GOQ8e0MKPyc76+YbSFpcPBfZ8EJs8LJRXzRr/ r2diXtipU1P0tjsmwUcCt/EheMZ9s0bs6u+BkZD1pSFU+9MiJjbgUfyER1m0RA== 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=4501b0707198e7ad1da792639a8b164f9380b95d commit 4501b0707198e7ad1da792639a8b164f9380b95d Author: Andriy Gapon AuthorDate: 2021-12-15 08:59:22 +0000 Commit: Andriy Gapon CommitDate: 2021-12-15 11:16:04 +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. MFC after: 1 week --- 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 9db6d8739bbd..ef41044e65cb 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -453,6 +453,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); @@ -572,6 +573,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); }