Merge tag 'watchdog-for-v7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull watchdog fixes from Guenter Roeck:

 - at91sam9_wdt: prevent timer rearm during teardown

 - bd96801_wdt: Fix timeout for enabled WDG

 - atcwdt200: Fix return value when watchdog is enabled

* tag 'watchdog-for-v7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  watchdog: at91sam9_wdt: prevent timer rearm during teardown
  watchdog: bd96801_wdt: Fix timeout for enabled WDG
  watchdog: atcwdt200: fix return value when watchdog is enabled
This commit is contained in:
Linus Torvalds
2026-08-07 17:29:59 -07:00
3 changed files with 8 additions and 8 deletions

View File

@@ -242,7 +242,7 @@ static int at91_wdt_init(struct platform_device *pdev, struct at91wdt *wdt)
return 0;
out_stop_timer:
timer_delete(&wdt->timer);
timer_shutdown_sync(&wdt->timer);
return err;
}
@@ -378,7 +378,7 @@ static void at91wdt_remove(struct platform_device *pdev)
watchdog_unregister_device(&wdt->wdd);
pr_warn("I quit now, hardware will probably reboot!\n");
timer_delete(&wdt->timer);
timer_shutdown_sync(&wdt->timer);
}
#if defined(CONFIG_OF)

View File

@@ -260,9 +260,9 @@ static void atcwdt_get_timeout_params(struct atcwdt_drv *drv_data,
* register to determine the interrupt timer type supported by the hardware.
*
* Note: This function must only be called when the ATCWDT200 watchdog is
* disabled. If the watchdog is enabled, this function returns TMR_UNKNOWN.
* disabled. If the watchdog is enabled, this function returns -EBUSY.
*
* Returns: The interrupt timer type supported by the hardware.
* Returns: 0 on success or negative error code on failure.
*/
static int atcwdt_get_int_timer_type(struct atcwdt_drv *drv_data)
{
@@ -274,7 +274,8 @@ static int atcwdt_get_int_timer_type(struct atcwdt_drv *drv_data)
regmap_read(drv_data->regmap, REG_CTRL, &val);
if (val & CTRL_WDT_EN) {
spin_unlock(&drv_data->lock);
return TMR_UNKNOWN;
return dev_err_probe(dev, -EBUSY,
"Watchdog is enabled, cannot detect timer type\n");
}
/*

View File

@@ -169,7 +169,6 @@ static int bd96801_set_wdt_mode(struct wdtbd96801 *w, unsigned int hw_margin,
int fastng, slowng, type, ret, reg, mask;
struct device *dev = w->dev;
if (hw_margin_min * 1000 > FASTNG_MAX_US) {
dev_err(dev, "Unsupported fast timeout %u uS [max %u]\n",
hw_margin_min * 1000, FASTNG_MAX_US);
@@ -258,10 +257,10 @@ static int bd96801_set_heartbeat_from_hw(struct wdtbd96801 *w,
fast = FASTNG_MIN << sel;
sel = (val & BD96801_WD_RATIO_MASK) + 1;
w->wdt.max_hw_heartbeat_ms = (fast << sel) / USEC_PER_MSEC;
w->wdt.max_hw_heartbeat_ms = (fast << sel) / 10;
if ((conf_reg & BD96801_WD_TYPE_MASK) == BD96801_WD_TYPE_WIN)
w->wdt.min_hw_heartbeat_ms = fast / USEC_PER_MSEC;
w->wdt.min_hw_heartbeat_ms = fast / 10;
return 0;
}