From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09F93C433DF for ; Tue, 25 Aug 2020 13:25:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C826120639 for ; Tue, 25 Aug 2020 13:25:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mDDw6x2t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C826120639 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=the-dreams.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PZwxy1C/i0ql5hRcZLhNn/KKI1njj2BLEDCKVdf7zHk=; b=mDDw6x2t0e5a1Fi9YUmX1qkuX rNg+0lV6GwNDVvaEhTSTSSl4z9P1bAUbvgURoM5IY/85cTwKRKIs/SPlBUHc5MHqf/YnanxJSTmrx 7aq6dsjhbiCVwNQNYxmE1aS42CD+6xBPuQXK2CgZaygvue9ztpPeV2FBpRSsf0thXW3ayqBtCgkmp p/pE1rNVyQN/8qD7qwu0ErYjY9CAbcVGw4g0J5kuK5i/7cpHsOl0CcqWOe+BO7qtiUDeY7PyIn7Mm 86dSFVX6P3hNpKSnmHLFU0MR+dtiK9AnQ3Hec/QVsbjE4/YZFfhM+LGNgzDoc1re3v6zmbMrwlVRv rVnHi1QEQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAYwC-0000Me-KF; Tue, 25 Aug 2020 13:24:32 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAYwA-0000M4-K1 for linux-arm-kernel@lists.infradead.org; Tue, 25 Aug 2020 13:24:31 +0000 Received: from localhost (p54b33ab6.dip0.t-ipconnect.de [84.179.58.182]) by pokefinder.org (Postfix) with ESMTPSA id C875F2C04D5; Tue, 25 Aug 2020 15:24:29 +0200 (CEST) Date: Tue, 25 Aug 2020 15:24:27 +0200 From: Wolfram Sang To: Jaakko Laine Subject: Re: [PATCH v2 2/2] i2c: xiic: Support forcing single-master in DT Message-ID: <20200825132427.GB991@kunai> Mail-Followup-To: Wolfram Sang , Jaakko Laine , shubhrajyoti.datta@gmail.com, linux-i2c@vger.kernel.org, michal.simek@xilinx.com, linux-arm-kernel@lists.infradead.org References: <20200820100241.96866-1-ext-jaakko.laine@vaisala.com> <20200820100241.96866-3-ext-jaakko.laine@vaisala.com> MIME-Version: 1.0 In-Reply-To: <20200820100241.96866-3-ext-jaakko.laine@vaisala.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200825_092430_916883_E84CB202 X-CRM114-Status: GOOD ( 18.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: michal.simek@xilinx.com, shubhrajyoti.datta@gmail.com, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org Content-Type: multipart/mixed; boundary="===============8474408185904901874==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============8474408185904901874== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MfFXiAuoTsnnDAfZ" Content-Disposition: inline --MfFXiAuoTsnnDAfZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 20, 2020 at 01:02:41PM +0300, Jaakko Laine wrote: > I2C master operating in multimaster mode can get stuck > indefinitely if I2C start is detected on bus, but no master > has a transaction going. >=20 > This is a weakness in I2C standard, which defines no way > to recover, since all masters are indefinitely disallowed > from interrupting the currently operating master. A start > condition can be created for example by an electromagnetic > discharge applied near physical I2C lines. Or a already > operating master could get reset immediately after sending > a start. >=20 > If it is known during device tree creation that only a single > I2C master will be present on the bus, this deadlock of the > I2C bus could be avoided in the driver by ignoring the > bus_is_busy register of the xiic, since bus can never be > reserved by any other master. You could even initiate a recovery procedure if it is a device pulling SDA low. > This patch adds this support for detecting single-master flag > in device tree and when provided, improves I2C reliability by > ignoring the therefore unnecessary xiic bus_is_busy register. >=20 > Error can be reproduced by pulling I2C SDA -line temporarily low > by shorting it to ground, while linux I2C master is operating on > it using the xiic driver. The application using the bus will > start receiving linux error code 16: "Device or resource busy" > indefinitely: >=20 > kernel: pca953x 0-0020: failed writing register > app: Error writing file, error: 16 >=20 > With multi-master disabled device will instead receive error > code 5: "I/O error" while SDA is grounded, but recover normal > operation once short is removed. >=20 > kernel: pca953x 0-0020: failed reading register > app: Error reading file, error: 5 >=20 > Signed-off-by: Jaakko Laine Again, looks good to me and matches what we discussed and prepared. Let's see what Michal et al. think. Happy hacking! --MfFXiAuoTsnnDAfZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl9FEQsACgkQFA3kzBSg KbblAxAAtkD1CjaP62bB9CyfxhUsBDN7XLAYpQCAgxh3K+EFaoGzk8eUYOqyX+h6 Yis6cnrrNEK5I817zwq4Jd50BfVYOpCmlfwEWbSIk2a4v9XHJszS86V1vFofwrRw Mqc56uGfJ+laG/WbyrpdcjZ5Ia4vl1vW38Oljj6hILRYKJ7WIQwdOjxbOy8+y3Ei QfdWzmVP/goQ1TxdCkOsyQLgiKdCpkQMilUi//t1yGczRFb1aKzTwrT79sYaYkvJ qBiu7qmRXhidbrza35PR4StYqaPlBz7jbdE9wkKSYvVPdk1/DGEJGBsnRaH5o6RJ pZOwK0ZYI7+LTGF6DW/36jCphrA+2BSDTfeEIEKtHi7ZlSzrka3IwqkbGiM8pyjr g1u7l63aOkteJcnvRF1wDRswp5Dwf7iCHyQmZiGsr7iW/C2yt+a1r/J3XrDseOCE u8tCXdo6kNjmI+e5A6WQUwWf2TUCnQJkQK50yH8FDqBShI2xFunS3Vwl2/O2LXi+ fNFQaUosKXuokYurEl982NS289jk3VWqbdM7e7aaEklfiPdDNsKZrWmcjtNrtr2G 2V0ZZRJD2W7GJrIMnvuPTL/W73E+gTzVKZvmYatZd8xjwHEj0yYSGvUYT0yzfI9h VJWCGMNr4S23AoI7zWISJJv2jdjEjYWp8S5/VNoXiKXOmNuvYvE= =Vwd4 -----END PGP SIGNATURE----- --MfFXiAuoTsnnDAfZ-- --===============8474408185904901874== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============8474408185904901874==--