atom feed294 messages in org.kernel.vger.linux-rt-usersRe: [PATCH RT 8/6] [ARM, WATCHDOG] da...
FromSent OnAttachments
141 earlier messages
Thomas GleixnerJun 12, 2009 10:31 am 
Thomas GleixnerJun 15, 2009 2:19 am 
Wolfgang Johann BETZJun 16, 2009 6:49 am 
Thomas GleixnerJun 17, 2009 1:45 am 
Thomas GleixnerJun 23, 2009 5:30 am 
Thomas GleixnerJul 9, 2009 11:25 am 
Fernando Lopez-LezcanoJul 10, 2009 11:02 am 
Fernando Lopez-LezcanoJul 10, 2009 11:06 am 
Thomas GleixnerJul 10, 2009 11:29 am 
Fernando Lopez-LezcanoJul 10, 2009 5:16 pm 
Jaswinder Singh RajputJul 14, 2009 2:12 am 
Thomas GleixnerJul 29, 2009 5:47 pm 
Tim BlechmannJul 30, 2009 2:56 am.patch
Darren HartJul 30, 2009 4:03 pm 
Clark WilliamsJul 31, 2009 7:12 am 
Frederic WeisbeckerJul 31, 2009 4:21 pm 
Darren HartJul 31, 2009 5:41 pm 
Frederic WeisbeckerJul 31, 2009 6:19 pm 
Thomas MeyerAug 1, 2009 2:48 am 
john stultzAug 4, 2009 6:29 pm 
gowrishankarAug 4, 2009 11:05 pm 
Clark WilliamsAug 5, 2009 6:32 am 
Will SchmidtAug 5, 2009 12:19 pm 
gowrishankarAug 5, 2009 11:45 pm 
Clark WilliamsAug 6, 2009 7:36 am 
Sven-Thorsten DietrichAug 6, 2009 7:46 am 
John KacurAug 6, 2009 7:54 am 
gowrishankarAug 6, 2009 9:39 am 
Sripathi KodiAug 6, 2009 9:25 pm 
Darren HartAug 7, 2009 7:29 am 
Uwe Kleine-KönigAug 7, 2009 1:39 pm 
Uwe Kleine-KönigAug 7, 2009 1:42 pm 
Uwe Kleine-KönigAug 7, 2009 1:42 pm 
Uwe Kleine-KönigAug 7, 2009 1:42 pm 
Uwe Kleine-KönigAug 7, 2009 1:42 pm 
Uwe Kleine-KönigAug 7, 2009 1:42 pm 
Uwe Kleine-KönigAug 7, 2009 1:42 pm 
Uwe Kleine-KönigAug 7, 2009 1:53 pm 
Uwe Kleine-KönigAug 7, 2009 1:54 pm 
Mark BrownAug 8, 2009 12:57 am 
Uwe Kleine-KönigAug 9, 2009 2:36 am 
Uwe Kleine-KönigAug 9, 2009 2:36 am 
Uwe Kleine-KönigAug 9, 2009 2:36 am 
Russell King - ARM LinuxAug 9, 2009 2:42 am 
David MillerAug 9, 2009 9:48 pm 
Uwe Kleine-KönigAug 10, 2009 2:40 am 
David MillerAug 10, 2009 8:00 am 
Kevin HilmanAug 10, 2009 9:47 am 
Russell King - ARM LinuxAug 10, 2009 10:26 am 
Kevin HilmanAug 10, 2009 2:03 pm 
Russell King - ARM LinuxAug 10, 2009 3:02 pm 
Jan EngelhardtAug 11, 2009 3:51 am 
Thomas GleixnerAug 11, 2009 11:08 am 
Will SchmidtAug 12, 2009 1:45 pm 
Thomas GleixnerAug 13, 2009 12:29 am 
Will SchmidtAug 13, 2009 8:04 am 
Kevin HilmanAug 13, 2009 8:05 am 
Uwe Kleine-KönigAug 13, 2009 2:33 pm 
Peter ZijlstraAug 14, 2009 7:02 am 
Nicolas PitreAug 14, 2009 8:58 am 
Uwe Kleine-KönigAug 14, 2009 1:12 pm 
Wim Van SebroeckAug 16, 2009 7:08 am 
Thomas GleixnerAug 16, 2009 1:41 pm 
Dale StimsonAug 17, 2009 9:07 am 
Thomas GleixnerAug 18, 2009 1:03 pm 
Will SchmidtAug 18, 2009 2:04 pm 
Thomas GleixnerAug 18, 2009 2:13 pm 
john stultzAug 18, 2009 3:30 pm 
john stultzAug 18, 2009 3:49 pm 
Will SchmidtAug 18, 2009 4:12 pm 
john stultzAug 18, 2009 5:17 pm.rt
Will SchmidtAug 19, 2009 10:11 am 
Thomas GleixnerAug 19, 2009 2:48 pm 
john stultzAug 19, 2009 7:18 pm 
Dinakar GuniguntalaAug 20, 2009 8:28 am 
Thomas GleixnerAug 21, 2009 2:26 pm 
Mark KnechtAug 21, 2009 3:57 pm 
Thomas GleixnerAug 26, 2009 10:23 am 
Kevin HilmanAug 27, 2009 4:02 am 
Thomas GleixnerAug 28, 2009 2:35 pm 
Wu ZhangjinSep 2, 2009 8:25 am 
Jan EngelhardtSep 12, 2009 2:44 am 
Thomas GleixnerSep 15, 2009 2:11 pm 
Thomas GleixnerSep 15, 2009 3:29 pm 
Thomas GleixnerSep 18, 2009 3:38 pm 
Jaswinder Singh RajputSep 18, 2009 9:34 pm 
Steven RostedtSep 19, 2009 6:37 am 
Jaswinder Singh RajputSep 19, 2009 8:01 am 
Jon MastersSep 20, 2009 4:22 pm 
Mark KnechtSep 20, 2009 4:34 pm 
Darren HartSep 22, 2009 11:31 am 
Clark WilliamsSep 22, 2009 12:00 pm 
Jan BlunckSep 23, 2009 8:39 am 
Darren HartSep 23, 2009 9:18 am 
Thomas GleixnerSep 23, 2009 9:24 am 
Will SchmidtSep 23, 2009 2:33 pm 
Jan BlunckSep 24, 2009 8:16 am 
Thomas GleixnerOct 6, 2009 3:15 am 
Remy BohmerOct 6, 2009 11:23 am 
Thomas GleixnerOct 6, 2009 12:22 pm 
53 later messages
Subject:Re: [PATCH RT 8/6] [ARM, WATCHDOG] davinci: include mach/timex.h in davinci_wdt.c
From:Kevin Hilman (khil@deeprootsystems.com)
Date:Aug 10, 2009 2:03:53 pm
List:org.kernel.vger.linux-rt-users

