linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V1] i2c: tegra: increase transfer timeout
@ 2019-01-17 20:39 Sowjanya Komatineni
  2019-01-18  9:20 ` Jon Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: Sowjanya Komatineni @ 2019-01-17 20:39 UTC (permalink / raw)
  To: thierry.reding, jonathanh, mkarthik, smohammed, talho
  Cc: linux-tegra, linux-kernel, linux-i2c, Sowjanya Komatineni

increase transfer timeout to 10s to allow enough time during max
transfer size.

Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
---
 drivers/i2c/busses/i2c-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index e417ebf7628c..ca7c581fb4c0 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -25,7 +25,7 @@
 
 #include <asm/unaligned.h>
 
-#define TEGRA_I2C_TIMEOUT (msecs_to_jiffies(1000))
+#define TEGRA_I2C_TIMEOUT (msecs_to_jiffies(10000))
 #define BYTES_PER_FIFO_WORD 4
 
 #define I2C_CNFG				0x000
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V1] i2c: tegra: increase transfer timeout
  2019-01-17 20:39 [PATCH V1] i2c: tegra: increase transfer timeout Sowjanya Komatineni
@ 2019-01-18  9:20 ` Jon Hunter
  2019-01-18 17:21   ` Sowjanya Komatineni
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Hunter @ 2019-01-18  9:20 UTC (permalink / raw)
  To: Sowjanya Komatineni, thierry.reding, mkarthik, smohammed, talho
  Cc: linux-tegra, linux-kernel, linux-i2c


On 17/01/2019 20:39, Sowjanya Komatineni wrote:
> increase transfer timeout to 10s to allow enough time during max
> transfer size.
> 
> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
> ---
>  drivers/i2c/busses/i2c-tegra.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index e417ebf7628c..ca7c581fb4c0 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -25,7 +25,7 @@
>  
>  #include <asm/unaligned.h>
>  
> -#define TEGRA_I2C_TIMEOUT (msecs_to_jiffies(1000))
> +#define TEGRA_I2C_TIMEOUT (msecs_to_jiffies(10000))
>  #define BYTES_PER_FIFO_WORD 4
>  
>  #define I2C_CNFG				0x000

Should the timeout be set depending on the max transfer size? 10s seems
an age if the max transfer size is 4KB. In other words, we should this
only be applied for T194+?

Furthermore, in tegra_i2c_xfer_msg() we know the len of the message and
so maybe it would be better to dynamically set the timeout depending on
length?

Cheers
Jon

-- 
nvpublic

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH V1] i2c: tegra: increase transfer timeout
  2019-01-18  9:20 ` Jon Hunter
@ 2019-01-18 17:21   ` Sowjanya Komatineni
  2019-01-21  9:38     ` Thierry Reding
  0 siblings, 1 reply; 4+ messages in thread
From: Sowjanya Komatineni @ 2019-01-18 17:21 UTC (permalink / raw)
  To: Jonathan Hunter, thierry.reding, Mantravadi Karthik,
	Shardar Mohammed, Timo Alho
  Cc: linux-tegra, linux-kernel, linux-i2c



>> increase transfer timeout to 10s to allow enough time during max 
>> transfer size.
>> 
>> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
>> ---
>>  drivers/i2c/busses/i2c-tegra.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/i2c/busses/i2c-tegra.c 
>> b/drivers/i2c/busses/i2c-tegra.c index e417ebf7628c..ca7c581fb4c0 
>> 100644
>> --- a/drivers/i2c/busses/i2c-tegra.c
>> +++ b/drivers/i2c/busses/i2c-tegra.c
>> @@ -25,7 +25,7 @@
>>  
>>  #include <asm/unaligned.h>
>>  
>> -#define TEGRA_I2C_TIMEOUT (msecs_to_jiffies(1000))
>> +#define TEGRA_I2C_TIMEOUT (msecs_to_jiffies(10000))
>>  #define BYTES_PER_FIFO_WORD 4
>>  
>>  #define I2C_CNFG				0x000
>
>Should the timeout be set depending on the max transfer size? 10s seems an age if the max transfer size is 4KB. In other words, we should this only be applied for >T194+?
>
>Furthermore, in tegra_i2c_xfer_msg() we know the len of the message and so maybe it would be better to dynamically set the timeout depending on length?
>
>Cheers
>Jon

