Skip to contentSkip to conversation

watchdog: s3c2410_wdt: Only register for cpufreq on CPU_FREQ_S3C24XX

PATCH Superseded Doug Anderson 5 participants 11 messages Nov 25, 2013 – Jan 8, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: s3c2410_wdt: Only register for cpufreq on CPU_FREQ_S3C24XX

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CPU_FREQ_S3C24XX defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need CPU_FREQ_S3C24XX defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

---
 drivers/watchdog/s3c2410_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/s3c2410_wdt.c +1 -1
index 7d8fd04..4980f84 100644
@@ -264,7 +264,7 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void *param)
 	return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_CPU_FREQ
+#ifdef CONFIG_CPU_FREQ_S3C24XX
 
 static int s3c2410wdt_cpufreq_transition(struct notifier_block *nb,
 					  unsigned long val, void *data)
Signature · 1 line
1.8.4.1
maintainer
#1 lore raw
Quoted 25 lines · Doug Anderson

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CPU_FREQ_S3C24XX defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need CPU_FREQ_S3C24XX defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

---
  drivers/watchdog/s3c2410_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/s3c2410_wdt.c +0 -0
index 7d8fd04..4980f84 100644

drivers/watchdog/s3c2410_wdt.c static irqreturn_t s3c2410wdt_irq(int irqno, void *param) · line 268

Quoted 6 lines
drivers/watchdog/s3c2410_wdt.c +1 -1
@@ -264,7 +264,7 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void *param)
  	return IRQ_HANDLED;
  }
 
-#ifdef CONFIG_CPU_FREQ
+#ifdef CONFIG_CPU_FREQ_S3C24XX
 

Where is the CPU_FREQ_S3C24XX configuration option defined ? I don't see it in the current upstream kernel, so it appears that this depends on some out-of-tree changes.

Thanks,
Guenter

#2 lore raw
Quoted 29 lines · On Monday 25 of November 2013 15:23:27 Guenter Roeck wrote:
Quoted 28 lines · Doug Anderson

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CPU_FREQ_S3C24XX defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need CPU_FREQ_S3C24XX defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

---
  drivers/watchdog/s3c2410_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/s3c2410_wdt.c +0 -0
index 7d8fd04..4980f84 100644
@@ -264,7 +264,7 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void *param)
  	return IRQ_HANDLED;
  }
 
Quoted 6 lines

drivers/watchdog/s3c2410_wdt.c static irqreturn_t s3c2410wdt_irq(int irqno, void *param) · line 268

Quoted 3 lines
drivers/watchdog/s3c2410_wdt.c +1 -1
-#ifdef CONFIG_CPU_FREQ
+#ifdef CONFIG_CPU_FREQ_S3C24XX
 

Where is the CPU_FREQ_S3C24XX configuration option defined ? I don't see it in the current upstream kernel, so it appears that this depends on some out-of-tree changes.

Seems like it got renamed to ARM_S3C24XX_CPUFREQ by f023f8dd59.

Best regards,
Tomasz

#3 lore raw
In reply to Guenter Roeck

Guenter,

Quoted 32 lines · Guenter Roeck
Quoted 31 lines · Doug Anderson

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CPU_FREQ_S3C24XX defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need CPU_FREQ_S3C24XX defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

---
  drivers/watchdog/s3c2410_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/s3c2410_wdt.c +0 -0
index 7d8fd04..4980f84 100644
@@ -264,7 +264,7 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void
 *param)
        return IRQ_HANDLED;
  }
 
Quoted 6 lines

drivers/watchdog/s3c2410_wdt.c static irqreturn_t s3c2410wdt_irq(int irqno, void *param) · line 268

Quoted 3 lines
drivers/watchdog/s3c2410_wdt.c +1 -1
-#ifdef CONFIG_CPU_FREQ
+#ifdef CONFIG_CPU_FREQ_S3C24XX
 

Where is the CPU_FREQ_S3C24XX configuration option defined ? I don't see it in the current upstream kernel, so it appears that this depends on some out-of-tree changes.

Whoops! I guess I just trusted another patch and didn't dig. I was basing this on https://patchwork.kernel.org/patch/3023421/

Ah, I see that Tomasz just found the answer. I'll update my patch.

-Doug

#4 lore raw
Quoted 42 lines · On Monday 25 of November 2013 15:28:29 Doug Anderson wrote:

Guenter,

