Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4028722ybg; Fri, 25 Oct 2019 12:18:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaB+D08df4vfyRSi3r0DLXf4Z8BdNYUuh+txOwOHGW/9pWOYYpXHC0Dg2S0MEDtQVbwBkU X-Received: by 2002:a05:6402:b17:: with SMTP id bm23mr5733422edb.6.1572031082257; Fri, 25 Oct 2019 12:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572031082; cv=none; d=google.com; s=arc-20160816; b=mYJFM9HNm4QguSpFY/iIeWv6gLzF2gc6W3C1J1RG3eJzAa6LiohDCD/mJgOhhq6yBO yEI3i62+L/yW+qGALSaD1QTfpy14O5tS4Z/2U22cCU7mP12mN4YBvtf3lG/hvAGX5XaT c9sUB443xibpxOH2xmYlHbTY7vM7Opy0wxAynWyN8Vh8GfYckpthP8UW9n4eBf3CzsCq 53G327Ccjmz6KXvdm9KLyBG/5PrXOQhU7n0u2SBSA+igLnGUVUL79ZN0gw3+/A431GhC M6JaikmKtQBbw5kxHhnBjoXk2/dzN8mcdnd5Cy69I5b8W1AoB45dbY3mQgb//FdCQkH0 wLsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1YF5pXJtPrUF0Y8xPynfXz8x5LE5XtgORc3B9bxIA0o=; b=x54YhMt6uQDl/BjiSPwEGNsfKASjWp4bCNMUjcnUUmuNjxPpMOe0nVAPA2kQbh/f5A nwUvg+nSgoDqUtIu5L55ZIitfdINyjQLqynQnU7a3tkgVCjySYKpaMH2dYplC373gDq0 V4r6Hlzsqz5PAn8biAcILNH/9Z5PDOL9k7bgMK2nDvzc3eKbY/eVgKJ4Au79V7S7+U/i flxkDz2f6ZWJOS99CaI4KmrzqpZZKsStPV7wJUNfjHePPpNy4yHwyKoEi+X44ezuYdBj 2Bz0l/w+1NfXJ1Gm3dfVLtEvrwyjaggkvgCm4FJeziQ9m/D+76EO9V40Ee/+9iYRdUcI cWcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si2103595edk.16.2019.10.25.12.17.39; Fri, 25 Oct 2019 12:18:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388427AbfJYBOQ (ORCPT + 99 others); Thu, 24 Oct 2019 21:14:16 -0400 Received: from anchovy1.45ru.net.au ([203.30.46.145]:53341 "EHLO anchovy1.45ru.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388026AbfJYBOQ (ORCPT ); Thu, 24 Oct 2019 21:14:16 -0400 Received: (qmail 17092 invoked by uid 5089); 25 Oct 2019 01:14:13 -0000 Received: by simscan 1.2.0 ppid: 16948, pid: 16950, t: 0.0537s scanners: regex: 1.2.0 attach: 1.2.0 clamav: 0.88.3/m:40/d:1950 Received: from unknown (HELO ?192.168.0.128?) (preid@electromag.com.au@203.59.235.95) by anchovy1.45ru.net.au with ESMTPA; 25 Oct 2019 01:14:13 -0000 Subject: Re: [PATCH 2/4] i2c: at91: implement i2c bus recovery To: Wolfram Sang , Codrin.Ciubotariu@microchip.com Cc: kamel.bouhara@bootlin.com, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas.Ferre@microchip.com, alexandre.belloni@bootlin.com, Ludovic.Desroches@microchip.com, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com References: <20191002144658.7718-1-kamel.bouhara@bootlin.com> <20191002144658.7718-3-kamel.bouhara@bootlin.com> <20191021202044.GB3607@kunai> <724d3470-0561-1b3f-c826-bc16c74a8c0a@bootlin.com> <1e70ae35-052b-67cc-27c4-1077c211efd0@microchip.com> <20191024150726.GA1120@kunai> From: Phil Reid Message-ID: <65d83bb0-9a0c-c6e2-1c58-cb421c69816c@electromag.com.au> Date: Fri, 25 Oct 2019 09:14:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191024150726.GA1120@kunai> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-AU Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/10/2019 23:07, Wolfram Sang wrote: > >> So at the beginning of a new transfer, we should check if SDA (or SCL?) >> is low and, if it's true, only then we should try recover the bus. > > Yes, this is the proper time to do it. Remember, I2C does not define a > timeout. > FYI: Just a single poll at the start of the transfer, for it being low, will cause problems with multi-master buses. Bus recovery should be attempted after a timeout when trying to communicate, even thou i2c doesn't define a timeout. I'm trying to fix the designware drivers handling of this at the moment. -- Regards Phil Reid