mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
watchdog fixes for v7.2-rc7
* at91sam9_wdt: prevent timer rearm during teardown * bd96801_wdt: Fix timeout for enabled WDG * atcwdt200: Fix return value when watchdog is enabled -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmp2dMQACgkQyx8mb86f mYGaYw/+NLMhySF0tbh+WHyf5AZRxb87MaGjnBSGN0FO2aaY1FVSlEgH9ilZmKjG k4s6SblSK9cOS/EbHFFn9Jwg4WTUZmEI2udzPnRQqo27RpGXVmq9TtVinadS2y7+ OrzegwUVJ2g6Wk4mnk1VbDeR31GHZM5pHvPzTPnQ0EuITH4BJY2vzBHcZeHyoNEo BFS9Nt8uaWpVtzq0YpChb45Gjh26zA2pB8IUndLX7fRbZmI4YD937OdzItTIrHH+ idDy/pYu7s/s6s8dJ8NIj2vqxeOP7aQvuWTAiBYoCO2s4mgaF9kEo29IUSfFjEhh 0ljfiyodRuu/hDzBAVPHejqCahv4k/aWVaP+LZgxVkQ3mJq0MuC39DB61O3aUrLD 4giRWZPTYpz0P010aaL9cwv78upu64LQ0te1X31UsNcj1Hl//bnY9mQohwYajbbq qxcQp4I4k0/u9DxpX09yl0WNngNGWaxviETO1XOjIDOopHTxwNjfmT1B1pdGTLEk +YMPn5k/ZySYxzrzViBe7pHg/0cxRJ2gzSNhrpTDlIXPPk/JgmcI6zNC71vqADXQ O3Ge8si4F610QfDvqtGTE3Quzm0UMGWtKOUHhz/WtLXDLxaowaa5TQuF/W3E4Xlv cpv3jlIw5GkPcY6srMJ93iCuLLlPgD4Ic0LrF7VajsAtqadGPjU= =2zg4 -----END PGP SIGNATURE----- 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:
commit
a59f57e2aa
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user