Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4326177imw; Tue, 12 Jul 2022 06:11:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uGojg+PMQaXLxZ5gOnQhYsA6TXrsXsNWc/Bds67aeS8G0HJ/vgG98yGQH/klzhA3S1rMaD X-Received: by 2002:a05:6402:294f:b0:43a:ba61:18ed with SMTP id ed15-20020a056402294f00b0043aba6118edmr26083185edb.180.1657631466292; Tue, 12 Jul 2022 06:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657631466; cv=none; d=google.com; s=arc-20160816; b=eroDD4nQWVinGYfNK8xIUb+WIRHHENWP/hoV6rf8On0b6ToF/FDI90y0ef1w8d4kDA QT39+6Ngu62W586tM+cNVl/XLDWIxqYa9DeUaJVG4Aq94fWDXfIp8natBmoz6AR1j+oq f3p+O10kZ9or0TDaqwMNBIF9rvm74DJgZdLAURB8k7sd1sVNaYmFlgO3UD2SEYV/EhxV Yq0eDjW1zZnDq8NuXwg4ZWcpb3cQ4OxSWgXN9Bd6ZuDo/lWz9u5YoyFZwgzMIj+0x07L lSXNgViLlMl0xiWUglsqaBDs4wB7Lxf5DJKvnhBLW9y+45qNLpBunoEux14p5Z+EJiOC JC7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=bFqAUHvCNil2GwtVi5nZ+Zs7y692eEpGx+Iozq3zJCk=; b=l0EAvpNg8SZ/cUkMbG6nrB5bPcrJnjRyuv2oaK//LTfffg0i2L6avm0G4ct6Jv1gP8 xKnbn0mZecLeL7m+67vrEGrYufIIJKxg6A1sFA87GAik+3IEZSGl6C5sbLiF9IQ4qMnR ph/oA/ykBX6dIEC3kVIx0n+DCQVEFJ0LjaqM2f8v5fQdzC1tfpKhOa+iGBky+w+Hm7zc erMq+B/x+pPnM0jssfKJTzGdbY+HZqeC3cJ3DXpd/RY92BnACvAidGKipc8aHTC9wVSS sxwntsgyV2zEUPFXjB9ydVuxgkBKXVy0WktXYvJ7QGrU4bkinwyYorxjyQ8uNGaqf47h xBzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B+u2WqNB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js9-20020a17090797c900b0072b67a788a3si6794233ejc.381.2022.07.12.06.10.39; Tue, 12 Jul 2022 06:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B+u2WqNB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230269AbiGLMw3 (ORCPT + 99 others); Tue, 12 Jul 2022 08:52:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233310AbiGLMwY (ORCPT ); Tue, 12 Jul 2022 08:52:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5213AB3D5C; Tue, 12 Jul 2022 05:52:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EFFFC61707; Tue, 12 Jul 2022 12:52:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 529D0C341CA; Tue, 12 Jul 2022 12:52:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657630343; bh=CZjOFtcsRU4tBiWJ7CtJh3EtYkC4QzT0yP++sYR6tgo=; h=Date:Subject:From:To:References:In-Reply-To:From; b=B+u2WqNBosq/zXqBeLc8uz7K0IPDAxthTXWNWQVyYcaihM3D2c5qpKBv94OnUNiIH wIQ9z2zWl52Yo8TXjwmzdfbI0xqCl/b89BOea7x4rO4OKdZDFZkCk29zSgj+LwpKZZ pU+sAWKbraC+jSNwTgtBkhoU9/3U41wTyh63Yeh5WFLLlr2YsqEhj64iYOLzrOzblJ MWhSCrRbcybF4UKInRZyfTIOGeJTXJ9VQSDdXOgeGMRXgWnP5O6JtKC0tJWvpPd1ui kcGFI9KZiFYp37t7tYlQbSSD2PbUmsDn/NKEDCDH10P8w1JNV30SLR9NIoxUJqfYTi pVDhZMeM3r36A== Message-ID: <124806c0-4189-0280-ce9a-80cafb238c7d@kernel.org> Date: Tue, 12 Jul 2022 07:52:12 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCHv6 1/2] i2c: designware: introduce a custom scl recovery for SoCFPGA platforms Content-Language: en-US From: Dinh Nguyen To: Wolfram Sang , jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, robh+dt@kernel.org, krzk+dt@kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, christopher.hatch@intel.com References: <20220620230109.986298-1-dinguyen@kernel.org> <928b2996-b2e7-d847-0e20-7e19df3cbf03@kernel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/12/22 07:41, Dinh Nguyen wrote: > Hi Wolfram, > > On 6/22/22 15:07, Wolfram Sang wrote: >> >>>  From the original code, the first mechanism to a recovery is to >>> acquire a >>> GPIO for the SCL line and send the 9 SCL pulses, after that, it does >>> a reset >>> of the I2C module. For the SOCFPGA part, there is no GPIO line for >>> the SCL, >>> thus the I2C module cannot even get a reset. This code allows the >>> function >>> to reset the I2C module for SOCFPGA, which is the 2nd part of the >>> recovery >>> process. >> >> The second part is totally useless if the client device is holding SDA >> low. Which is exactly the situation that recovery tries to fix. As I >> said, if you can't control SCL, you don't have recovery. >> > > This is recovery of the master and not the slave.  We have a customer > that is the using I2C with the signals routed through the FPGA, and thus > are not GPIO. During a timeout, with this code, the driver is able to > recover the master. > Adding a bit more, because of patch: ca382f5b38f3 ("i2c: designware: add i2c gpio recovery option") the driver is now not able to reset the controller at all because it has placed a strict dependency on getting a GPIO. Before this patch, during a timeout, there was a simple call to i2c_dw_init_master(), which ultimately resets the master. Dinh