mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-21 09:59:20 -04:00
Merge tag 'watchdog-for-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull watchdog fixes from Guenter Roeck: - airoha: Prevent division by zero when clock frequency is zero - core: pretimeout: Fix UAF in watchdog_unregister_governor() - ni903x_wdt: Check ACPI_COMPANION() against NULL - s32g_wdt: remove incorrect options in watchdog_info struct * tag 'watchdog-for-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: watchdog: airoha: Prevent division by zero when clock frequency is zero watchdog: pretimeout: Fix UAF in watchdog_unregister_governor() docs: watchdog: Fix brackets watchdog: ni903x_wdt: Check ACPI_COMPANION() against NULL watchdog: s32g_wdt: remove incorrect options in watchdog_info struct
This commit is contained in:
@@ -59,7 +59,7 @@ advantechwdt:
|
||||
|
||||
alim1535_wdt:
|
||||
timeout:
|
||||
Watchdog timeout in seconds. (0 < timeout < 18000, default=60
|
||||
Watchdog timeout in seconds. (0 < timeout < 18000, default=60)
|
||||
nowayout:
|
||||
Watchdog cannot be stopped once started
|
||||
(default=kernel config parameter)
|
||||
@@ -68,7 +68,7 @@ alim1535_wdt:
|
||||
|
||||
alim7101_wdt:
|
||||
timeout:
|
||||
Watchdog timeout in seconds. (1<=timeout<=3600, default=30
|
||||
Watchdog timeout in seconds. (1<=timeout<=3600, default=30)
|
||||
use_gpio:
|
||||
Use the gpio watchdog (required by old cobalt boards).
|
||||
default=0/off/no
|
||||
|
||||
@@ -147,6 +147,9 @@ static int airoha_wdt_probe(struct platform_device *pdev)
|
||||
|
||||
/* Watchdog ticks at half the bus rate */
|
||||
airoha_wdt->wdt_freq = clk_get_rate(bus_clk) / 2;
|
||||
if (!airoha_wdt->wdt_freq)
|
||||
return dev_err_probe(dev, -EINVAL,
|
||||
"invalid clock frequency\n");
|
||||
|
||||
/* Initialize struct watchdog device */
|
||||
wdog_dev = &airoha_wdt->wdog_dev;
|
||||
|
||||
@@ -183,9 +183,14 @@ static int ni903x_acpi_probe(struct platform_device *pdev)
|
||||
struct device *dev = &pdev->dev;
|
||||
struct watchdog_device *wdd;
|
||||
struct ni903x_wdt *wdt;
|
||||
acpi_handle handle;
|
||||
acpi_status status;
|
||||
int ret;
|
||||
|
||||
handle = ACPI_HANDLE(dev);
|
||||
if (!handle)
|
||||
return -ENODEV;
|
||||
|
||||
wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
|
||||
if (!wdt)
|
||||
return -ENOMEM;
|
||||
@@ -193,7 +198,7 @@ static int ni903x_acpi_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, wdt);
|
||||
wdt->dev = dev;
|
||||
|
||||
status = acpi_walk_resources(ACPI_HANDLE(dev), METHOD_NAME__CRS,
|
||||
status = acpi_walk_resources(handle, METHOD_NAME__CRS,
|
||||
ni903x_resources, wdt);
|
||||
if (ACPI_FAILURE(status) || wdt->io_base == 0) {
|
||||
dev_err(dev, "failed to get resources\n");
|
||||
|
||||
@@ -56,8 +56,7 @@ MODULE_PARM_DESC(early_enable,
|
||||
|
||||
static const struct watchdog_info s32g_wdt_info = {
|
||||
.identity = "s32g watchdog",
|
||||
.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE |
|
||||
WDIOC_GETTIMEOUT | WDIOC_GETTIMELEFT,
|
||||
.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
|
||||
};
|
||||
|
||||
static struct s32g_wdt_device *wdd_to_s32g_wdt(struct watchdog_device *wdd)
|
||||
|
||||
@@ -167,6 +167,8 @@ void watchdog_unregister_governor(struct watchdog_governor *gov)
|
||||
}
|
||||
|
||||
spin_lock_irq(&pretimeout_lock);
|
||||
if (default_gov == gov)
|
||||
default_gov = NULL;
|
||||
list_for_each_entry(p, &pretimeout_list, entry)
|
||||
if (p->wdd->gov == gov)
|
||||
p->wdd->gov = default_gov;
|
||||
|
||||
Reference in New Issue
Block a user