Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360425 > unrolled thread
| Started by | Jan Glauber <jglauber@cavium.com> |
|---|---|
| First post | 2016-03-18 09:50 +0100 |
| Last post | 2016-03-31 12:20 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v4 03/14] i2c-octeon: Change adapter timeout and retry default values Jan Glauber <jglauber@cavium.com> - 2016-03-18 09:50 +0100
Re: [PATCH v4 03/14] i2c-octeon: Change adapter timeout and retry default values Wolfram Sang <wsa@the-dreams.de> - 2016-03-23 21:00 +0100
Re: [PATCH v4 03/14] i2c-octeon: Change adapter timeout and retry default values Jan Glauber <jan.glauber@caviumnetworks.com> - 2016-03-31 12:20 +0200
| From | Jan Glauber <jglauber@cavium.com> |
|---|---|
| Date | 2016-03-18 09:50 +0100 |
| Subject | [PATCH v4 03/14] i2c-octeon: Change adapter timeout and retry default values |
| Message-ID | <rdYgx-3aq-7@gated-at.bofh.it> |
Convert the adapter timeout to 2 ms instead of a fixed number of
jiffies and set retries to 10.
Signed-off-by: Jan Glauber <jglauber@cavium.com>
---
drivers/i2c/busses/i2c-octeon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
index 9240037..e616e4c 100644
--- a/drivers/i2c/busses/i2c-octeon.c
+++ b/drivers/i2c/busses/i2c-octeon.c
@@ -414,7 +414,6 @@ static struct i2c_adapter octeon_i2c_ops = {
.owner = THIS_MODULE,
.name = "OCTEON adapter",
.algo = &octeon_i2c_algo,
- .timeout = HZ / 50,
};
/* calculate and set clock divisors */
@@ -541,6 +540,8 @@ static int octeon_i2c_probe(struct platform_device *pdev)
octeon_i2c_set_clock(i2c);
i2c->adap = octeon_i2c_ops;
+ i2c->adap.timeout = msecs_to_jiffies(2);
+ i2c->adap.retries = 10;
i2c->adap.dev.parent = &pdev->dev;
i2c->adap.dev.of_node = node;
i2c_set_adapdata(&i2c->adap, i2c);
--
1.9.1
[toc] | [next] | [standalone]
| From | Wolfram Sang <wsa@the-dreams.de> |
|---|---|
| Date | 2016-03-23 21:00 +0100 |
| Subject | Re: [PATCH v4 03/14] i2c-octeon: Change adapter timeout and retry default values |
| Message-ID | <rfX6G-8f8-3@gated-at.bofh.it> |
| In reply to | #1360425 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Mar 18, 2016 at 09:46:28AM +0100, Jan Glauber wrote:
> Convert the adapter timeout to 2 ms instead of a fixed number of
> jiffies and set retries to 10.
You describe what you change, but not why this is needed. Why 10
retries? And shouldn't that be 20ms seeing the HZ/50 ?
Also, please use "i2c: octeon: " as prefix in the subject.
Thanks,
Wolfram
>
> Signed-off-by: Jan Glauber <jglauber@cavium.com>
> ---
> drivers/i2c/busses/i2c-octeon.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
> index 9240037..e616e4c 100644
> --- a/drivers/i2c/busses/i2c-octeon.c
> +++ b/drivers/i2c/busses/i2c-octeon.c
> @@ -414,7 +414,6 @@ static struct i2c_adapter octeon_i2c_ops = {
> .owner = THIS_MODULE,
> .name = "OCTEON adapter",
> .algo = &octeon_i2c_algo,
> - .timeout = HZ / 50,
> };
>
> /* calculate and set clock divisors */
> @@ -541,6 +540,8 @@ static int octeon_i2c_probe(struct platform_device *pdev)
> octeon_i2c_set_clock(i2c);
>
> i2c->adap = octeon_i2c_ops;
> + i2c->adap.timeout = msecs_to_jiffies(2);
> + i2c->adap.retries = 10;
> i2c->adap.dev.parent = &pdev->dev;
> i2c->adap.dev.of_node = node;
> i2c_set_adapdata(&i2c->adap, i2c);
> --
> 1.9.1
>
[toc] | [prev] | [next] | [standalone]
| From | Jan Glauber <jan.glauber@caviumnetworks.com> |
|---|---|
| Date | 2016-03-31 12:20 +0200 |
| Subject | Re: [PATCH v4 03/14] i2c-octeon: Change adapter timeout and retry default values |
| Message-ID | <riHRM-3pE-11@gated-at.bofh.it> |
| In reply to | #1363651 |
On Wed, Mar 23, 2016 at 08:55:18PM +0100, Wolfram Sang wrote:
> On Fri, Mar 18, 2016 at 09:46:28AM +0100, Jan Glauber wrote:
> > Convert the adapter timeout to 2 ms instead of a fixed number of
> > jiffies and set retries to 10.
>
> You describe what you change, but not why this is needed. Why 10
> retries? And shouldn't that be 20ms seeing the HZ/50 ?
The timeout value is not changed, i2c-octeon is bound to Octeon SOC
which has CONFIG_HZ=100. I would prefer to use an absolute value for
a timeout that should not change with the value of CONFIG_HZ.
For the retries, I'll change it to 5 which is what many i2c drivers
use. I thought the reason to use a non-zero value for retries might
be obvious, like "retry in case of a failed operation" ?!
With the updated driver I do not see retry attempts, but it might
not hurt the robustness of the driver to benefit from i2c core
retry logic, or am I missing something?
> Also, please use "i2c: octeon: " as prefix in the subject.
OK.
Thanks,
Jan
> Thanks,
>
> Wolfram
>
> >
> > Signed-off-by: Jan Glauber <jglauber@cavium.com>
> > ---
> > drivers/i2c/busses/i2c-octeon.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
> > index 9240037..e616e4c 100644
> > --- a/drivers/i2c/busses/i2c-octeon.c
> > +++ b/drivers/i2c/busses/i2c-octeon.c
> > @@ -414,7 +414,6 @@ static struct i2c_adapter octeon_i2c_ops = {
> > .owner = THIS_MODULE,
> > .name = "OCTEON adapter",
> > .algo = &octeon_i2c_algo,
> > - .timeout = HZ / 50,
> > };
> >
> > /* calculate and set clock divisors */
> > @@ -541,6 +540,8 @@ static int octeon_i2c_probe(struct platform_device *pdev)
> > octeon_i2c_set_clock(i2c);
> >
> > i2c->adap = octeon_i2c_ops;
> > + i2c->adap.timeout = msecs_to_jiffies(2);
> > + i2c->adap.retries = 10;
> > i2c->adap.dev.parent = &pdev->dev;
> > i2c->adap.dev.of_node = node;
> > i2c_set_adapdata(&i2c->adap, i2c);
> > --
> > 1.9.1
> >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web