Russell King - ARM Linux <lin@arm.linux.org.uk> writes:

On Mon, Aug 10, 2009 at 09:48:07AM -0700, Kevin Hilman wrote:

diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index 83e22e7..5ed89e4 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c @@ -25,6 +25,7 @@ #include <linux/uaccess.h> #include <linux/io.h> #include <linux/device.h> +#include <linux/clk.h>

#define MODULE_NAME "DAVINCI-WDT: "

@@ -69,6 +70,7 @@ static unsigned long wdt_status;

static struct resource *wdt_mem; static void __iomem *wdt_base; +struct clk *wdt_clk;

Why the random spacing?

oops, not tabified.

static void wdt_service(void) { @@ -86,6 +88,10 @@ static void wdt_enable(void) { u32 tgcr; u32 timer_margin; + u32 wdt_freq; + + BUG_ON(!wdt_clk);

BUG_ON here is not required (and wrong).

removed.

+ wdt_freq = clk_get_rate(wdt_clk);

spin_lock(&io_lock);

@@ -99,9 +105,9 @@ static void wdt_enable(void) iowrite32(0, wdt_base + TIM12); iowrite32(0, wdt_base + TIM34); /* set timeout period */ - timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) & 0xffffffff); + timer_margin = (((u64)heartbeat * wdt_freq) & 0xffffffff); iowrite32(timer_margin, wdt_base + PRD12); - timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) >> 32); + timer_margin = (((u64)heartbeat * wdt_freq) >> 32); iowrite32(timer_margin, wdt_base + PRD34); /* enable run continuously */ iowrite32(ENAMODE12_PERIODIC, wdt_base + TCR); @@ -199,6 +205,11 @@ static int __devinit davinci_wdt_probe(struct
platform_device *pdev) struct resource *res; struct device *dev = &pdev->dev;

