From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grygorii Strashko Subject: Re: [PATCH v2] i2c: omap: Trigger bus recovery in lockup case Date: Thu, 5 Oct 2017 07:30:43 -0500 Message-ID: References: <1507110225-3050-1-git-send-email-claudio.foellmi@ergon.ch> <4aa7db09-f9b5-3140-24e7-179e8933e832@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from lelnx194.ext.ti.com ([198.47.27.80]:47528 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbdJEMbJ (ORCPT ); Thu, 5 Oct 2017 08:31:09 -0400 In-Reply-To: <4aa7db09-f9b5-3140-24e7-179e8933e832@ti.com> Content-Language: en-US Sender: linux-i2c-owner@vger.kernel.org List-Id: linux-i2c@vger.kernel.org To: Vignesh R , Claudio Foellmi , Tony Lindgren Cc: "Nori, Sekhar" , "Cooper Jr., Franklin" , Aaro Koskinen , Wolfram Sang , Sebastian Reichel , linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org On 10/05/2017 01:01 AM, Vignesh R wrote: > Hi, > > On Wednesday 04 October 2017 03:13 PM, Claudio Foellmi wrote: >> A very conservative check for bus activity (to prevent interference >> in multimaster setups) prevented the bus recovery methods from being >> triggered in the case that SDA or SCL was stuck low. >> This defeats the purpose of the recovery mechanism, which was introduced >> for exactly this situation (a slave device keeping SDA pulled down). >> >> Also added a check to make sure SDA is low before attempting recovery. >> If SDA is not stuck low, recovery will not help, so we can skip it. >> >> Note that bus lockups can persist across reboots. The only other options >> are to reset or power cycle the offending slave device, and many i2c >> slaves do not even have a reset pin. >> >> If we see that one of the lines is low for the entire timeout duration, >> we can actually be sure that there is no other master driving the bus. >> It is therefore save for us to attempt a bus recovery. >> >> Signed-off-by: Claudio Foellmi >> Cc: Grygorii Strashko >> Cc: Vignesh R >> --- >> Changes since v1: >> Added a check before all bus recoveries, to make sure SDA actually is >> low. This should prevent most unnecessary attempts, which are not >> without risk. >> > > Thanks for the patch! This fixes my case. I no longer see recovery > attempt or IRQ flood: > Tested-by: Vignesh R Reviewed-by: Grygorii Strashko -- regards, -grygorii