From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
To: Peter Rosin <peda@axentia.se>,
Brendan Higgins <brendanhiggins@google.com>,
Wolfram Sang <wsa@the-dreams.de>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Joel Stanley <joel@jms.id.au>, Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Andrew Jeffery <andrew@aj.id.au>, Tao Ren <taoren@fb.com>,
Cedric Le Goater <clg@kaod.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH i2c-next 1/2] dt-bindings: i2c: aspeed: add hardware timeout support
Date: Mon, 21 Oct 2019 14:57:43 -0700 [thread overview]
Message-ID: <7abf933b-cb18-10af-9c1b-163ec65ffae5@linux.intel.com> (raw)
In-Reply-To: <0a629f7b-b829-c332-27d8-dc825205ff72@axentia.se>
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 <jae.hyun.yoo@linux.intel.com>
>> ---
>> 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
next prev parent reply other threads:[~2019-10-21 21:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 20:24 [PATCH i2c-next 0/2] i2c: aspeed: Add H/W timeout support Jae Hyun Yoo
2019-10-21 20:24 ` [PATCH i2c-next 1/2] dt-bindings: i2c: aspeed: add hardware " Jae Hyun Yoo
2019-10-21 21:05 ` Peter Rosin
2019-10-21 21:57 ` Jae Hyun Yoo [this message]
2019-10-22 4:56 ` Wolfram Sang
2019-10-22 17:09 ` Jae Hyun Yoo
2019-10-22 8:45 ` Peter Rosin
2019-10-22 17:44 ` Jae Hyun Yoo
2019-10-23 21:17 ` Peter Rosin
2019-10-23 22:09 ` Tao Ren
2019-10-24 0:09 ` Brendan Higgins
2019-10-24 17:27 ` Jae Hyun Yoo
2019-10-21 20:24 ` [PATCH i2c-next 2/2] i2c: aspeed: add slave inactive " Jae Hyun Yoo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7abf933b-cb18-10af-9c1b-163ec65ffae5@linux.intel.com \
--to=jae.hyun.yoo@linux.intel.com \
--cc=andrew@aj.id.au \
--cc=benh@kernel.crashing.org \
--cc=brendanhiggins@google.com \
--cc=clg@kaod.org \
--cc=devicetree@vger.kernel.org \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-i2c@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=openbmc@lists.ozlabs.org \
--cc=peda@axentia.se \
--cc=robh+dt@kernel.org \
--cc=taoren@fb.com \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).