Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
[WATCHDOG] bfin: fix max timeout calculation

+7 -6
+7 -6
drivers/watchdog/bfin_wdt.c
··· 1 1 /* 2 2 * Blackfin On-Chip Watchdog Driver 3 - * Supports BF53[123]/BF53[467]/BF54[2489]/BF561 4 3 * 5 4 * Originally based on softdog.c 6 - * Copyright 2006-2007 Analog Devices Inc. 5 + * Copyright 2006-2010 Analog Devices Inc. 7 6 * Copyright 2006-2007 Michele d'Amico 8 7 * Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk> 9 8 * ··· 136 137 */ 137 138 static int bfin_wdt_set_timeout(unsigned long t) 138 139 { 139 - u32 cnt; 140 + u32 cnt, max_t, sclk; 140 141 unsigned long flags; 141 142 142 - stampit(); 143 + sclk = get_sclk(); 144 + max_t = -1 / sclk; 145 + cnt = t * sclk; 146 + stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt); 143 147 144 - cnt = t * get_sclk(); 145 - if (cnt < get_sclk()) { 148 + if (t > max_t) { 146 149 printk(KERN_WARNING PFX "timeout value is too large\n"); 147 150 return -EINVAL; 148 151 }