diff mbox series

[RFC,i2c-next,1/2] dt-bindings: i2c: aspeed: Add 'idle-wait-timeout-ms' setting

Message ID 20180910214519.14126-2-jae.hyun.yoo@linux.intel.com (mailing list archive)
State Superseded, archived
Headers show
Series i2c: aspeed: Add bus idle waiting logic for multi-master use cases | expand

Commit Message

Jae Hyun Yoo Sept. 10, 2018, 9:45 p.m. UTC
This commit adds 'idle-wait-timeout-ms' setting which can be used
for bus idle waiting logic in multi-master environment.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
---
 Documentation/devicetree/bindings/i2c/i2c-aspeed.txt | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Jae Hyun Yoo Sept. 18, 2018, 6:02 p.m. UTC | #1
On 9/10/2018 2:45 PM, Jae Hyun Yoo wrote:
> +- idle-wait-timeout-ms	: bus idle waiting timeout in milliseconds when
> +			  multi-master is set, defaults to 100 ms when not
> +			  specified.

Will change it to 'aspeed,idle-wait-timeout-ms' as it's a non standard
property.

Jae
Wolfram Sang Sept. 24, 2018, 9:58 p.m. UTC | #2
On Tue, Sep 18, 2018 at 11:02:54AM -0700, Jae Hyun Yoo wrote:
> On 9/10/2018 2:45 PM, Jae Hyun Yoo wrote:
> > +- idle-wait-timeout-ms	: bus idle waiting timeout in milliseconds when
> > +			  multi-master is set, defaults to 100 ms when not
> > +			  specified.
> 
> Will change it to 'aspeed,idle-wait-timeout-ms' as it's a non standard
> property.

No need. This binding is not a HW description, so not a DT property in
my book. I still don't understand: Your IP core in master mode does not
have a BUSY bit or similar which detects when a START was detected and
clears after a STOP?
Jae Hyun Yoo Sept. 24, 2018, 10:15 p.m. UTC | #3
Hi Wolfram,

On 9/24/2018 2:58 PM, Wolfram Sang wrote:
> On Tue, Sep 18, 2018 at 11:02:54AM -0700, Jae Hyun Yoo wrote:
>> On 9/10/2018 2:45 PM, Jae Hyun Yoo wrote:
>>> +- idle-wait-timeout-ms	: bus idle waiting timeout in milliseconds when
>>> +			  multi-master is set, defaults to 100 ms when not
>>> +			  specified.
>>
>> Will change it to 'aspeed,idle-wait-timeout-ms' as it's a non standard
>> property.
> 
> No need. This binding is not a HW description, so not a DT property in
> my book. I still don't understand: Your IP core in master mode does not
> have a BUSY bit or similar which detects when a START was detected and
> clears after a STOP?
> 

Okay, I'll keep this property as it is then.

Aspeed IP has the BUSY bit on the I2CD14 register and we are already
using the bit in the current code for single-master use cases.
Due to the bit doesn't cover well multi-master use cases so we need to
improve the current busy checking logic using the 'Transfer Mode State
Machine' bit fields on the same register through this patch set.

Thanks for the review!

Jae
Wolfram Sang Sept. 25, 2018, 8:27 a.m. UTC | #4
On Mon, Sep 24, 2018 at 03:15:46PM -0700, Jae Hyun Yoo wrote:
> Hi Wolfram,
> 
> On 9/24/2018 2:58 PM, Wolfram Sang wrote:
> > On Tue, Sep 18, 2018 at 11:02:54AM -0700, Jae Hyun Yoo wrote:
> > > On 9/10/2018 2:45 PM, Jae Hyun Yoo wrote:
> > > > +- idle-wait-timeout-ms	: bus idle waiting timeout in milliseconds when
> > > > +			  multi-master is set, defaults to 100 ms when not
> > > > +			  specified.
> > > 
> > > Will change it to 'aspeed,idle-wait-timeout-ms' as it's a non standard
> > > property.
> > 
> > No need. This binding is not a HW description, so not a DT property in
> > my book. I still don't understand: Your IP core in master mode does not
> > have a BUSY bit or similar which detects when a START was detected and
> > clears after a STOP?
> > 
> 
> Okay, I'll keep this property as it is then.

