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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 80C5ACA9EB7 for ; Mon, 21 Oct 2019 21:57:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 52A202086D for ; Mon, 21 Oct 2019 21:57:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T2wyL4zn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52A202086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=K9By5SYYIKeqFo1/XwqjEG+2TTWDTAPN5q34d3SifVo=; b=T2wyL4zn0BNpM09DMvqQB7Jy/ 33E049gCSDOJAN+KNxT20cTW+MNtOp82m/4lvu4rWAt9CQFd+55VQJq+pWARK5K+cguGtv4hqi/pX ybRcRcdTrGPpP4XLr/INj/QJkxRdN5C7OItkPyxSc3aCONO1+Y9Xr8dfhTL8+pNWbpRHtOf8SDXoI QqLH/23+Z9cwUu9Z86Zf3CX5obw7feK009eqqJ5Jfr6xoQgHFkQrJBZM2Og349TtCf12wlNhGcFu4 h7KLE+T0uyZMzbvLjGTkz0cXksDVNQLReZBJAHz4E3GaJoEoRkqdCthynLZrM+K40DW6JpyyDeKOQ nD1DOYI8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMfgR-0006Ih-Lo; Mon, 21 Oct 2019 21:57:47 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMfgP-0006Hy-He for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2019 21:57:46 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Oct 2019 14:57:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,325,1566889200"; d="scan'208";a="209472729" Received: from yoojae-mobl1.amr.corp.intel.com (HELO [10.7.153.143]) ([10.7.153.143]) by orsmga002.jf.intel.com with ESMTP; 21 Oct 2019 14:57:43 -0700 Subject: Re: [PATCH i2c-next 1/2] dt-bindings: i2c: aspeed: add hardware timeout support To: Peter Rosin , Brendan Higgins , Wolfram Sang , Benjamin Herrenschmidt , Joel Stanley , Rob Herring , Mark Rutland , Andrew Jeffery , Tao Ren , Cedric Le Goater References: <20191021202414.17484-1-jae.hyun.yoo@linux.intel.com> <20191021202414.17484-2-jae.hyun.yoo@linux.intel.com> <0a629f7b-b829-c332-27d8-dc825205ff72@axentia.se> From: Jae Hyun Yoo Message-ID: <7abf933b-cb18-10af-9c1b-163ec65ffae5@linux.intel.com> Date: Mon, 21 Oct 2019 14:57:43 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <0a629f7b-b829-c332-27d8-dc825205ff72@axentia.se> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191021_145745_624149_F47A9C2F X-CRM114-Status: GOOD ( 24.65 ) 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: "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "openbmc@lists.ozlabs.org" , "linux-i2c@vger.kernel.org" , "linux-aspeed@lists.ozlabs.org" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Peter, On 10/21/2019 2:05 PM, Peter Rosin wrote: > On 2019-10-21 22:24, Jae Hyun Yoo wrote: >> Append a binding to support hardware timeout feature. >> >> Signed-off-by: Jae Hyun Yoo >> --- >> Documentation/devicetree/bindings/i2c/i2c-aspeed.txt | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt b/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt >> index b47f6ccb196a..133bfedf4cdd 100644 >> --- a/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt >> +++ b/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt >> @@ -17,6 +17,8 @@ Optional Properties: >> - bus-frequency : frequency of the bus clock in Hz defaults to 100 kHz when not >> specified >> - multi-master : states that there is another master active on this bus. >> +- aspeed,hw-timeout-ms : Hardware timeout in milliseconds. If it's not >> + specified, the H/W timeout feature will be disabled. >> >> Example: >> >> > > Some SMBus clients support a smbus-timeout-disable binding for disabling > timeouts like this, for cases where the I2C adapter in question on occasion > is unable to keep the pace. Adding that property thus avoids undesired > timeouts when the client is SMBus conformant without it. Your new binding > is the reverse situation, where you want to add a timeout where one is > otherwise missing. > > Anyway, since I2C does not have a specified lowest possible frequency, this > feels like something that is more in the SMBus arena. Should the property > perhaps be a generic property named smbus-timeout-ms, or something like > that? Well, I tried upstreaming of the generic timeout property a year ago but I agreed that the generic bus timeout property can be set by an ioctl command so it didn't need to be added into device tree at that time. Not sure if any need has come recently but I haven't heard that. This driver still uses the generic timeout property which is provided by i2c core for handling command timeouts, and it's out of scope from this patch series. > If the above is not wanted or appropriate, then I would personally prefer > aspeed,bus-timeout-ms over aspeed,hw-timeout-ms. To me, hw-timeout-ms sounds > like a (more serious) timeout between the CPU and the I2C peripheral unit > or something like that. But I don't care deeply... Changes I submitted in this patch set is for a different purpose which is very Aspeed H/W specific, and actually it's a more serious timeout setting indeed. If this H/W is used in multi-master environment, it could meet a H/W hang that freezes itself in slave mode and it can't escape from the state. To resolve the specific case, this H/W provides self-recovery feature which monitors abnormal state of SDA, SCL and its H/W state machine using the timeout setting to determine the escape condition. Generally, this H/W timeout value is smaller than the generic bus timeout value (I'm using 300ms for the H/W timeout while I'm using 1 second for the generic bus timeout) so I think it should be distinguished from the generic bus timeout. Thanks, Jae _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel