Skip to content

Commit 6e7733e

Browse files
groeckWim Van Sebroeck
authored andcommitted
Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout"
This reverts commit cb01104 ("watchdog: iTCO_wdt: Account for rebooting on second timeout") and commit aec4264 ("watchdog: iTCO_wdt: Fix detection of SMI-off case") since those patches cause a regression on certain boards (https://bugzilla.kernel.org/show_bug.cgi?id=213809). While this revert may result in some boards to only reset after twice the configured timeout value, that is still better than a watchdog reset after half the configured value. Fixes: cb01104 ("watchdog: iTCO_wdt: Account for rebooting on second timeout") Fixes: aec4264 ("watchdog: iTCO_wdt: Fix detection of SMI-off case") Cc: Jan Kiszka <[email protected]> Cc: Mantas Mikulėnas <[email protected]> Reported-by: Javier S. Pedro <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 519d819 commit 6e7733e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/watchdog/iTCO_wdt.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171
#define TCOBASE(p) ((p)->tco_res->start)
7272
/* SMI Control and Enable Register */
7373
#define SMI_EN(p) ((p)->smi_res->start)
74-
#define TCO_EN (1 << 13)
75-
#define GBL_SMI_EN (1 << 0)
7674

7775
#define TCO_RLD(p) (TCOBASE(p) + 0x00) /* TCO Timer Reload/Curr. Value */
7876
#define TCOv1_TMR(p) (TCOBASE(p) + 0x01) /* TCOv1 Timer Initial Value*/
@@ -357,12 +355,8 @@ static int iTCO_wdt_set_timeout(struct watchdog_device *wd_dev, unsigned int t)
357355

358356
tmrval = seconds_to_ticks(p, t);
359357

360-
/*
361-
* If TCO SMIs are off, the timer counts down twice before rebooting.
362-
* Otherwise, the BIOS generally reboots when the SMI triggers.
363-
*/
364-
if (p->smi_res &&
365-
(inl(SMI_EN(p)) & (TCO_EN | GBL_SMI_EN)) != (TCO_EN | GBL_SMI_EN))
358+
/* For TCO v1 the timer counts down twice before rebooting */
359+
if (p->iTCO_version == 1)
366360
tmrval /= 2;
367361

368362
/* from the specs: */
@@ -527,7 +521,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
527521
* Disables TCO logic generating an SMI#
528522
*/
529523
val32 = inl(SMI_EN(p));
530-
val32 &= ~TCO_EN; /* Turn off SMI clearing watchdog */
524+
val32 &= 0xffffdfff; /* Turn off SMI clearing watchdog */
531525
outl(val32, SMI_EN(p));
532526
}
533527

0 commit comments

Comments
 (0)