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://www.linux-watchdog.org/linux-watchdog

Pull watchdog fixes from Wim Van Sebroeck:
"This will fix reboot issues with the imx2_wdt driver and it also drops
some forgotten owner assignments from platform_drivers"

* git://www.linux-watchdog.org/linux-watchdog:
watchdog: drop owner assignment from platform_drivers
watchdog: imx2_wdt: Disable power down counter on boot
watchdog: imx2_wdt: Improve power management support.

+31 -11
-1
drivers/watchdog/cadence_wdt.c
··· 503 503 .shutdown = cdns_wdt_shutdown, 504 504 .driver = { 505 505 .name = "cdns-wdt", 506 - .owner = THIS_MODULE, 507 506 .of_match_table = cdns_wdt_of_match, 508 507 .pm = &cdns_wdt_pm_ops, 509 508 },
+31 -9
drivers/watchdog/imx2_wdt.c
··· 52 52 #define IMX2_WDT_WRSR 0x04 /* Reset Status Register */ 53 53 #define IMX2_WDT_WRSR_TOUT (1 << 1) /* -> Reset due to Timeout */ 54 54 55 + #define IMX2_WDT_WMCR 0x08 /* Misc Register */ 56 + 55 57 #define IMX2_WDT_MAX_TIME 128 56 58 #define IMX2_WDT_DEFAULT_TIME 60 /* in seconds */ 57 59 ··· 276 274 277 275 imx2_wdt_ping_if_active(wdog); 278 276 277 + /* 278 + * Disable the watchdog power down counter at boot. Otherwise the power 279 + * down counter will pull down the #WDOG interrupt line for one clock 280 + * cycle. 281 + */ 282 + regmap_write(wdev->regmap, IMX2_WDT_WMCR, 0); 283 + 279 284 ret = watchdog_register_device(wdog); 280 285 if (ret) { 281 286 dev_err(&pdev->dev, "cannot register watchdog device\n"); ··· 336 327 } 337 328 338 329 #ifdef CONFIG_PM_SLEEP 339 - /* Disable watchdog if it is active during suspend */ 330 + /* Disable watchdog if it is active or non-active but still running */ 340 331 static int imx2_wdt_suspend(struct device *dev) 341 332 { 342 333 struct watchdog_device *wdog = dev_get_drvdata(dev); 343 334 struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog); 344 335 345 - imx2_wdt_set_timeout(wdog, IMX2_WDT_MAX_TIME); 346 - imx2_wdt_ping(wdog); 336 + /* The watchdog IP block is running */ 337 + if (imx2_wdt_is_running(wdev)) { 338 + imx2_wdt_set_timeout(wdog, IMX2_WDT_MAX_TIME); 339 + imx2_wdt_ping(wdog); 347 340 348 - /* Watchdog has been stopped but IP block is still running */ 349 - if (!watchdog_active(wdog) && imx2_wdt_is_running(wdev)) 350 - del_timer_sync(&wdev->timer); 341 + /* The watchdog is not active */ 342 + if (!watchdog_active(wdog)) 343 + del_timer_sync(&wdev->timer); 344 + } 351 345 352 346 clk_disable_unprepare(wdev->clk); 353 347 ··· 366 354 clk_prepare_enable(wdev->clk); 367 355 368 356 if (watchdog_active(wdog) && !imx2_wdt_is_running(wdev)) { 369 - /* Resumes from deep sleep we need restart 370 - * the watchdog again. 357 + /* 358 + * If the watchdog is still active and resumes 359 + * from deep sleep state, need to restart the 360 + * watchdog again. 371 361 */ 372 362 imx2_wdt_setup(wdog); 373 363 imx2_wdt_set_timeout(wdog, wdog->timeout); 374 364 imx2_wdt_ping(wdog); 375 365 } else if (imx2_wdt_is_running(wdev)) { 366 + /* Resuming from non-deep sleep state. */ 367 + imx2_wdt_set_timeout(wdog, wdog->timeout); 376 368 imx2_wdt_ping(wdog); 377 - mod_timer(&wdev->timer, jiffies + wdog->timeout * HZ / 2); 369 + /* 370 + * But the watchdog is not active, then start 371 + * the timer again. 372 + */ 373 + if (!watchdog_active(wdog)) 374 + mod_timer(&wdev->timer, 375 + jiffies + wdog->timeout * HZ / 2); 378 376 } 379 377 380 378 return 0;
-1
drivers/watchdog/meson_wdt.c
··· 215 215 .remove = meson_wdt_remove, 216 216 .shutdown = meson_wdt_shutdown, 217 217 .driver = { 218 - .owner = THIS_MODULE, 219 218 .name = DRV_NAME, 220 219 .of_match_table = meson_wdt_dt_ids, 221 220 },