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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 22C70C433E1 for ; Wed, 26 Aug 2020 12:06:32 +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 D72D420786 for ; Wed, 26 Aug 2020 12:06:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nr4T0xO4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D72D420786 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=Thg6DZV7JDYutPLEUFkoY/Y5LQE9OwMsmrTM/nMW1NY=; b=nr4T0xO4X4usV5ip/KVfn1Coy sLaxYxCmYF9O+TGc5w2k5RXZFhXYKnYXb8rDbmf/7qf+sviuU5NTSrZm1T2ULuSrjd4WSSaykp6bn ckajdKoVw+vbrqtsyEL8b8m51IvcnfsfIs8bFtHiJExm+b1TJLYKXO/ATPqPolhibPE4uZU/JQRUK Ugdx5pWSAl+GkxChj1UkXrS0pv/nyKoaeLc8sYhB9Zc8khPeStGeb6WtbGsE3ydhTevFFG8FnSVJP aqaJBQDgmfxui4Tucd21orCeRhtEmTWr03p/dl/iIUWiK4+dbvKO+wSuLG9BtCmen3e1rAOssNmqF gobk4aL3g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAuAz-00044i-ML; Wed, 26 Aug 2020 12:05:13 +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 1kAuAv-00043b-VF for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2020 12:05:11 +0000 Received: from localhost (p54b33436.dip0.t-ipconnect.de [84.179.52.54]) by pokefinder.org (Postfix) with ESMTPSA id 097D02C0829; Wed, 26 Aug 2020 14:05:08 +0200 (CEST) Date: Wed, 26 Aug 2020 14:05:06 +0200 From: Wolfram Sang To: Laine Jaakko EXT Subject: Re: [PATCH v2 2/2] i2c: xiic: Support forcing single-master in DT Message-ID: <20200826120506.GD1081@ninjato> References: <20200820100241.96866-1-ext-jaakko.laine@vaisala.com> <20200820100241.96866-3-ext-jaakko.laine@vaisala.com> <20200825132427.GB991@kunai> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200826_080510_156742_6B0A9987 X-CRM114-Status: GOOD ( 23.07 ) 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="===============2003643411722327066==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2003643411722327066== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EP0wieDxd4TSJjHq" Content-Disposition: inline --EP0wieDxd4TSJjHq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Jaako, > > You could even initiate a recovery procedure if it is a device pulling > > SDA low. >=20 > In the case we actually observed xiic got permanently stuck, when I2C bus > was temporarily and indirectly affected by external voltage pulse. This c= an > happen in single-master or multi-master bus. It does seem that no extra > recovery behavior is needed in this case. If we are able to determine tha= t bus > is not actually busy, we can start using it. Indicating that bus is singl= e-master > was a handy way to determine that. This issue was bad for us because > even if SDA was not grounded anymore, bus was still indicated to be busy = by > FPGA register and driver would not continue. Okay, it was just a suggestion, definately not something I will require to be added in this patch. Your reasoning makes sense to me. > In multi-master case you would need some kind of timeout after which bus > bus_is_busy is ignored and recovery attempted. This is ugly since it woul= d be > a non-standard behavior and intrusive to other masters on bus. Yes, this is an issue. My best bet is to use the adapter->timeout value for that because it is configurable and already used as kind-of I2C timeout otherwise as well. > In single-master case, if some slave device on bus would spontaneously > pull SDA to ground when clock line is not pulsed, bus_is_busy could be tr= iggered. > In this case we could attempt some kind of recovery behavior. I guess thi= s often > means attempting to pulse the clock line to get the slave to release SDA. Yes, as defined in the I2C specification even. > In my knowledge pulsing the clock line can help if slave device on bus ha= s missed > some clock signal edges (or is answering with more bits than expected for= some reason) > and is holding SDA down in an attempt to communicate a data bit to i2c -m= aster. > Extra pulses in clock line can then allow the slave to finish transmissio= n and stop > pulling SDA low. I however doubt that this type of recovery would be like= ly to help > if I2C -slave spontaneously pulls SDA low. This would however be a very b= adly > misbehaving slave -device, so it=C2=B4s hard to speculate what it will do= and what specific > recovery might help. As the above standard says, you can try sending pulses but if that does not help, then you should reset the device. In my experience, most I2C devices are not wired to be reset externally, so we have the pulse toggling mechanism in the I2C core to try as much as we can. > There is too much speculation for me to attempt or test bus recovery in t= his case, > so I would leave it out of this change. If somebody notices and is able t= o test a case, > where some specific extra recovery would be helpful, I would suggest to c= onsidered it > later. Totally fine with me. Thanks, Wolfram --EP0wieDxd4TSJjHq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl9GT+4ACgkQFA3kzBSg KbbKZw//bKBriwc2/Kz/3AFpHgyzYwpqULiOY/gfwsg3y9BgL+XAxzL+jOGPIH5u Zfgkz0A03bNbnmPaIfqPOPgr58tRDb+1fbZeGOrVUHZv2bcOBYzzg62MbHwENm3F jaUYgxOcOgpQ7rfmHM4AZ99eZU92/VDZE/doe+T51VV/7okl/nfoGR+8O9U38RgD rA4B7IzzOW55LQnqs0wYI6fZR7CoHO9Nogd3Cp8E0vam2nze7vHjRGweNDmzwBzy 8Cheg8hUWL3cUdaHH7JHD4wgI7wA5JvgD44U+aEJfV4WR4SL7Q89L1a3iekVbnL/ QOI8Ie5Ik1h4xOQW90PaaUGBM0+BDuNDJqRXIURh1QhjonOYfrNsdeNcPNJ9zINO NNMDe0CPnNvlUclqed8JW4RR8zjjSTzJBqT+6qYi10EC7BYtj5E9vf6hOQG4aEu9 XFHQHJBcHgHKC3mmQvczUDw1xl92gAXJXWkzTJTZlfoeEP6kOa6xs/VvT2O+ghgs UJZlFZYMNzU+ZFOGcu+crMn7RujjkOjfBGgV/Km3weJGGJ1zmR3pwGq6OEsD47Zl lSWykEOT2ImiS6Xj2ccIhMOUAWwn77FG7Ni0CJfctk6nLF6lEuEaKrxCTVexHCNC t2GEwqLQUPpXCDOZNrWmItGC4Pwry3SmLeCTW64NtGyVhHYFiSA= =Fc1T -----END PGP SIGNATURE----- --EP0wieDxd4TSJjHq-- --===============2003643411722327066== 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 --===============2003643411722327066==--