* [PATCH] i2c: octeon: Make the timeout 1*HZ instead of 1 jiffy
@ 2011-01-24 12:05 Bernhard Walle
[not found] ` <1295870741-19970-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Bernhard Walle @ 2011-01-24 12:05 UTC (permalink / raw)
To: ben-linux-elnMNo+KYs3YtjvyW6yDsg
Cc: ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8,
ralf-6z/3iImG2C8G8FEW9MqTrA, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Since the timeout in the struct i2c_adapter use jiffies as unit and a
timeout should be independent of CONFIG_HZ and most drivers that specify
a timeout here use just HZ, change the i2c-octeon driver to use 1*HZ
(which is a second), too.
Signed-off-by: Bernhard Walle <walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
---
drivers/i2c/busses/i2c-octeon.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
index 0fe1102..537a4ee 100644
--- a/drivers/i2c/busses/i2c-octeon.c
+++ b/drivers/i2c/busses/i2c-octeon.c
@@ -460,7 +460,7 @@ static struct i2c_adapter octeon_i2c_ops = {
.owner = THIS_MODULE,
.name = "OCTEON adapter",
.algo = &octeon_i2c_algo,
- .timeout = 2,
+ .timeout = HZ,
};
/**
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread[parent not found: <1295870741-19970-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>]
* Re: [PATCH] i2c: octeon: Make the timeout 1*HZ instead of 1 jiffy [not found] ` <1295870741-19970-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> @ 2011-01-24 12:14 ` Jean Delvare [not found] ` <20110124131405.4583a7af-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Jean Delvare @ 2011-01-24 12:14 UTC (permalink / raw) To: Bernhard Walle Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg, ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8, ralf-6z/3iImG2C8G8FEW9MqTrA, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Hi Bernhard, On Mon, 24 Jan 2011 13:05:41 +0100, Bernhard Walle wrote: > Since the timeout in the struct i2c_adapter use jiffies as unit and a > timeout should be independent of CONFIG_HZ and most drivers that specify > a timeout here use just HZ, change the i2c-octeon driver to use 1*HZ > (which is a second), too. > > Signed-off-by: Bernhard Walle <walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> > --- > drivers/i2c/busses/i2c-octeon.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c > index 0fe1102..537a4ee 100644 > --- a/drivers/i2c/busses/i2c-octeon.c > +++ b/drivers/i2c/busses/i2c-octeon.c > @@ -460,7 +460,7 @@ static struct i2c_adapter octeon_i2c_ops = { > .owner = THIS_MODULE, > .name = "OCTEON adapter", > .algo = &octeon_i2c_algo, > - .timeout = 2, > + .timeout = HZ, > }; > > /** This is a large timeout value, much larger than any value the i2c-octeon driver was using today for any possible value of HZ. Wouldn't it make more sense to set it to HZ / 50, which is 2 for HZ = 100, leaving the setting unchanged for this common case at least? -- Jean Delvare ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20110124131405.4583a7af-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>]
* Re: [PATCH] i2c: octeon: Make the timeout 1*HZ instead of 1 jiffy [not found] ` <20110124131405.4583a7af-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org> @ 2011-01-24 12:37 ` Bernhard Walle [not found] ` <4D3D7290.9050203-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Bernhard Walle @ 2011-01-24 12:37 UTC (permalink / raw) To: Jean Delvare Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg, ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8, ralf-6z/3iImG2C8G8FEW9MqTrA, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 965 bytes --] Hi Jean, Am 24.01.2011 13:14, schrieb Jean Delvare: >> .owner = THIS_MODULE, >> .name = "OCTEON adapter", >> .algo = &octeon_i2c_algo, >> - .timeout = 2, >> + .timeout = HZ, >> }; > > This is a large timeout value, much larger than any value the > i2c-octeon driver was using today for any possible value of HZ. > Wouldn't it make more sense to set it to HZ / 50, which is 2 for HZ = > 100, leaving the setting unchanged for this common case at least? To be honest, I had problems with timeout=2 that go away with timeout=HZ. But I cannot be sure that this is a problem with my hardware that is not present with other devices. The drivers that use HZ are i2c-mpc.c and i2c-pca-platform.c, but I don't know the hardware that much so that I really can compare the values. So yes, you're right. A patch modifying the timeout value should be an extra patch, so I will resend the current patch to use HZ/50. Regards, Bernhard [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 900 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <4D3D7290.9050203-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>]
* [PATCH] i2c: octeon: Make the timeout independent of CONFIG_HZ [not found] ` <4D3D7290.9050203-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> @ 2011-01-24 12:40 ` Bernhard Walle [not found] ` <1295872826-22129-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Bernhard Walle @ 2011-01-24 12:40 UTC (permalink / raw) To: ben-linux-elnMNo+KYs3YtjvyW6yDsg Cc: ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8, ralf-6z/3iImG2C8G8FEW9MqTrA, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Since the timeout in the struct i2c_adapter use jiffies as unit and a timeout should be independent of CONFIG_HZ, use a value of HZ/50 which is equal to the current value 2 for CONFIG_HZ=100. Signed-off-by: Bernhard Walle <walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> --- drivers/i2c/busses/i2c-octeon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c index 4cffda5..d07e5c7 100644 --- a/drivers/i2c/busses/i2c-octeon.c +++ b/drivers/i2c/busses/i2c-octeon.c @@ -469,7 +469,7 @@ static struct i2c_adapter octeon_i2c_ops = { .owner = THIS_MODULE, .name = "OCTEON adapter", .algo = &octeon_i2c_algo, - .timeout = 2, + .timeout = HZ/50, }; /** -- 1.7.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1295872826-22129-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>]
* Re: [PATCH] i2c: octeon: Make the timeout independent of CONFIG_HZ [not found] ` <1295872826-22129-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> @ 2011-01-24 14:00 ` Jean Delvare [not found] ` <20110124150005.577b0235-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Jean Delvare @ 2011-01-24 14:00 UTC (permalink / raw) To: Bernhard Walle Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg, ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8, ralf-6z/3iImG2C8G8FEW9MqTrA, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Mon, 24 Jan 2011 13:40:26 +0100, Bernhard Walle wrote: > Since the timeout in the struct i2c_adapter use jiffies as unit and a > timeout should be independent of CONFIG_HZ, use a value of HZ/50 which > is equal to the current value 2 for CONFIG_HZ=100. > > Signed-off-by: Bernhard Walle <walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> Ben, please apply. > --- > drivers/i2c/busses/i2c-octeon.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c > index 4cffda5..d07e5c7 100644 > --- a/drivers/i2c/busses/i2c-octeon.c > +++ b/drivers/i2c/busses/i2c-octeon.c > @@ -469,7 +469,7 @@ static struct i2c_adapter octeon_i2c_ops = { > .owner = THIS_MODULE, > .name = "OCTEON adapter", > .algo = &octeon_i2c_algo, > - .timeout = 2, > + .timeout = HZ/50, > }; > > /** -- Jean Delvare ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20110124150005.577b0235-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>]
* Re: [PATCH] i2c: octeon: Make the timeout independent of CONFIG_HZ [not found] ` <20110124150005.577b0235-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org> @ 2011-03-16 13:32 ` Jean Delvare 0 siblings, 0 replies; 6+ messages in thread From: Jean Delvare @ 2011-03-16 13:32 UTC (permalink / raw) To: ben-linux-elnMNo+KYs3YtjvyW6yDsg Cc: Bernhard Walle, ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8, ralf-6z/3iImG2C8G8FEW9MqTrA, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Mon, 24 Jan 2011 15:00:05 +0100, Jean Delvare wrote: > On Mon, 24 Jan 2011 13:40:26 +0100, Bernhard Walle wrote: > > Since the timeout in the struct i2c_adapter use jiffies as unit and a > > timeout should be independent of CONFIG_HZ, use a value of HZ/50 which > > is equal to the current value 2 for CONFIG_HZ=100. > > > > Signed-off-by: Bernhard Walle <walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org> > > Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> > > Ben, please apply. Ben, I can't see this fix in your tree, it seems it got lost? > > --- > > drivers/i2c/busses/i2c-octeon.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c > > index 4cffda5..d07e5c7 100644 > > --- a/drivers/i2c/busses/i2c-octeon.c > > +++ b/drivers/i2c/busses/i2c-octeon.c > > @@ -469,7 +469,7 @@ static struct i2c_adapter octeon_i2c_ops = { > > .owner = THIS_MODULE, > > .name = "OCTEON adapter", > > .algo = &octeon_i2c_algo, > > - .timeout = 2, > > + .timeout = HZ/50, > > }; > > > > /** > > -- Jean Delvare ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-03-16 13:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-24 12:05 [PATCH] i2c: octeon: Make the timeout 1*HZ instead of 1 jiffy Bernhard Walle
[not found] ` <1295870741-19970-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
2011-01-24 12:14 ` Jean Delvare
[not found] ` <20110124131405.4583a7af-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-01-24 12:37 ` Bernhard Walle
[not found] ` <4D3D7290.9050203-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
2011-01-24 12:40 ` [PATCH] i2c: octeon: Make the timeout independent of CONFIG_HZ Bernhard Walle
[not found] ` <1295872826-22129-1-git-send-email-walle-pDveNdigDaDu9UdzE1sIFA@public.gmane.org>
2011-01-24 14:00 ` Jean Delvare
[not found] ` <20110124150005.577b0235-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-03-16 13:32 ` Jean Delvare
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox