All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-04 14:08 ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2010-04-04 14:08 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang, Eric Miao,
	Russell King, Marc Zyngier, Paul Shen, Mike Rapoport

The timeout value is in jiffies, so it should be using HZ, not a plain
number. Assume '100' means 100ms here and adapt accordingly.

Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
---

Janitorial fix, not tested due to no hardware.

 arch/arm/mach-pxa/viper.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 1dd1334..c25921f 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -33,6 +33,7 @@
 #include <linux/pm.h>
 #include <linux/sched.h>
 #include <linux/gpio.h>
+#include <linux/jiffies.h>
 #include <linux/i2c-gpio.h>
 #include <linux/serial_8250.h>
 #include <linux/smc91x.h>
@@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
 	.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
 	.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
 	.udelay  = 10,
-	.timeout = 100,
+	.timeout = HZ / 10,
 };
 
 static struct platform_device i2c_bus_device = {
@@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
 		.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
 		.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
 		.udelay  = 10,
-		.timeout = 100,
+		.timeout = HZ / 10,
 	};
 	char *errstr;
 
-- 
1.7.0

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

* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-04 14:08 ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2010-04-04 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

The timeout value is in jiffies, so it should be using HZ, not a plain
number. Assume '100' means 100ms here and adapt accordingly.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Marc Zyngier <maz@misterjones.org>
Cc: Paul Shen <paul.shen@marvell.com>
Cc: Mike Rapoport <mike@compulab.co.il>
---

Janitorial fix, not tested due to no hardware.

 arch/arm/mach-pxa/viper.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 1dd1334..c25921f 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -33,6 +33,7 @@
 #include <linux/pm.h>
 #include <linux/sched.h>
 #include <linux/gpio.h>
+#include <linux/jiffies.h>
 #include <linux/i2c-gpio.h>
 #include <linux/serial_8250.h>
 #include <linux/smc91x.h>
@@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
 	.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
 	.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
 	.udelay  = 10,
-	.timeout = 100,
+	.timeout = HZ / 10,
 };
 
 static struct platform_device i2c_bus_device = {
@@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
 		.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
 		.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
 		.udelay  = 10,
-		.timeout = 100,
+		.timeout = HZ / 10,
 	};
 	char *errstr;
 
-- 
1.7.0

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

* Re: [PATCH] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-04 14:08 ` Wolfram Sang
@ 2010-04-12 17:57     ` Eric Miao
  -1 siblings, 0 replies; 28+ messages in thread
From: Eric Miao @ 2010-04-12 17:57 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Russell King, Marc Zyngier,
	Paul Shen, Mike Rapoport

On Sun, Apr 4, 2010 at 10:08 PM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> The timeout value is in jiffies, so it should be using HZ, not a plain
> number. Assume '100' means 100ms here and adapt accordingly.
>
> Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> ---
>
> Janitorial fix, not tested due to no hardware.
>
>  arch/arm/mach-pxa/viper.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> index 1dd1334..c25921f 100644
> --- a/arch/arm/mach-pxa/viper.c
> +++ b/arch/arm/mach-pxa/viper.c
> @@ -33,6 +33,7 @@
>  #include <linux/pm.h>
>  #include <linux/sched.h>
>  #include <linux/gpio.h>
> +#include <linux/jiffies.h>
>  #include <linux/i2c-gpio.h>
>  #include <linux/serial_8250.h>
>  #include <linux/smc91x.h>
> @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
>        .sda_pin = VIPER_RTC_I2C_SDA_GPIO,
>        .scl_pin = VIPER_RTC_I2C_SCL_GPIO,
>        .udelay  = 10,
> -       .timeout = 100,
> +       .timeout = HZ / 10,
>  };
>
>  static struct platform_device i2c_bus_device = {
> @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
>                .sda_pin = VIPER_TPM_I2C_SDA_GPIO,
>                .scl_pin = VIPER_TPM_I2C_SCL_GPIO,
>                .udelay  = 10,
> -               .timeout = 100,
> +               .timeout = HZ / 10,
>        };
>        char *errstr;
>

One other better and cleaner approach to such inconsistency issue is
to have a timeout_ms field, and having i2c-gpio.c driver to convert this
to jiffies using msec_to_jiffies() at run-time.

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

* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-12 17:57     ` Eric Miao
  0 siblings, 0 replies; 28+ messages in thread
From: Eric Miao @ 2010-04-12 17:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Apr 4, 2010 at 10:08 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> The timeout value is in jiffies, so it should be using HZ, not a plain
> number. Assume '100' means 100ms here and adapt accordingly.
>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Marc Zyngier <maz@misterjones.org>
> Cc: Paul Shen <paul.shen@marvell.com>
> Cc: Mike Rapoport <mike@compulab.co.il>
> ---
>
> Janitorial fix, not tested due to no hardware.
>
> ?arch/arm/mach-pxa/viper.c | ? ?5 +++--
> ?1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> index 1dd1334..c25921f 100644
> --- a/arch/arm/mach-pxa/viper.c
> +++ b/arch/arm/mach-pxa/viper.c
> @@ -33,6 +33,7 @@
> ?#include <linux/pm.h>
> ?#include <linux/sched.h>
> ?#include <linux/gpio.h>
> +#include <linux/jiffies.h>
> ?#include <linux/i2c-gpio.h>
> ?#include <linux/serial_8250.h>
> ?#include <linux/smc91x.h>
> @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
> ? ? ? ?.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
> ? ? ? ?.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
> ? ? ? ?.udelay ?= 10,
> - ? ? ? .timeout = 100,
> + ? ? ? .timeout = HZ / 10,
> ?};
>
> ?static struct platform_device i2c_bus_device = {
> @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
> ? ? ? ? ? ? ? ?.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
> ? ? ? ? ? ? ? ?.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
> ? ? ? ? ? ? ? ?.udelay ?= 10,
> - ? ? ? ? ? ? ? .timeout = 100,
> + ? ? ? ? ? ? ? .timeout = HZ / 10,
> ? ? ? ?};
> ? ? ? ?char *errstr;
>

One other better and cleaner approach to such inconsistency issue is
to have a timeout_ms field, and having i2c-gpio.c driver to convert this
to jiffies using msec_to_jiffies() at run-time.

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

* Re: [PATCH] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-12 17:57     ` Eric Miao
@ 2010-04-12 19:13         ` Jean Delvare
  -1 siblings, 0 replies; 28+ messages in thread
From: Jean Delvare @ 2010-04-12 19:13 UTC (permalink / raw)
  To: Eric Miao
  Cc: Wolfram Sang, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Russell King, Marc Zyngier,
	Paul Shen, Mike Rapoport

On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> On Sun, Apr 4, 2010 at 10:08 PM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> > The timeout value is in jiffies, so it should be using HZ, not a plain
> > number. Assume '100' means 100ms here and adapt accordingly.
> >
> > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> > Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> > Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> > Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> > ---
> >
> > Janitorial fix, not tested due to no hardware.
> >
> >  arch/arm/mach-pxa/viper.c |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> > index 1dd1334..c25921f 100644
> > --- a/arch/arm/mach-pxa/viper.c
> > +++ b/arch/arm/mach-pxa/viper.c
> > @@ -33,6 +33,7 @@
> >  #include <linux/pm.h>
> >  #include <linux/sched.h>
> >  #include <linux/gpio.h>
> > +#include <linux/jiffies.h>
> >  #include <linux/i2c-gpio.h>
> >  #include <linux/serial_8250.h>
> >  #include <linux/smc91x.h>
> > @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
> >        .sda_pin = VIPER_RTC_I2C_SDA_GPIO,
> >        .scl_pin = VIPER_RTC_I2C_SCL_GPIO,
> >        .udelay  = 10,
> > -       .timeout = 100,
> > +       .timeout = HZ / 10,
> >  };
> >
> >  static struct platform_device i2c_bus_device = {
> > @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
> >                .sda_pin = VIPER_TPM_I2C_SDA_GPIO,
> >                .scl_pin = VIPER_TPM_I2C_SCL_GPIO,
> >                .udelay  = 10,
> > -               .timeout = 100,
> > +               .timeout = HZ / 10,
> >        };
> >        char *errstr;
> >
> 
> One other better and cleaner approach to such inconsistency issue is
> to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> to jiffies using msec_to_jiffies() at run-time.

With what benefit? Expressing time values in units of HZ is very
frequent in the kernel code and shouldn't actually surprise anyone.

-- 
Jean Delvare

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

* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-12 19:13         ` Jean Delvare
  0 siblings, 0 replies; 28+ messages in thread
From: Jean Delvare @ 2010-04-12 19:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> On Sun, Apr 4, 2010 at 10:08 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > The timeout value is in jiffies, so it should be using HZ, not a plain
> > number. Assume '100' means 100ms here and adapt accordingly.
> >
> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > Cc: Eric Miao <eric.y.miao@gmail.com>
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Marc Zyngier <maz@misterjones.org>
> > Cc: Paul Shen <paul.shen@marvell.com>
> > Cc: Mike Rapoport <mike@compulab.co.il>
> > ---
> >
> > Janitorial fix, not tested due to no hardware.
> >
> > ?arch/arm/mach-pxa/viper.c | ? ?5 +++--
> > ?1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> > index 1dd1334..c25921f 100644
> > --- a/arch/arm/mach-pxa/viper.c
> > +++ b/arch/arm/mach-pxa/viper.c
> > @@ -33,6 +33,7 @@
> > ?#include <linux/pm.h>
> > ?#include <linux/sched.h>
> > ?#include <linux/gpio.h>
> > +#include <linux/jiffies.h>
> > ?#include <linux/i2c-gpio.h>
> > ?#include <linux/serial_8250.h>
> > ?#include <linux/smc91x.h>
> > @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
> > ? ? ? ?.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
> > ? ? ? ?.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
> > ? ? ? ?.udelay ?= 10,
> > - ? ? ? .timeout = 100,
> > + ? ? ? .timeout = HZ / 10,
> > ?};
> >
> > ?static struct platform_device i2c_bus_device = {
> > @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
> > ? ? ? ? ? ? ? ?.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
> > ? ? ? ? ? ? ? ?.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
> > ? ? ? ? ? ? ? ?.udelay ?= 10,
> > - ? ? ? ? ? ? ? .timeout = 100,
> > + ? ? ? ? ? ? ? .timeout = HZ / 10,
> > ? ? ? ?};
> > ? ? ? ?char *errstr;
> >
> 
> One other better and cleaner approach to such inconsistency issue is
> to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> to jiffies using msec_to_jiffies() at run-time.

With what benefit? Expressing time values in units of HZ is very
frequent in the kernel code and shouldn't actually surprise anyone.

-- 
Jean Delvare

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

* Re: [PATCH] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-12 19:13         ` Jean Delvare
@ 2010-04-12 19:20             ` Russell King - ARM Linux
  -1 siblings, 0 replies; 28+ messages in thread
From: Russell King - ARM Linux @ 2010-04-12 19:20 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Eric Miao, Wolfram Sang,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Marc Zyngier, Paul Shen,
	Mike Rapoport

On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
> On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> > On Sun, Apr 4, 2010 at 10:08 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > > The timeout value is in jiffies, so it should be using HZ, not a plain
> > > number. Assume '100' means 100ms here and adapt accordingly.
> > >
> > > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > > Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > > Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> > > Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> > > Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> > > Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> > > ---
> > >
> > > Janitorial fix, not tested due to no hardware.
> > >
> > >  arch/arm/mach-pxa/viper.c |    5 +++--
> > >  1 files changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> > > index 1dd1334..c25921f 100644
> > > --- a/arch/arm/mach-pxa/viper.c
> > > +++ b/arch/arm/mach-pxa/viper.c
> > > @@ -33,6 +33,7 @@
> > >  #include <linux/pm.h>
> > >  #include <linux/sched.h>
> > >  #include <linux/gpio.h>
> > > +#include <linux/jiffies.h>
> > >  #include <linux/i2c-gpio.h>
> > >  #include <linux/serial_8250.h>
> > >  #include <linux/smc91x.h>
> > > @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
> > >        .sda_pin = VIPER_RTC_I2C_SDA_GPIO,
> > >        .scl_pin = VIPER_RTC_I2C_SCL_GPIO,
> > >        .udelay  = 10,
> > > -       .timeout = 100,
> > > +       .timeout = HZ / 10,
> > >  };
> > >
> > >  static struct platform_device i2c_bus_device = {
> > > @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
> > >                .sda_pin = VIPER_TPM_I2C_SDA_GPIO,
> > >                .scl_pin = VIPER_TPM_I2C_SCL_GPIO,
> > >                .udelay  = 10,
> > > -               .timeout = 100,
> > > +               .timeout = HZ / 10,
> > >        };
> > >        char *errstr;
> > >
> > 
> > One other better and cleaner approach to such inconsistency issue is
> > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> > to jiffies using msec_to_jiffies() at run-time.
> 
> With what benefit? Expressing time values in units of HZ is very
> frequent in the kernel code and shouldn't actually surprise anyone.

Actually, this patch shows there is confusion.

"Assume '100' means 100ms here and adapt accordingly."

Since this patch is for ARM, where HZ=100, the above patch is not a
simple "convert how we derive this constant" patch - it's a functional
change, reducing the timeouts by a factor of 10.

Could that be because the patch author misinterpreted the HZ-based
values?

I suspect I'm not the only one who thinks that the latter of "HZ / 10"
"100ms" is easier to read and comprehend without mistake.

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

* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-12 19:20             ` Russell King - ARM Linux
  0 siblings, 0 replies; 28+ messages in thread
From: Russell King - ARM Linux @ 2010-04-12 19:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
> On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> > On Sun, Apr 4, 2010 at 10:08 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > > The timeout value is in jiffies, so it should be using HZ, not a plain
> > > number. Assume '100' means 100ms here and adapt accordingly.
> > >
> > > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > > Cc: Eric Miao <eric.y.miao@gmail.com>
> > > Cc: Russell King <linux@arm.linux.org.uk>
> > > Cc: Marc Zyngier <maz@misterjones.org>
> > > Cc: Paul Shen <paul.shen@marvell.com>
> > > Cc: Mike Rapoport <mike@compulab.co.il>
> > > ---
> > >
> > > Janitorial fix, not tested due to no hardware.
> > >
> > > ?arch/arm/mach-pxa/viper.c | ? ?5 +++--
> > > ?1 files changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> > > index 1dd1334..c25921f 100644
> > > --- a/arch/arm/mach-pxa/viper.c
> > > +++ b/arch/arm/mach-pxa/viper.c
> > > @@ -33,6 +33,7 @@
> > > ?#include <linux/pm.h>
> > > ?#include <linux/sched.h>
> > > ?#include <linux/gpio.h>
> > > +#include <linux/jiffies.h>
> > > ?#include <linux/i2c-gpio.h>
> > > ?#include <linux/serial_8250.h>
> > > ?#include <linux/smc91x.h>
> > > @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
> > > ? ? ? ?.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
> > > ? ? ? ?.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
> > > ? ? ? ?.udelay ?= 10,
> > > - ? ? ? .timeout = 100,
> > > + ? ? ? .timeout = HZ / 10,
> > > ?};
> > >
> > > ?static struct platform_device i2c_bus_device = {
> > > @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
> > > ? ? ? ? ? ? ? ?.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
> > > ? ? ? ? ? ? ? ?.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
> > > ? ? ? ? ? ? ? ?.udelay ?= 10,
> > > - ? ? ? ? ? ? ? .timeout = 100,
> > > + ? ? ? ? ? ? ? .timeout = HZ / 10,
> > > ? ? ? ?};
> > > ? ? ? ?char *errstr;
> > >
> > 
> > One other better and cleaner approach to such inconsistency issue is
> > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> > to jiffies using msec_to_jiffies() at run-time.
> 
> With what benefit? Expressing time values in units of HZ is very
> frequent in the kernel code and shouldn't actually surprise anyone.

Actually, this patch shows there is confusion.

"Assume '100' means 100ms here and adapt accordingly."

Since this patch is for ARM, where HZ=100, the above patch is not a
simple "convert how we derive this constant" patch - it's a functional
change, reducing the timeouts by a factor of 10.

Could that be because the patch author misinterpreted the HZ-based
values?

I suspect I'm not the only one who thinks that the latter of "HZ / 10"
"100ms" is easier to read and comprehend without mistake.

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

* Re: [PATCH] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-12 19:20             ` Russell King - ARM Linux
@ 2010-04-12 19:32                 ` Jean Delvare
  -1 siblings, 0 replies; 28+ messages in thread
From: Jean Delvare @ 2010-04-12 19:32 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Eric Miao, Wolfram Sang,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Marc Zyngier, Paul Shen,
	Mike Rapoport

On Mon, 12 Apr 2010 20:20:10 +0100, Russell King - ARM Linux wrote:
> On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
> > On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> > > On Sun, Apr 4, 2010 at 10:08 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > > > The timeout value is in jiffies, so it should be using HZ, not a plain
> > > > number. Assume '100' means 100ms here and adapt accordingly.
> > > >
> > > > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > > > Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > > > Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> > > > Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> > > > Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> > > > Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> > > > ---
> > > >
> > > > Janitorial fix, not tested due to no hardware.
> > > >
> > > >  arch/arm/mach-pxa/viper.c |    5 +++--
> > > >  1 files changed, 3 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> > > > index 1dd1334..c25921f 100644
> > > > --- a/arch/arm/mach-pxa/viper.c
> > > > +++ b/arch/arm/mach-pxa/viper.c
> > > > @@ -33,6 +33,7 @@
> > > >  #include <linux/pm.h>
> > > >  #include <linux/sched.h>
> > > >  #include <linux/gpio.h>
> > > > +#include <linux/jiffies.h>
> > > >  #include <linux/i2c-gpio.h>
> > > >  #include <linux/serial_8250.h>
> > > >  #include <linux/smc91x.h>
> > > > @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
> > > >        .sda_pin = VIPER_RTC_I2C_SDA_GPIO,
> > > >        .scl_pin = VIPER_RTC_I2C_SCL_GPIO,
> > > >        .udelay  = 10,
> > > > -       .timeout = 100,
> > > > +       .timeout = HZ / 10,
> > > >  };
> > > >
> > > >  static struct platform_device i2c_bus_device = {
> > > > @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
> > > >                .sda_pin = VIPER_TPM_I2C_SDA_GPIO,
> > > >                .scl_pin = VIPER_TPM_I2C_SCL_GPIO,
> > > >                .udelay  = 10,
> > > > -               .timeout = 100,
> > > > +               .timeout = HZ / 10,
> > > >        };
> > > >        char *errstr;
> > > >
> > > 
> > > One other better and cleaner approach to such inconsistency issue is
> > > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> > > to jiffies using msec_to_jiffies() at run-time.
> > 
> > With what benefit? Expressing time values in units of HZ is very
> > frequent in the kernel code and shouldn't actually surprise anyone.
> 
> Actually, this patch shows there is confusion.
> 
> "Assume '100' means 100ms here and adapt accordingly."
> 
> Since this patch is for ARM, where HZ=100, the above patch is not a
> simple "convert how we derive this constant" patch - it's a functional
> change, reducing the timeouts by a factor of 10.
> 
> Could that be because the patch author misinterpreted the HZ-based
> values?

I admit I would have assumed 100 -> HZ, as hard-coded HZ-dependent
value typically assume HZ=100.

> I suspect I'm not the only one who thinks that the latter of "HZ / 10"
> "100ms" is easier to read and comprehend without mistake.

OTOH, converting from ms to jiffies each time you need the value has a
cost.

-- 
Jean Delvare

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

* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-12 19:32                 ` Jean Delvare
  0 siblings, 0 replies; 28+ messages in thread
From: Jean Delvare @ 2010-04-12 19:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 12 Apr 2010 20:20:10 +0100, Russell King - ARM Linux wrote:
> On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
> > On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> > > On Sun, Apr 4, 2010 at 10:08 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > > > The timeout value is in jiffies, so it should be using HZ, not a plain
> > > > number. Assume '100' means 100ms here and adapt accordingly.
> > > >
> > > > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > > > Cc: Eric Miao <eric.y.miao@gmail.com>
> > > > Cc: Russell King <linux@arm.linux.org.uk>
> > > > Cc: Marc Zyngier <maz@misterjones.org>
> > > > Cc: Paul Shen <paul.shen@marvell.com>
> > > > Cc: Mike Rapoport <mike@compulab.co.il>
> > > > ---
> > > >
> > > > Janitorial fix, not tested due to no hardware.
> > > >
> > > > ?arch/arm/mach-pxa/viper.c | ? ?5 +++--
> > > > ?1 files changed, 3 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> > > > index 1dd1334..c25921f 100644
> > > > --- a/arch/arm/mach-pxa/viper.c
> > > > +++ b/arch/arm/mach-pxa/viper.c
> > > > @@ -33,6 +33,7 @@
> > > > ?#include <linux/pm.h>
> > > > ?#include <linux/sched.h>
> > > > ?#include <linux/gpio.h>
> > > > +#include <linux/jiffies.h>
> > > > ?#include <linux/i2c-gpio.h>
> > > > ?#include <linux/serial_8250.h>
> > > > ?#include <linux/smc91x.h>
> > > > @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
> > > > ? ? ? ?.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
> > > > ? ? ? ?.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
> > > > ? ? ? ?.udelay ?= 10,
> > > > - ? ? ? .timeout = 100,
> > > > + ? ? ? .timeout = HZ / 10,
> > > > ?};
> > > >
> > > > ?static struct platform_device i2c_bus_device = {
> > > > @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
> > > > ? ? ? ? ? ? ? ?.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
> > > > ? ? ? ? ? ? ? ?.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
> > > > ? ? ? ? ? ? ? ?.udelay ?= 10,
> > > > - ? ? ? ? ? ? ? .timeout = 100,
> > > > + ? ? ? ? ? ? ? .timeout = HZ / 10,
> > > > ? ? ? ?};
> > > > ? ? ? ?char *errstr;
> > > >
> > > 
> > > One other better and cleaner approach to such inconsistency issue is
> > > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> > > to jiffies using msec_to_jiffies() at run-time.
> > 
> > With what benefit? Expressing time values in units of HZ is very
> > frequent in the kernel code and shouldn't actually surprise anyone.
> 
> Actually, this patch shows there is confusion.
> 
> "Assume '100' means 100ms here and adapt accordingly."
> 
> Since this patch is for ARM, where HZ=100, the above patch is not a
> simple "convert how we derive this constant" patch - it's a functional
> change, reducing the timeouts by a factor of 10.
> 
> Could that be because the patch author misinterpreted the HZ-based
> values?

I admit I would have assumed 100 -> HZ, as hard-coded HZ-dependent
value typically assume HZ=100.

> I suspect I'm not the only one who thinks that the latter of "HZ / 10"
> "100ms" is easier to read and comprehend without mistake.

OTOH, converting from ms to jiffies each time you need the value has a
cost.

-- 
Jean Delvare

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

* Re: [PATCH] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-12 19:32                 ` Jean Delvare
@ 2010-04-12 19:39                     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 28+ messages in thread
From: Russell King - ARM Linux @ 2010-04-12 19:39 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Eric Miao, Wolfram Sang,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Marc Zyngier, Paul Shen,
	Mike Rapoport

On Mon, Apr 12, 2010 at 09:32:35PM +0200, Jean Delvare wrote:
> On Mon, 12 Apr 2010 20:20:10 +0100, Russell King - ARM Linux wrote:
> > On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
> > > On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> > > > One other better and cleaner approach to such inconsistency issue is
> > > > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> > > > to jiffies using msec_to_jiffies() at run-time.
> > > 
> > > With what benefit? Expressing time values in units of HZ is very
> > > frequent in the kernel code and shouldn't actually surprise anyone.
> > 
> > Actually, this patch shows there is confusion.
> > 
> > "Assume '100' means 100ms here and adapt accordingly."
> > 
> > Since this patch is for ARM, where HZ=100, the above patch is not a
> > simple "convert how we derive this constant" patch - it's a functional
> > change, reducing the timeouts by a factor of 10.
> > 
> > Could that be because the patch author misinterpreted the HZ-based
> > values?
> 
> I admit I would have assumed 100 -> HZ, as hard-coded HZ-dependent
> value typically assume HZ=100.
> 
> > I suspect I'm not the only one who thinks that the latter of "HZ / 10"
> > "100ms" is easier to read and comprehend without mistake.
> 
> OTOH, converting from ms to jiffies each time you need the value has a
> cost.

True; what I did for MMC stuff is converted it from ms to jiffies at
initialization time when copying it in from platform data in the
driver's probe function.

I'm not saying that I care either way, I'm merely showing that dealing
with HZ-based values can be (maybe unexpectedly) more error prone.

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

* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-12 19:39                     ` Russell King - ARM Linux
  0 siblings, 0 replies; 28+ messages in thread
From: Russell King - ARM Linux @ 2010-04-12 19:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 12, 2010 at 09:32:35PM +0200, Jean Delvare wrote:
> On Mon, 12 Apr 2010 20:20:10 +0100, Russell King - ARM Linux wrote:
> > On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
> > > On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> > > > One other better and cleaner approach to such inconsistency issue is
> > > > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> > > > to jiffies using msec_to_jiffies() at run-time.
> > > 
> > > With what benefit? Expressing time values in units of HZ is very
> > > frequent in the kernel code and shouldn't actually surprise anyone.
> > 
> > Actually, this patch shows there is confusion.
> > 
> > "Assume '100' means 100ms here and adapt accordingly."
> > 
> > Since this patch is for ARM, where HZ=100, the above patch is not a
> > simple "convert how we derive this constant" patch - it's a functional
> > change, reducing the timeouts by a factor of 10.
> > 
> > Could that be because the patch author misinterpreted the HZ-based
> > values?
> 
> I admit I would have assumed 100 -> HZ, as hard-coded HZ-dependent
> value typically assume HZ=100.
> 
> > I suspect I'm not the only one who thinks that the latter of "HZ / 10"
> > "100ms" is easier to read and comprehend without mistake.
> 
> OTOH, converting from ms to jiffies each time you need the value has a
> cost.

True; what I did for MMC stuff is converted it from ms to jiffies at
initialization time when copying it in from platform data in the
driver's probe function.

I'm not saying that I care either way, I'm merely showing that dealing
with HZ-based values can be (maybe unexpectedly) more error prone.

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

* Re: [PATCH] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-12 19:39                     ` Russell King - ARM Linux
@ 2010-04-12 21:53                         ` Jamie Lokier
  -1 siblings, 0 replies; 28+ messages in thread
From: Jamie Lokier @ 2010-04-12 21:53 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Jean Delvare, Paul Shen, Eric Miao, Wolfram Sang,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Mike Rapoport, Marc Zyngier,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Russell King - ARM Linux wrote:
> On Mon, Apr 12, 2010 at 09:32:35PM +0200, Jean Delvare wrote:
> > On Mon, 12 Apr 2010 20:20:10 +0100, Russell King - ARM Linux wrote:
> > > On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
> > > > On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> > > > > One other better and cleaner approach to such inconsistency issue is
> > > > > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> > > > > to jiffies using msec_to_jiffies() at run-time.
> > > > 
> > > > With what benefit? Expressing time values in units of HZ is very
> > > > frequent in the kernel code and shouldn't actually surprise anyone.
> > > 
> > > Actually, this patch shows there is confusion.
> > > 
> > > "Assume '100' means 100ms here and adapt accordingly."
> > > 
> > > Since this patch is for ARM, where HZ=100, the above patch is not a
> > > simple "convert how we derive this constant" patch - it's a functional
> > > change, reducing the timeouts by a factor of 10.
> > > 
> > > Could that be because the patch author misinterpreted the HZ-based
> > > values?
> > 
> > I admit I would have assumed 100 -> HZ, as hard-coded HZ-dependent
> > value typically assume HZ=100.
> > 
> > > I suspect I'm not the only one who thinks that the latter of "HZ / 10"
> > > "100ms" is easier to read and comprehend without mistake.
> > 
> > OTOH, converting from ms to jiffies each time you need the value has a
> > cost.
> 
> True; what I did for MMC stuff is converted it from ms to jiffies at
> initialization time when copying it in from platform data in the
> driver's probe function.
> 
> I'm not saying that I care either way, I'm merely showing that dealing
> with HZ-based values can be (maybe unexpectedly) more error prone.

HZ is used a lot in kernel timeouts, so even though it's confusing, it
is something everyone ought to get used to.

But I agree it is too confusing.  An obvious remedy is:

#define milliseconds(ms) (((ms) * HZ + 999) / 1000)
#define seconds(s)       ((s) * HZ)

-- Jamie

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

* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-12 21:53                         ` Jamie Lokier
  0 siblings, 0 replies; 28+ messages in thread
From: Jamie Lokier @ 2010-04-12 21:53 UTC (permalink / raw)
  To: linux-arm-kernel

Russell King - ARM Linux wrote:
> On Mon, Apr 12, 2010 at 09:32:35PM +0200, Jean Delvare wrote:
> > On Mon, 12 Apr 2010 20:20:10 +0100, Russell King - ARM Linux wrote:
> > > On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
> > > > On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
> > > > > One other better and cleaner approach to such inconsistency issue is
> > > > > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
> > > > > to jiffies using msec_to_jiffies() at run-time.
> > > > 
> > > > With what benefit? Expressing time values in units of HZ is very
> > > > frequent in the kernel code and shouldn't actually surprise anyone.
> > > 
> > > Actually, this patch shows there is confusion.
> > > 
> > > "Assume '100' means 100ms here and adapt accordingly."
> > > 
> > > Since this patch is for ARM, where HZ=100, the above patch is not a
> > > simple "convert how we derive this constant" patch - it's a functional
> > > change, reducing the timeouts by a factor of 10.
> > > 
> > > Could that be because the patch author misinterpreted the HZ-based
> > > values?
> > 
> > I admit I would have assumed 100 -> HZ, as hard-coded HZ-dependent
> > value typically assume HZ=100.
> > 
> > > I suspect I'm not the only one who thinks that the latter of "HZ / 10"
> > > "100ms" is easier to read and comprehend without mistake.
> > 
> > OTOH, converting from ms to jiffies each time you need the value has a
> > cost.
> 
> True; what I did for MMC stuff is converted it from ms to jiffies at
> initialization time when copying it in from platform data in the
> driver's probe function.
> 
> I'm not saying that I care either way, I'm merely showing that dealing
> with HZ-based values can be (maybe unexpectedly) more error prone.

HZ is used a lot in kernel timeouts, so even though it's confusing, it
is something everyone ought to get used to.

But I agree it is too confusing.  An obvious remedy is:

#define milliseconds(ms) (((ms) * HZ + 999) / 1000)
#define seconds(s)       ((s) * HZ)

-- Jamie

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

* Re: [PATCH] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-12 21:53                         ` Jamie Lokier
@ 2010-04-12 23:04                           ` Eric Miao
  -1 siblings, 0 replies; 28+ messages in thread
From: Eric Miao @ 2010-04-12 23:04 UTC (permalink / raw)
  To: Jamie Lokier
  Cc: Russell King - ARM Linux, Wolfram Sang, Marc Zyngier, linux-i2c,
	Mike Rapoport, Jean Delvare, linux-arm-kernel

On Tue, Apr 13, 2010 at 5:53 AM, Jamie Lokier <jamie@shareable.org> wrote:
> Russell King - ARM Linux wrote:
>> On Mon, Apr 12, 2010 at 09:32:35PM +0200, Jean Delvare wrote:
>> > On Mon, 12 Apr 2010 20:20:10 +0100, Russell King - ARM Linux wrote:
>> > > On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
>> > > > On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
>> > > > > One other better and cleaner approach to such inconsistency issue is
>> > > > > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
>> > > > > to jiffies using msec_to_jiffies() at run-time.
>> > > >
>> > > > With what benefit? Expressing time values in units of HZ is very
>> > > > frequent in the kernel code and shouldn't actually surprise anyone.
>> > >
>> > > Actually, this patch shows there is confusion.
>> > >
>> > > "Assume '100' means 100ms here and adapt accordingly."
>> > >
>> > > Since this patch is for ARM, where HZ=100, the above patch is not a
>> > > simple "convert how we derive this constant" patch - it's a functional
>> > > change, reducing the timeouts by a factor of 10.
>> > >
>> > > Could that be because the patch author misinterpreted the HZ-based
>> > > values?
>> >
>> > I admit I would have assumed 100 -> HZ, as hard-coded HZ-dependent
>> > value typically assume HZ=100.
>> >
>> > > I suspect I'm not the only one who thinks that the latter of "HZ / 10"
>> > > "100ms" is easier to read and comprehend without mistake.
>> >
>> > OTOH, converting from ms to jiffies each time you need the value has a
>> > cost.
>>
>> True; what I did for MMC stuff is converted it from ms to jiffies at
>> initialization time when copying it in from platform data in the
>> driver's probe function.
>>
>> I'm not saying that I care either way, I'm merely showing that dealing
>> with HZ-based values can be (maybe unexpectedly) more error prone.
>
> HZ is used a lot in kernel timeouts, so even though it's confusing, it
> is something everyone ought to get used to.

I don't understand why people has to live with confusions where there is
apparently a cleaner way to go. HZ is everywhere, and as long as they
live within their own driver code, that's OK.

>
> But I agree it is too confusing.  An obvious remedy is:
>
> #define milliseconds(ms) (((ms) * HZ + 999) / 1000)
> #define seconds(s)       ((s) * HZ)
>

This is to reinvent the wheel as there are already msecs_to_jiffies()
and usecs_to_jiffies(), and vice versa. The only benefit of using macros
instead of a function is for constants. This, however, can be worked
around as Russell suggested. The additional run-time cost by this
function, compared with a unit of jiffies, is insignificant.

> -- Jamie
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-12 23:04                           ` Eric Miao
  0 siblings, 0 replies; 28+ messages in thread
From: Eric Miao @ 2010-04-12 23:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 13, 2010 at 5:53 AM, Jamie Lokier <jamie@shareable.org> wrote:
> Russell King - ARM Linux wrote:
>> On Mon, Apr 12, 2010 at 09:32:35PM +0200, Jean Delvare wrote:
>> > On Mon, 12 Apr 2010 20:20:10 +0100, Russell King - ARM Linux wrote:
>> > > On Mon, Apr 12, 2010 at 09:13:19PM +0200, Jean Delvare wrote:
>> > > > On Tue, 13 Apr 2010 01:57:51 +0800, Eric Miao wrote:
>> > > > > One other better and cleaner approach to such inconsistency issue is
>> > > > > to have a timeout_ms field, and having i2c-gpio.c driver to convert this
>> > > > > to jiffies using msec_to_jiffies() at run-time.
>> > > >
>> > > > With what benefit? Expressing time values in units of HZ is very
>> > > > frequent in the kernel code and shouldn't actually surprise anyone.
>> > >
>> > > Actually, this patch shows there is confusion.
>> > >
>> > > "Assume '100' means 100ms here and adapt accordingly."
>> > >
>> > > Since this patch is for ARM, where HZ=100, the above patch is not a
>> > > simple "convert how we derive this constant" patch - it's a functional
>> > > change, reducing the timeouts by a factor of 10.
>> > >
>> > > Could that be because the patch author misinterpreted the HZ-based
>> > > values?
>> >
>> > I admit I would have assumed 100 -> HZ, as hard-coded HZ-dependent
>> > value typically assume HZ=100.
>> >
>> > > I suspect I'm not the only one who thinks that the latter of "HZ / 10"
>> > > "100ms" is easier to read and comprehend without mistake.
>> >
>> > OTOH, converting from ms to jiffies each time you need the value has a
>> > cost.
>>
>> True; what I did for MMC stuff is converted it from ms to jiffies at
>> initialization time when copying it in from platform data in the
>> driver's probe function.
>>
>> I'm not saying that I care either way, I'm merely showing that dealing
>> with HZ-based values can be (maybe unexpectedly) more error prone.
>
> HZ is used a lot in kernel timeouts, so even though it's confusing, it
> is something everyone ought to get used to.

I don't understand why people has to live with confusions where there is
apparently a cleaner way to go. HZ is everywhere, and as long as they
live within their own driver code, that's OK.

>
> But I agree it is too confusing. ?An obvious remedy is:
>
> #define milliseconds(ms) (((ms) * HZ + 999) / 1000)
> #define seconds(s) ? ? ? ((s) * HZ)
>

This is to reinvent the wheel as there are already msecs_to_jiffies()
and usecs_to_jiffies(), and vice versa. The only benefit of using macros
instead of a function is for constants. This, however, can be worked
around as Russell suggested. The additional run-time cost by this
function, compared with a unit of jiffies, is insignificant.

> -- Jamie
>

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

* [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-12 19:32                 ` Jean Delvare
@ 2010-04-18 11:48                     ` Wolfram Sang
  -1 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2010-04-18 11:48 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang, Eric Miao,
	Russell King, Marc Zyngier, Paul Shen, Mike Rapoport,
	Jean Delvare

The timeout value is in jiffies, so it should be using HZ, not a plain
number. Assume with HZ=100 '100' means 1s here and adapt accordingly.

Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
---

Changes since V1:

* Don't assume 100 means 100ms

Thanks for the comments!

Admitted, the first try was a really bad guess. Maybe I got distracted from the
previous patch for another arch where the value was 10000.

While this may still not be the favoured solution for Eric, I think it is at
least better than before, so it might be worth applying after all?

Janitorial fix, not tested due to no hardware.

 arch/arm/mach-pxa/viper.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 1dd1334..12cf38c 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -33,6 +33,7 @@
 #include <linux/pm.h>
 #include <linux/sched.h>
 #include <linux/gpio.h>
+#include <linux/jiffies.h>
 #include <linux/i2c-gpio.h>
 #include <linux/serial_8250.h>
 #include <linux/smc91x.h>
@@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
 	.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
 	.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
 	.udelay  = 10,
-	.timeout = 100,
+	.timeout = HZ,
 };
 
 static struct platform_device i2c_bus_device = {
@@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
 		.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
 		.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
 		.udelay  = 10,
-		.timeout = 100,
+		.timeout = HZ,
 	};
 	char *errstr;
 
-- 
1.7.0

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

* [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-18 11:48                     ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2010-04-18 11:48 UTC (permalink / raw)
  To: linux-arm-kernel

The timeout value is in jiffies, so it should be using HZ, not a plain
number. Assume with HZ=100 '100' means 1s here and adapt accordingly.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Marc Zyngier <maz@misterjones.org>
Cc: Paul Shen <paul.shen@marvell.com>
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Jean Delvare <khali@linux-fr.org>
---

Changes since V1:

* Don't assume 100 means 100ms

Thanks for the comments!

Admitted, the first try was a really bad guess. Maybe I got distracted from the
previous patch for another arch where the value was 10000.

While this may still not be the favoured solution for Eric, I think it is at
least better than before, so it might be worth applying after all?

Janitorial fix, not tested due to no hardware.

 arch/arm/mach-pxa/viper.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 1dd1334..12cf38c 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -33,6 +33,7 @@
 #include <linux/pm.h>
 #include <linux/sched.h>
 #include <linux/gpio.h>
+#include <linux/jiffies.h>
 #include <linux/i2c-gpio.h>
 #include <linux/serial_8250.h>
 #include <linux/smc91x.h>
@@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
 	.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
 	.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
 	.udelay  = 10,
-	.timeout = 100,
+	.timeout = HZ,
 };
 
 static struct platform_device i2c_bus_device = {
@@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
 		.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
 		.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
 		.udelay  = 10,
-		.timeout = 100,
+		.timeout = HZ,
 	};
 	char *errstr;
 
-- 
1.7.0

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

* Re: [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-18 11:48                     ` Wolfram Sang
@ 2010-04-20  0:20                         ` Eric Miao
  -1 siblings, 0 replies; 28+ messages in thread
From: Eric Miao @ 2010-04-20  0:20 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Russell King, Marc Zyngier,
	Paul Shen, Mike Rapoport, Jean Delvare

On Sun, Apr 18, 2010 at 7:48 PM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> The timeout value is in jiffies, so it should be using HZ, not a plain
> number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
>
> Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> ---
>
> Changes since V1:
>
> * Don't assume 100 means 100ms
>
> Thanks for the comments!
>
> Admitted, the first try was a really bad guess. Maybe I got distracted from the
> previous patch for another arch where the value was 10000.
>
> While this may still not be the favoured solution for Eric, I think it is at
> least better than before, so it might be worth applying after all?

Ack. The clearest fix would involve more code to be updated, which
can be postponed. This fix, at least, makes the time quantity clearer.

>
> Janitorial fix, not tested due to no hardware.
>
>  arch/arm/mach-pxa/viper.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> index 1dd1334..12cf38c 100644
> --- a/arch/arm/mach-pxa/viper.c
> +++ b/arch/arm/mach-pxa/viper.c
> @@ -33,6 +33,7 @@
>  #include <linux/pm.h>
>  #include <linux/sched.h>
>  #include <linux/gpio.h>
> +#include <linux/jiffies.h>
>  #include <linux/i2c-gpio.h>
>  #include <linux/serial_8250.h>
>  #include <linux/smc91x.h>
> @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
>        .sda_pin = VIPER_RTC_I2C_SDA_GPIO,
>        .scl_pin = VIPER_RTC_I2C_SCL_GPIO,
>        .udelay  = 10,
> -       .timeout = 100,
> +       .timeout = HZ,
>  };
>
>  static struct platform_device i2c_bus_device = {
> @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
>                .sda_pin = VIPER_TPM_I2C_SDA_GPIO,
>                .scl_pin = VIPER_TPM_I2C_SCL_GPIO,
>                .udelay  = 10,
> -               .timeout = 100,
> +               .timeout = HZ,
>        };
>        char *errstr;
>
> --
> 1.7.0
>
>

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