Yes, that’s the ideal way to compute timeout based on msg len and bus rate. 
To do this I had to update TEGRA_I2C_TIMEOUT macro to take arg and there are 3 different patches for tegra i2c under review and all of those will effect as the patch changes use TEGRA_I2C_TIMEOUT. 

So, Should I hold on to this change for now till those patches are merged?

Thanks
Sowjanya

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V1] i2c: tegra: increase transfer timeout
  2019-01-18 17:21   ` Sowjanya Komatineni
@ 2019-01-21  9:38     ` Thierry Reding
  0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2019-01-21  9:38 UTC (permalink / raw)
  To: Sowjanya Komatineni
  Cc: Jonathan Hunter, Mantravadi Karthik, Shardar Mohammed, Timo Alho,
	linux-tegra, linux-kernel, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 2678 bytes --]

On Fri, Jan 18, 2019 at 05:21:28PM +0000, Sowjanya Komatineni wrote:
> 
> 
> >> increase transfer timeout to 10s to allow enough time during max 
> >> transfer size.
> >> 
> >> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
> >> ---
> >>  drivers/i2c/busses/i2c-tegra.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >> 
> >> diff --git a/drivers/i2c/busses/i2c-tegra.c 
> >> b/drivers/i2c/busses/i2c-tegra.c index e417ebf7628c..ca7c581fb4c0 
> >> 100644
> >> --- a/drivers/i2c/busses/i2c-tegra.c
> >> +++ b/drivers/i2c/busses/i2c-tegra.c
> >> @@ -25,7 +25,7 @@
> >>  
> >>  #include <asm/unaligned.h>
> >>  
> >> -#define TEGRA_I2C_TIMEOUT (msecs_to_jiffies(1000))
> >> +#define TEGRA_I2C_TIMEOUT (msecs_to_jiffies(10000))
> >>  #define BYTES_PER_FIFO_WORD 4
> >>  
> >>  #define I2C_CNFG				0x000
> >
> >Should the timeout be set depending on the max transfer size? 10s seems an age if the max transfer size is 4KB. In other words, we should this only be applied for >T194+?
> >
> >Furthermore, in tegra_i2c_xfer_msg() we know the len of the message and so maybe it would be better to dynamically set the timeout depending on length?
> >
> >Cheers
> >Jon
> 
> Yes, that’s the ideal way to compute timeout based on msg len and bus rate. 
> To do this I had to update TEGRA_I2C_TIMEOUT macro to take arg and
> there are 3 different patches for tegra i2c under review and all of
> those will effect as the patch changes use TEGRA_I2C_TIMEOUT. 
> 
> So, Should I hold on to this change for now till those patches are merged?

If you have a number of patches with interdependencies, it's best to
send them out as a whole series. So you'd typically apply them in order
to a single branch, then use:

	$ git format-patch first^..last

where first is the SHA1 of the first commit you want to send, and last
is the the SHA1 of the last patch. The carret (^) means the parent
commit of the specified one and is needed because git format-patch
doesn't include the start of the sequence.

If the commits are at the top of your branch you can use something like
this:

	$ git format-patch -3

which will generate a series for the last three patches in the branch
(more specifically starting from HEAD).

If you send them as a series, it's immediately obvious in what order
they should be applied and generally makes it easier for people to
review and test.

I think in this case you can probably just have the other two patches
first in the series, then apply the timeout patch on top. That way you
can resolve the conflicts between patches 1 and 2, and patch 3 before
sending out.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-21  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 20:39 [PATCH V1] i2c: tegra: increase transfer timeout Sowjanya Komatineni
2019-01-18  9:20 ` Jon Hunter
2019-01-18 17:21   ` Sowjanya Komatineni
2019-01-21  9:38     ` Thierry Reding

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).