As the userspace has no means to determine the maximum possible timeout, use
that as the default and let the userspace lower it when necessary.
As the result the usual OpenWrt install (with busybox's watchdog trying to set
the timeout to 60s on start) is using a 33s timeout on an RT3052 clocked at
384MHz instead of the current 20s default.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
SVN-Revision: 33144
#define DRIVER_NAME "ramips-wdt"
#define DRIVER_NAME "ramips-wdt"
-#define RAMIPS_WDT_TIMEOUT 20 /* seconds */
+#define RAMIPS_WDT_TIMEOUT 0 /* seconds */
#define RAMIPS_WDT_PRESCALE 65536
#define TIMER_REG_TMRSTAT 0x00
#define RAMIPS_WDT_PRESCALE 65536
#define TIMER_REG_TMRSTAT 0x00
static int ramips_wdt_timeout = RAMIPS_WDT_TIMEOUT;
module_param_named(timeout, ramips_wdt_timeout, int, 0);
static int ramips_wdt_timeout = RAMIPS_WDT_TIMEOUT;
module_param_named(timeout, ramips_wdt_timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds "
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds, 0 means use maximum "
"(default=" __MODULE_STRING(RAMIPS_WDT_TIMEOUT) "s)");
static unsigned long ramips_wdt_flags;
"(default=" __MODULE_STRING(RAMIPS_WDT_TIMEOUT) "s)");
static unsigned long ramips_wdt_flags;
static int ramips_wdt_set_timeout(int val)
{
if (val < 1 || val > ramips_wdt_max_timeout) {
static int ramips_wdt_set_timeout(int val)
{
if (val < 1 || val > ramips_wdt_max_timeout) {
- pr_crit(DRIVER_NAME
- ": timeout value %d must be 0 < timeout < %d\n",
- val, ramips_wdt_max_timeout);
+ pr_warn(DRIVER_NAME
+ ": timeout value %d must be 0 < timeout <= %d, using %d\n",
+ val, ramips_wdt_max_timeout, ramips_wdt_timeout);
ramips_wdt_timeout > ramips_wdt_max_timeout) {
ramips_wdt_timeout = ramips_wdt_max_timeout;
dev_info(&pdev->dev,
ramips_wdt_timeout > ramips_wdt_max_timeout) {
ramips_wdt_timeout = ramips_wdt_max_timeout;
dev_info(&pdev->dev,
- "timeout value must be 0 < timeout < %d, using %d\n",
+ "timeout value must be 0 < timeout <= %d, using %d\n",
ramips_wdt_max_timeout, ramips_wdt_timeout);
}
ramips_wdt_max_timeout, ramips_wdt_timeout);
}