* [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-20  0:20                         ` Eric Miao
  0 siblings, 0 replies; 28+ messages in thread
From: Eric Miao @ 2010-04-20  0:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Apr 18, 2010 at 7:48 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> The timeout value is in jiffies, so it should be using HZ, not a plain
> number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Marc Zyngier <maz@misterjones.org>
> Cc: Paul Shen <paul.shen@marvell.com>
> Cc: Mike Rapoport <mike@compulab.co.il>
> Cc: Jean Delvare <khali@linux-fr.org>
> ---
>
> Changes since V1:
>
> * Don't assume 100 means 100ms
>
> Thanks for the comments!
>
> Admitted, the first try was a really bad guess. Maybe I got distracted from the
> previous patch for another arch where the value was 10000.
>
> While this may still not be the favoured solution for Eric, I think it is at
> least better than before, so it might be worth applying after all?

Ack. The clearest fix would involve more code to be updated, which
can be postponed. This fix, at least, makes the time quantity clearer.

>
> Janitorial fix, not tested due to no hardware.
>
> ?arch/arm/mach-pxa/viper.c | ? ?5 +++--
> ?1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> index 1dd1334..12cf38c 100644
> --- a/arch/arm/mach-pxa/viper.c
> +++ b/arch/arm/mach-pxa/viper.c
> @@ -33,6 +33,7 @@
> ?#include <linux/pm.h>
> ?#include <linux/sched.h>
> ?#include <linux/gpio.h>
> +#include <linux/jiffies.h>
> ?#include <linux/i2c-gpio.h>
> ?#include <linux/serial_8250.h>
> ?#include <linux/smc91x.h>
> @@ -453,7 +454,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
> ? ? ? ?.sda_pin = VIPER_RTC_I2C_SDA_GPIO,
> ? ? ? ?.scl_pin = VIPER_RTC_I2C_SCL_GPIO,
> ? ? ? ?.udelay ?= 10,
> - ? ? ? .timeout = 100,
> + ? ? ? .timeout = HZ,
> ?};
>
> ?static struct platform_device i2c_bus_device = {
> @@ -778,7 +779,7 @@ static void __init viper_tpm_init(void)
> ? ? ? ? ? ? ? ?.sda_pin = VIPER_TPM_I2C_SDA_GPIO,
> ? ? ? ? ? ? ? ?.scl_pin = VIPER_TPM_I2C_SCL_GPIO,
> ? ? ? ? ? ? ? ?.udelay ?= 10,
> - ? ? ? ? ? ? ? .timeout = 100,
> + ? ? ? ? ? ? ? .timeout = HZ,
> ? ? ? ?};
> ? ? ? ?char *errstr;
>
> --
> 1.7.0
>
>

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

* Re: [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-20  0:20                         ` Eric Miao
@ 2010-04-20  1:03                             ` Wolfram Sang
  -1 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2010-04-20  1:03 UTC (permalink / raw)
  To: Eric Miao
  Cc: Paul Shen, Russell King, Jean Delvare,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Mike Rapoport, Marc Zyngier,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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

On Tue, Apr 20, 2010 at 08:20:46AM +0800, Eric Miao wrote:
> On Sun, Apr 18, 2010 at 7:48 PM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> > The timeout value is in jiffies, so it should be using HZ, not a plain
> > number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
> >
> > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> > Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> > Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> > Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> > Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> > ---
> >
> > Changes since V1:
> >
> > * Don't assume 100 means 100ms
> >
> > Thanks for the comments!
> >
> > Admitted, the first try was a really bad guess. Maybe I got distracted from the
> > previous patch for another arch where the value was 10000.
> >
> > While this may still not be the favoured solution for Eric, I think it is at
> > least better than before, so it might be worth applying after all?
> 
> Ack. The clearest fix would involve more code to be updated, which
> can be postponed. This fix, at least, makes the time quantity clearer.

Thanks. Can you pick it up? Because it is a change to a board-file.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-20  1:03                             ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2010-04-20  1:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 20, 2010 at 08:20:46AM +0800, Eric Miao wrote:
> On Sun, Apr 18, 2010 at 7:48 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > The timeout value is in jiffies, so it should be using HZ, not a plain
> > number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
> >
> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > Cc: Eric Miao <eric.y.miao@gmail.com>
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Marc Zyngier <maz@misterjones.org>
> > Cc: Paul Shen <paul.shen@marvell.com>
> > Cc: Mike Rapoport <mike@compulab.co.il>
> > Cc: Jean Delvare <khali@linux-fr.org>
> > ---
> >
> > Changes since V1:
> >
> > * Don't assume 100 means 100ms
> >
> > Thanks for the comments!
> >
> > Admitted, the first try was a really bad guess. Maybe I got distracted from the
> > previous patch for another arch where the value was 10000.
> >
> > While this may still not be the favoured solution for Eric, I think it is at
> > least better than before, so it might be worth applying after all?
> 
> Ack. The clearest fix would involve more code to be updated, which
> can be postponed. This fix, at least, makes the time quantity clearer.

Thanks. Can you pick it up? Because it is a change to a board-file.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100420/8019b103/attachment.sig>

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

* Re: [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-18 11:48                     ` Wolfram Sang
@ 2010-04-20  8:27                         ` Marc Zyngier
  -1 siblings, 0 replies; 28+ messages in thread
From: Marc Zyngier @ 2010-04-20  8:27 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Eric Miao, Russell King,
	Paul Shen, Mike Rapoport, Jean Delvare


On Sun, 18 Apr 2010 13:48:29 +0200, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
wrote:
> The timeout value is in jiffies, so it should be using HZ, not a plain
> number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
> 
> Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>

Acked-by: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>

Eric, can you merge this directly via your -devel branch?

Thanks,

        M.
-- 
Who you jivin' with that Cosmik Debris?

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

* [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-20  8:27                         ` Marc Zyngier
  0 siblings, 0 replies; 28+ messages in thread
From: Marc Zyngier @ 2010-04-20  8:27 UTC (permalink / raw)
  To: linux-arm-kernel


On Sun, 18 Apr 2010 13:48:29 +0200, Wolfram Sang <w.sang@pengutronix.de>
wrote:
> The timeout value is in jiffies, so it should be using HZ, not a plain
> number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
> 
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Marc Zyngier <maz@misterjones.org>
> Cc: Paul Shen <paul.shen@marvell.com>
> Cc: Mike Rapoport <mike@compulab.co.il>
> Cc: Jean Delvare <khali@linux-fr.org>

Acked-by: Marc Zyngier <maz@misterjones.org>

Eric, can you merge this directly via your -devel branch?

Thanks,

        M.
-- 
Who you jivin' with that Cosmik Debris?

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

* Re: [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-20  8:27                         ` Marc Zyngier
@ 2010-04-20  8:40                           ` Marek Vasut
  -1 siblings, 0 replies; 28+ messages in thread
From: Marek Vasut @ 2010-04-20  8:40 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Marc Zyngier, Wolfram Sang, Paul Shen, Russell King,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Mike Rapoport, Jean Delvare,
	Eric Miao

Dne Út 20. dubna 2010 10:27:00 Marc Zyngier napsal(a):
> On Sun, 18 Apr 2010 13:48:29 +0200, Wolfram Sang <w.sang@pengutronix.de>
> 
> wrote:
> > The timeout value is in jiffies, so it should be using HZ, not a plain
> > number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
> > 
> > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> > Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> > Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> > Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> > Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> 
> Acked-by: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
> 
> Eric, can you merge this directly via your -devel branch?
> 
> Thanks,
> 
>         M.

And possibly updating your git tree? There are a few patches in -next that will 
need it's arm counterpart.

Cheers

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

* [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-20  8:40                           ` Marek Vasut
  0 siblings, 0 replies; 28+ messages in thread
From: Marek Vasut @ 2010-04-20  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

Dne ?t 20. dubna 2010 10:27:00 Marc Zyngier napsal(a):
> On Sun, 18 Apr 2010 13:48:29 +0200, Wolfram Sang <w.sang@pengutronix.de>
> 
> wrote:
> > The timeout value is in jiffies, so it should be using HZ, not a plain
> > number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
> > 
> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > Cc: Eric Miao <eric.y.miao@gmail.com>
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Marc Zyngier <maz@misterjones.org>
> > Cc: Paul Shen <paul.shen@marvell.com>
> > Cc: Mike Rapoport <mike@compulab.co.il>
> > Cc: Jean Delvare <khali@linux-fr.org>
> 
> Acked-by: Marc Zyngier <maz@misterjones.org>
> 
> Eric, can you merge this directly via your -devel branch?
> 
> Thanks,
> 
>         M.

And possibly updating your git tree? There are a few patches in -next that will 
need it's arm counterpart.

Cheers

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

* Re: [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
  2010-04-20  8:40                           ` Marek Vasut
@ 2010-04-20  9:21                               ` Eric Miao
  -1 siblings, 0 replies; 28+ messages in thread
From: Eric Miao @ 2010-04-20  9:21 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Marc Zyngier,
	Wolfram Sang, Paul Shen, Russell King,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Mike Rapoport, Jean Delvare

On Tue, Apr 20, 2010 at 4:40 PM, Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Dne Út 20. dubna 2010 10:27:00 Marc Zyngier napsal(a):
>> On Sun, 18 Apr 2010 13:48:29 +0200, Wolfram Sang <w.sang@pengutronix.de>
>>
>> wrote:
>> > The timeout value is in jiffies, so it should be using HZ, not a plain
>> > number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
>> >
>> > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>> > Cc: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> > Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
>> > Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
>> > Cc: Paul Shen <paul.shen-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
>> > Cc: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
>> > Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
>>
>> Acked-by: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
>>
>> Eric, can you merge this directly via your -devel branch?
>>
>> Thanks,
>>
>>         M.
>
> And possibly updating your git tree? There are a few patches in -next that will
> need it's arm counterpart.
>

Merged and updated.

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

* [PATCH V2] mach-pxa/viper: Fix timeout usage for I2C
@ 2010-04-20  9:21                               ` Eric Miao
  0 siblings, 0 replies; 28+ messages in thread
From: Eric Miao @ 2010-04-20  9:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 20, 2010 at 4:40 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Dne ?t 20. dubna 2010 10:27:00 Marc Zyngier napsal(a):
>> On Sun, 18 Apr 2010 13:48:29 +0200, Wolfram Sang <w.sang@pengutronix.de>
>>
>> wrote:
>> > The timeout value is in jiffies, so it should be using HZ, not a plain
>> > number. Assume with HZ=100 '100' means 1s here and adapt accordingly.
>> >
>> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
>> > Cc: Eric Miao <eric.y.miao@gmail.com>
>> > Cc: Russell King <linux@arm.linux.org.uk>
>> > Cc: Marc Zyngier <maz@misterjones.org>
>> > Cc: Paul Shen <paul.shen@marvell.com>
>> > Cc: Mike Rapoport <mike@compulab.co.il>
>> > Cc: Jean Delvare <khali@linux-fr.org>
>>
>> Acked-by: Marc Zyngier <maz@misterjones.org>
>>
>> Eric, can you merge this directly via your -devel branch?
>>
>> Thanks,
>>
>> ? ? ? ? M.
>
> And possibly updating your git tree? There are a few patches in -next that will
> need it's arm counterpart.
>

Merged and updated.

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

end of thread, other threads:[~2010-04-20  9:21 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-04 14:08 [PATCH] mach-pxa/viper: Fix timeout usage for I2C Wolfram Sang
2010-04-04 14:08 ` Wolfram Sang
     [not found] ` <1270390118-1802-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-04-12 17:57   ` Eric Miao
2010-04-12 17:57     ` Eric Miao
     [not found]     ` <m2rf17812d71004121057n5131d025pb4965f45b61271f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-12 19:13       ` Jean Delvare
2010-04-12 19:13         ` Jean Delvare
     [not found]         ` <20100412211319.5a43c65b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-12 19:20           ` Russell King - ARM Linux
2010-04-12 19:20             ` Russell King - ARM Linux
     [not found]             ` <20100412192010.GM3048-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2010-04-12 19:32               ` Jean Delvare
2010-04-12 19:32                 ` Jean Delvare
     [not found]                 ` <20100412213235.1688dda8-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-12 19:39                   ` Russell King - ARM Linux
2010-04-12 19:39                     ` Russell King - ARM Linux
     [not found]                     ` <20100412193943.GP3048-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2010-04-12 21:53                       ` Jamie Lokier
2010-04-12 21:53                         ` Jamie Lokier
2010-04-12 23:04                         ` Eric Miao
2010-04-12 23:04                           ` Eric Miao
2010-04-18 11:48                   ` [PATCH V2] " Wolfram Sang
2010-04-18 11:48                     ` Wolfram Sang
     [not found]                     ` <1271591309-22567-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-04-20  0:20                       ` Eric Miao
2010-04-20  0:20                         ` Eric Miao
     [not found]                         ` <z2xf17812d71004191720o3f8660a4kdd31ef9cdb6beae9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-20  1:03                           ` Wolfram Sang
2010-04-20  1:03                             ` Wolfram Sang
2010-04-20  8:27                       ` Marc Zyngier
2010-04-20  8:27                         ` Marc Zyngier
2010-04-20  8:40                         ` Marek Vasut
2010-04-20  8:40                           ` Marek Vasut
     [not found]                           ` <201004201040.00739.marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-04-20  9:21                             ` Eric Miao
2010-04-20  9:21                               ` Eric Miao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.