Sorry for the misunderstanding. I don't think this a property, at all.
It doesn't describe the hardware, it is more of a configuration thing,
or?
Jae Hyun Yoo Sept. 25, 2018, 4:20 p.m. UTC | #5
On 9/25/2018 1:27 AM, Wolfram Sang wrote:
> On Mon, Sep 24, 2018 at 03:15:46PM -0700, Jae Hyun Yoo wrote:
>> Hi Wolfram,
>>
>> On 9/24/2018 2:58 PM, Wolfram Sang wrote:
>>> On Tue, Sep 18, 2018 at 11:02:54AM -0700, Jae Hyun Yoo wrote:
>>>> On 9/10/2018 2:45 PM, Jae Hyun Yoo wrote:
>>>>> +- idle-wait-timeout-ms	: bus idle waiting timeout in milliseconds when
>>>>> +			  multi-master is set, defaults to 100 ms when not
>>>>> +			  specified.
>>>>
>>>> Will change it to 'aspeed,idle-wait-timeout-ms' as it's a non standard
>>>> property.
>>>
>>> No need. This binding is not a HW description, so not a DT property in
>>> my book. I still don't understand: Your IP core in master mode does not
>>> have a BUSY bit or similar which detects when a START was detected and
>>> clears after a STOP?
>>>
>>
>> Okay, I'll keep this property as it is then.
> 
> Sorry for the misunderstanding. I don't think this a property, at all.
> It doesn't describe the hardware, it is more of a configuration thing,
> or?
> 

You are right. It doesn't describe the hardware but it needs to be
configurable because it very depends on the peer master's behavior.
If peer master sends a long packet usually, it should have a long
timeout value since a slave receiving operation takes long time,
and it should be adjusted with an optimal value with taking some
experiments to make it not too long. Any suggestion?

Thanks,
Jae
Jae Hyun Yoo Sept. 26, 2018, 4:20 p.m. UTC | #6
On 9/25/2018 9:20 AM, Jae Hyun Yoo wrote:
> On 9/25/2018 1:27 AM, Wolfram Sang wrote:
>> On Mon, Sep 24, 2018 at 03:15:46PM -0700, Jae Hyun Yoo wrote:
>>> Hi Wolfram,
>>>
>>> On 9/24/2018 2:58 PM, Wolfram Sang wrote:
>>>> On Tue, Sep 18, 2018 at 11:02:54AM -0700, Jae Hyun Yoo wrote:
>>>>> On 9/10/2018 2:45 PM, Jae Hyun Yoo wrote:
>>>>>> +- idle-wait-timeout-ms    : bus idle waiting timeout in 
>>>>>> milliseconds when
>>>>>> +              multi-master is set, defaults to 100 ms when not
>>>>>> +              specified.
>>>>>
>>>>> Will change it to 'aspeed,idle-wait-timeout-ms' as it's a non standard
>>>>> property.
>>>>
>>>> No need. This binding is not a HW description, so not a DT property in
>>>> my book. I still don't understand: Your IP core in master mode does not
>>>> have a BUSY bit or similar which detects when a START was detected and
>>>> clears after a STOP?
>>>>
>>>
>>> Okay, I'll keep this property as it is then.
>>
>> Sorry for the misunderstanding. I don't think this a property, at all.
>> It doesn't describe the hardware, it is more of a configuration thing,
>> or?
>>
> 
> You are right. It doesn't describe the hardware but it needs to be
> configurable because it very depends on the peer master's behavior.
> If peer master sends a long packet usually, it should have a long
> timeout value since a slave receiving operation takes long time,
> and it should be adjusted with an optimal value with taking some
> experiments to make it not too long. Any suggestion?
> 

Should I use timeout in struct i2c_adapter instead just like i2c-mpc
does?
Wolfram Sang Sept. 26, 2018, 4:27 p.m. UTC | #7
> Should I use timeout in struct i2c_adapter instead just like i2c-mpc
> does?

I would accept that.
Jae Hyun Yoo Sept. 26, 2018, 4:32 p.m. UTC | #8
On 9/26/2018 9:27 AM, Wolfram Sang wrote:
> 
>> Should I use timeout in struct i2c_adapter instead just like i2c-mpc
>> does?
> 
> I would accept that.
> 

Okay, I will submit a new patch set. Thanks!

Jae
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt b/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
index 8fbd8633a387..42ecaaf67172 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
@@ -13,9 +13,13 @@  Required Properties:
 - interrupts		: interrupt number
 
 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.
+- 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.
+- idle-wait-timeout-ms	: bus idle waiting timeout in milliseconds when
+			  multi-master is set, defaults to 100 ms when not
+			  specified.
 
 Example: