Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* git://www.linux-watchdog.org/linux-watchdog:
  watchdog: Initconst section fixes for watchdog
  watchdog: lantiq: fix watchdogs timeout handling
  watchdog: hpwdt: prevent multiple "NMI occurred" messages
  watchdog: WatchDog Timer Driver Core - use passed watchdog_device
  • Loading branch information
Linus Torvalds committed Sep 20, 2011
2 parents 0ad79ed + 4e8858d commit d006de9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
9 changes: 5 additions & 4 deletions drivers/watchdog/hpwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,15 +494,16 @@ static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
asminline_call(&cmn_regs, cru_rom_addr);
die_nmi_called = 1;
spin_unlock_irqrestore(&rom_lock, rom_pl);

if (allow_kdump)
hpwdt_stop();

if (!is_icru) {
if (cmn_regs.u1.ral == 0) {
printk(KERN_WARNING "hpwdt: An NMI occurred, "
panic("An NMI occurred, "
"but unable to determine source.\n");
}
}

if (allow_kdump)
hpwdt_stop();
panic("An NMI occurred, please see the Integrated "
"Management Log for details.\n");

Expand Down
8 changes: 4 additions & 4 deletions drivers/watchdog/lantiq_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ static int ltq_wdt_ok_to_close;
static void
ltq_wdt_enable(void)
{
ltq_wdt_timeout = ltq_wdt_timeout *
unsigned long int timeout = ltq_wdt_timeout *
(ltq_io_region_clk_rate / LTQ_WDT_DIVIDER) + 0x1000;
if (ltq_wdt_timeout > LTQ_MAX_TIMEOUT)
ltq_wdt_timeout = LTQ_MAX_TIMEOUT;
if (timeout > LTQ_MAX_TIMEOUT)
timeout = LTQ_MAX_TIMEOUT;

/* write the first password magic */
ltq_w32(LTQ_WDT_PW1, ltq_wdt_membase + LTQ_WDT_CR);
/* write the second magic plus the configuration and new timeout */
ltq_w32(LTQ_WDT_SR_EN | LTQ_WDT_SR_PWD | LTQ_WDT_SR_CLKDIV |
LTQ_WDT_PW2 | ltq_wdt_timeout, ltq_wdt_membase + LTQ_WDT_CR);
LTQ_WDT_PW2 | timeout, ltq_wdt_membase + LTQ_WDT_CR);
}

static void
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/sbc_epx_c3.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static struct notifier_block epx_c3_notifier = {
.notifier_call = epx_c3_notify_sys,
};

static const char banner[] __initdata = KERN_INFO PFX
static const char banner[] __initconst = KERN_INFO PFX
"Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n";

static int __init watchdog_init(void)
Expand Down
14 changes: 7 additions & 7 deletions drivers/watchdog/watchdog_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static struct watchdog_device *wdd;

static int watchdog_ping(struct watchdog_device *wddev)
{
if (test_bit(WDOG_ACTIVE, &wdd->status)) {
if (test_bit(WDOG_ACTIVE, &wddev->status)) {
if (wddev->ops->ping)
return wddev->ops->ping(wddev); /* ping the watchdog */
else
Expand All @@ -81,12 +81,12 @@ static int watchdog_start(struct watchdog_device *wddev)
{
int err;

if (!test_bit(WDOG_ACTIVE, &wdd->status)) {
if (!test_bit(WDOG_ACTIVE, &wddev->status)) {
err = wddev->ops->start(wddev);
if (err < 0)
return err;

set_bit(WDOG_ACTIVE, &wdd->status);
set_bit(WDOG_ACTIVE, &wddev->status);
}
return 0;
}
Expand All @@ -105,18 +105,18 @@ static int watchdog_stop(struct watchdog_device *wddev)
{
int err = -EBUSY;

if (test_bit(WDOG_NO_WAY_OUT, &wdd->status)) {
if (test_bit(WDOG_NO_WAY_OUT, &wddev->status)) {
pr_info("%s: nowayout prevents watchdog to be stopped!\n",
wdd->info->identity);
wddev->info->identity);
return err;
}

if (test_bit(WDOG_ACTIVE, &wdd->status)) {
if (test_bit(WDOG_ACTIVE, &wddev->status)) {
err = wddev->ops->stop(wddev);
if (err < 0)
return err;

clear_bit(WDOG_ACTIVE, &wdd->status);
clear_bit(WDOG_ACTIVE, &wddev->status);
}
return 0;
}
Expand Down

0 comments on commit d006de9

Please sign in to comment.