+ wdt_clk = clk_get(dev, NULL); + if (WARN_ON(!wdt_clk)) + return -ENODEV;

if (WARN_ON(IS_ERR(wdt_clk))) return PTR_ERR(wdt_clk);

fixed.

+ clk_enable(wdt_clk); + if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT) heartbeat = DEFAULT_HEARTBEAT;

@@ -245,6 +256,12 @@ static int __devexit davinci_wdt_remove(struct
platform_device *pdev) kfree(wdt_mem); wdt_mem = NULL; } + + if (wdt_clk) {

NULL check is not required.

removed.

+ clk_disable(wdt_clk); + clk_put(wdt_clk); + } + return 0; }

Updated version:

From c7b99413b5323a5f7faa00e86d623b0711fcd0d0 Mon Sep 17 00:00:00 2001 From: Kevin Hilman <khil@deeprootsystems.com> Date: Tue, 10 Feb 2009 20:30:37 -0800 Subject: [PATCH] watchdog: davinci: use clock framework for timer frequency

Remove use of CLOCK_TICK_RATE in favor of using clock framework for getting timer frequency.

Signed-off-by: Kevin Hilman <khil@deeprootsystems.com>

--- drivers/watchdog/davinci_wdt.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index 83e22e7..43c42f5 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c @@ -25,6 +25,7 @@ #include <linux/uaccess.h> #include <linux/io.h> #include <linux/device.h> +#include <linux/clk.h>

#define MODULE_NAME "DAVINCI-WDT: "

@@ -69,6 +70,7 @@ static unsigned long wdt_status;

static struct resource *wdt_mem; static void __iomem *wdt_base; +struct clk *wdt_clk;

static void wdt_service(void) { @@ -86,6 +88,9 @@ static void wdt_enable(void) { u32 tgcr; u32 timer_margin; + u32 wdt_freq; + + wdt_freq = clk_get_rate(wdt_clk);

spin_lock(&io_lock);

@@ -99,9 +104,9 @@ static void wdt_enable(void) iowrite32(0, wdt_base + TIM12); iowrite32(0, wdt_base + TIM34); /* set timeout period */ - timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) & 0xffffffff); + timer_margin = (((u64)heartbeat * wdt_freq) & 0xffffffff); iowrite32(timer_margin, wdt_base + PRD12); - timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) >> 32); + timer_margin = (((u64)heartbeat * wdt_freq) >> 32); iowrite32(timer_margin, wdt_base + PRD34); /* enable run continuously */ iowrite32(ENAMODE12_PERIODIC, wdt_base + TCR); @@ -199,6 +204,12 @@ static int __devinit davinci_wdt_probe(struct
platform_device *pdev) struct resource *res; struct device *dev = &pdev->dev;

+ wdt_clk = clk_get(dev, NULL); + if (WARN_ON(IS_ERR(wdt_clk))) + return PTR_ERR(wdt_clk); + + clk_enable(wdt_clk); + if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT) heartbeat = DEFAULT_HEARTBEAT;

@@ -245,6 +256,10 @@ static int __devexit davinci_wdt_remove(struct
platform_device *pdev) kfree(wdt_mem); wdt_mem = NULL; } + + clk_disable(wdt_clk); + clk_put(wdt_clk); + return 0; }