Quoted 32 lines · Guenter Roeck
Quoted 31 lines · Doug Anderson

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CPU_FREQ_S3C24XX defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need CPU_FREQ_S3C24XX defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

---
  drivers/watchdog/s3c2410_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/s3c2410_wdt.c +0 -0
index 7d8fd04..4980f84 100644
@@ -264,7 +264,7 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void
 *param)
        return IRQ_HANDLED;
  }
 
Quoted 6 lines

drivers/watchdog/s3c2410_wdt.c static irqreturn_t s3c2410wdt_irq(int irqno, void *param) · line 268

Quoted 3 lines
drivers/watchdog/s3c2410_wdt.c +1 -1
-#ifdef CONFIG_CPU_FREQ
+#ifdef CONFIG_CPU_FREQ_S3C24XX
 

Where is the CPU_FREQ_S3C24XX configuration option defined ? I don't see it in the current upstream kernel, so it appears that this depends on some out-of-tree changes.

Quoted 4 lines

Whoops! I guess I just trusted another patch and didn't dig. I was basing this on https://patchwork.kernel.org/patch/3023421/

Ah, I see that Tomasz just found the answer. I'll update my patch.

Seems like I originally gave you the wrong symbol name, looking at our internal 3.10 tree, where the rename is not present yet, and nobody noticed. Sorry for that.

Best regards,
Tomasz

#5 lore raw

PATCH v2 1/1 watchdog: s3c2410_wdt: Only register for cpufreq on ARM_S3C24XX_CPUFREQ

In reply to Doug Anderson

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CONFIG_ARM_S3C24XX_CPUFREQ defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need ARM_S3C24XX_CPUFREQ defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

---
Changes in v2:
- Use the updated config name.

 drivers/watchdog/s3c2410_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/s3c2410_wdt.c +1 -1
index 7d8fd04..c1ada33 100644
@@ -264,7 +264,7 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void *param)
 	return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_CPU_FREQ
+#ifdef CONFIG_ARM_S3C24XX_CPUFREQ
 
 static int s3c2410wdt_cpufreq_transition(struct notifier_block *nb,
 					  unsigned long val, void *data)
Signature · 1 line
1.8.4.1
Reviewed-by on v2 1/1
#6 lore raw

Re: [PATCH v2] watchdog: s3c2410_wdt: Only register for cpufreq on ARM_S3C24XX_CPUFREQ

Quoted 15 lines · On Monday 25 of November 2013 15:36:43 Doug Anderson wrote:

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CONFIG_ARM_S3C24XX_CPUFREQ defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need ARM_S3C24XX_CPUFREQ defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

Quoted 7 lines

---
Changes in v2:
- Use the updated config name.

 drivers/watchdog/s3c2410_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Best regards,
Tomasz

maintainer Reviewed-by on v2 1/1
#7 lore raw

Re: [PATCH v2] watchdog: s3c2410_wdt: Only register for cpufreq on ARM_S3C24XX_CPUFREQ

In reply to Doug Anderson
Quoted 15 lines · Doug Anderson

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CONFIG_ARM_S3C24XX_CPUFREQ defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need ARM_S3C24XX_CPUFREQ defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

Quoted 1 line
#8 lore raw

Re: [PATCH v2] watchdog: s3c2410_wdt: Only register for cpufreq on ARM_S3C24XX_CPUFREQ

In reply to Doug Anderson

Hi Doug,

Quoted 15 lines

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CONFIG_ARM_S3C24XX_CPUFREQ defined.

Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need ARM_S3C24XX_CPUFREQ defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework.

Quoted 4 lines

---
Changes in v2:
- Use the updated config name.

Patch added to linux-watchdog-next.

Kind regards,
Wim.

#9 lore raw
In reply to Doug Anderson
Quoted 5 lines · Doug Anderson

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CPU_FREQ_S3C24XX defined.

The S3C2410 to at-least S3C2440 there is only one PLL/clock-divider set so changing any part of that can change frequency supplied to the watchdog.

#10 lore raw
Quoted 10 lines · On Tuesday 26 of November 2013 00:08:31 Ben Dooks wrote:
Quoted 5 lines · Doug Anderson

On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CPU_FREQ_S3C24XX defined.

The S3C2410 to at-least S3C2440 there is only one PLL/clock-divider set so changing any part of that can change frequency supplied to the watchdog.

And so we're leaving the notifier code intact, just changing the ifdef conditionm which decides whether it should be compiled in, from a (too) generic one to an S3C24xx-specific one.

Best regards,
Tomasz