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 tag 'linux-watchdog-5.20-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

- add RTL9310 support

- sp805_wdt: add arm cmsdk apb wdt support

- Remove #ifdef guards for PM related functions for several watchdog
device drivers

- pm8916_wdt reboot improvements

- Several other fixes and improvements

* tag 'linux-watchdog-5.20-rc1' of git://www.linux-watchdog.org/linux-watchdog: (24 commits)
watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe()
watchdog: dw_wdt: Fix comment typo
watchdog: Fix comment typo
dt-bindings: watchdog: Add fsl,scu-wdt yaml file
watchdog:Fix typo in comment
watchdog: pm8916_wdt: Handle watchdog enabled by bootloader
watchdog: pm8916_wdt: Report reboot reason
watchdog: pm8916_wdt: Avoid read of write-only PET register
watchdog: wdat_wdt: Remove #ifdef guards for PM related functions
watchdog: tegra_wdt: Remove #ifdef guards for PM related functions
watchdog: st_lpc_wdt: Remove #ifdef guards for PM related functions
watchdog: sama5d4_wdt: Remove #ifdef guards for PM related functions
watchdog: s3c2410_wdt: Remove #ifdef guards for PM related functions
watchdog: mtk_wdt: Remove #ifdef guards for PM related functions
watchdog: dw_wdt: Remove #ifdef guards for PM related functions
watchdog: bcm7038_wdt: Remove #ifdef guards for PM related functions
watchdog: realtek-otto: add RTL9310 support
dt-bindings: watchdog: realtek,otto-wdt: add RTL9310
watchdog: sp805_wdt: add arm cmsdk apb wdt support
watchdog: sp5100_tco: Fix a memory leak of EFCH MMIO resource
...

+80 -57
+1
Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
··· 24 24 - qcom,apss-wdt-sc8280xp 25 25 - qcom,apss-wdt-sdm845 26 26 - qcom,apss-wdt-sdx55 27 + - qcom,apss-wdt-sdx65 27 28 - qcom,apss-wdt-sm6350 28 29 - qcom,apss-wdt-sm8150 29 30 - qcom,apss-wdt-sm8250
+1
Documentation/devicetree/bindings/watchdog/realtek,otto-wdt.yaml
··· 29 29 - realtek,rtl8380-wdt 30 30 - realtek,rtl8390-wdt 31 31 - realtek,rtl9300-wdt 32 + - realtek,rtl9310-wdt 32 33 33 34 reg: 34 35 maxItems: 1
+2
drivers/watchdog/armada_37xx_wdt.c
··· 274 274 if (!res) 275 275 return -ENODEV; 276 276 dev->reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); 277 + if (!dev->reg) 278 + return -ENOMEM; 277 279 278 280 /* init clock */ 279 281 dev->clk = devm_clk_get(&pdev->dev, NULL);
+3 -5
drivers/watchdog/bcm7038_wdt.c
··· 192 192 return 0; 193 193 } 194 194 195 - #ifdef CONFIG_PM_SLEEP 196 195 static int bcm7038_wdt_suspend(struct device *dev) 197 196 { 198 197 struct bcm7038_watchdog *wdt = dev_get_drvdata(dev); ··· 211 212 212 213 return 0; 213 214 } 214 - #endif 215 215 216 - static SIMPLE_DEV_PM_OPS(bcm7038_wdt_pm_ops, bcm7038_wdt_suspend, 217 - bcm7038_wdt_resume); 216 + static DEFINE_SIMPLE_DEV_PM_OPS(bcm7038_wdt_pm_ops, 217 + bcm7038_wdt_suspend, bcm7038_wdt_resume); 218 218 219 219 static const struct of_device_id bcm7038_wdt_match[] = { 220 220 { .compatible = "brcm,bcm6345-wdt" }, ··· 234 236 .driver = { 235 237 .name = "bcm7038-wdt", 236 238 .of_match_table = bcm7038_wdt_match, 237 - .pm = &bcm7038_wdt_pm_ops, 239 + .pm = pm_sleep_ptr(&bcm7038_wdt_pm_ops), 238 240 } 239 241 }; 240 242 module_platform_driver(bcm7038_wdt_driver);
+1 -1
drivers/watchdog/booke_wdt.c
··· 74 74 /* 75 75 * This procedure will find the highest period which will give a timeout 76 76 * greater than the one required. e.g. for a bus speed of 66666666 and 77 - * and a parameter of 2 secs, then this procedure will return a value of 38. 77 + * a parameter of 2 secs, then this procedure will return a value of 38. 78 78 */ 79 79 static unsigned int sec_to_period(unsigned int secs) 80 80 {
+3 -5
drivers/watchdog/dw_wdt.c
··· 218 218 219 219 /* 220 220 * Set the new value in the watchdog. Some versions of dw_wdt 221 - * have have TOPINIT in the TIMEOUT_RANGE register (as per 221 + * have TOPINIT in the TIMEOUT_RANGE register (as per 222 222 * CP_WDT_DUAL_TOP in WDT_COMP_PARAMS_1). On those we 223 223 * effectively get a pat of the watchdog right here. 224 224 */ ··· 375 375 return IRQ_HANDLED; 376 376 } 377 377 378 - #ifdef CONFIG_PM_SLEEP 379 378 static int dw_wdt_suspend(struct device *dev) 380 379 { 381 380 struct dw_wdt *dw_wdt = dev_get_drvdata(dev); ··· 409 410 410 411 return 0; 411 412 } 412 - #endif /* CONFIG_PM_SLEEP */ 413 413 414 - static SIMPLE_DEV_PM_OPS(dw_wdt_pm_ops, dw_wdt_suspend, dw_wdt_resume); 414 + static DEFINE_SIMPLE_DEV_PM_OPS(dw_wdt_pm_ops, dw_wdt_suspend, dw_wdt_resume); 415 415 416 416 /* 417 417 * In case if DW WDT IP core is synthesized with fixed TOP feature disabled the ··· 708 710 .driver = { 709 711 .name = "dw_wdt", 710 712 .of_match_table = of_match_ptr(dw_wdt_of_match), 711 - .pm = &dw_wdt_pm_ops, 713 + .pm = pm_sleep_ptr(&dw_wdt_pm_ops), 712 714 }, 713 715 }; 714 716
+3 -1
drivers/watchdog/f71808e_wdt.c
··· 634 634 635 635 pdata.type = ret; 636 636 637 - platform_driver_register(&fintek_wdt_driver); 637 + ret = platform_driver_register(&fintek_wdt_driver); 638 + if (ret) 639 + return ret; 638 640 639 641 wdt_res.name = "superio port"; 640 642 wdt_res.flags = IORESOURCE_IO;
+2 -2
drivers/watchdog/max77620_wdt.c
··· 6 6 * Copyright (C) 2022 Luca Ceresoli 7 7 * 8 8 * Author: Laxman Dewangan <ldewangan@nvidia.com> 9 - * Author: Luca Ceresoli <luca@lucaceresoli.net> 9 + * Author: Luca Ceresoli <luca.ceresoli@bootlin.com> 10 10 */ 11 11 12 12 #include <linux/err.h> ··· 260 260 "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 261 261 262 262 MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); 263 - MODULE_AUTHOR("Luca Ceresoli <luca@lucaceresoli.net>"); 263 + MODULE_AUTHOR("Luca Ceresoli <luca.ceresoli@bootlin.com>"); 264 264 MODULE_LICENSE("GPL v2");
+3 -7
drivers/watchdog/mtk_wdt.c
··· 401 401 return 0; 402 402 } 403 403 404 - #ifdef CONFIG_PM_SLEEP 405 404 static int mtk_wdt_suspend(struct device *dev) 406 405 { 407 406 struct mtk_wdt_dev *mtk_wdt = dev_get_drvdata(dev); ··· 422 423 423 424 return 0; 424 425 } 425 - #endif 426 426 427 427 static const struct of_device_id mtk_wdt_dt_ids[] = { 428 428 { .compatible = "mediatek,mt2712-wdt", .data = &mt2712_data }, ··· 435 437 }; 436 438 MODULE_DEVICE_TABLE(of, mtk_wdt_dt_ids); 437 439 438 - static const struct dev_pm_ops mtk_wdt_pm_ops = { 439 - SET_SYSTEM_SLEEP_PM_OPS(mtk_wdt_suspend, 440 - mtk_wdt_resume) 441 - }; 440 + static DEFINE_SIMPLE_DEV_PM_OPS(mtk_wdt_pm_ops, 441 + mtk_wdt_suspend, mtk_wdt_resume); 442 442 443 443 static struct platform_driver mtk_wdt_driver = { 444 444 .probe = mtk_wdt_probe, 445 445 .driver = { 446 446 .name = DRV_NAME, 447 - .pm = &mtk_wdt_pm_ops, 447 + .pm = pm_sleep_ptr(&mtk_wdt_pm_ops), 448 448 .of_match_table = mtk_wdt_dt_ids, 449 449 }, 450 450 };
+1 -1
drivers/watchdog/pc87413_wdt.c
··· 442 442 } 443 443 } 444 444 445 - /* -- Notifier funtions -----------------------------------------*/ 445 + /* -- Notifier functions -----------------------------------------*/ 446 446 447 447 /** 448 448 * pc87413_notify_sys:
+37 -4
drivers/watchdog/pm8916_wdt.c
··· 9 9 #include <linux/regmap.h> 10 10 #include <linux/watchdog.h> 11 11 12 + #define PON_POFF_REASON1 0x0c 13 + #define PON_POFF_REASON1_PMIC_WD BIT(2) 14 + #define PON_POFF_REASON2 0x0d 15 + #define PON_POFF_REASON2_UVLO BIT(5) 16 + #define PON_POFF_REASON2_OTST3 BIT(6) 17 + 12 18 #define PON_INT_RT_STS 0x10 13 19 #define PMIC_WD_BARK_STS_BIT BIT(6) 14 20 ··· 64 58 { 65 59 struct pm8916_wdt *wdt = watchdog_get_drvdata(wdev); 66 60 67 - return regmap_update_bits(wdt->regmap, 68 - wdt->baseaddr + PON_PMIC_WD_RESET_PET, 69 - WATCHDOG_PET_BIT, WATCHDOG_PET_BIT); 61 + return regmap_write(wdt->regmap, wdt->baseaddr + PON_PMIC_WD_RESET_PET, 62 + WATCHDOG_PET_BIT); 70 63 } 71 64 72 65 static int pm8916_wdt_configure_timers(struct watchdog_device *wdev) ··· 116 111 } 117 112 118 113 static const struct watchdog_info pm8916_wdt_ident = { 119 - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, 114 + .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE | 115 + WDIOF_OVERHEAT | WDIOF_CARDRESET | WDIOF_POWERUNDER, 120 116 .identity = "QCOM PM8916 PON WDT", 121 117 }; 122 118 123 119 static const struct watchdog_info pm8916_wdt_pt_ident = { 124 120 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE | 121 + WDIOF_OVERHEAT | WDIOF_CARDRESET | WDIOF_POWERUNDER | 125 122 WDIOF_PRETIMEOUT, 126 123 .identity = "QCOM PM8916 PON WDT", 127 124 }; ··· 142 135 struct device *dev = &pdev->dev; 143 136 struct pm8916_wdt *wdt; 144 137 struct device *parent; 138 + unsigned int val; 145 139 int err, irq; 140 + u8 poff[2]; 146 141 147 142 wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); 148 143 if (!wdt) ··· 184 175 185 176 wdt->wdev.info = &pm8916_wdt_ident; 186 177 } 178 + 179 + err = regmap_bulk_read(wdt->regmap, wdt->baseaddr + PON_POFF_REASON1, 180 + &poff, ARRAY_SIZE(poff)); 181 + if (err) { 182 + dev_err(dev, "failed to read POFF reason: %d\n", err); 183 + return err; 184 + } 185 + 186 + dev_dbg(dev, "POFF reason: %#x %#x\n", poff[0], poff[1]); 187 + if (poff[0] & PON_POFF_REASON1_PMIC_WD) 188 + wdt->wdev.bootstatus |= WDIOF_CARDRESET; 189 + if (poff[1] & PON_POFF_REASON2_UVLO) 190 + wdt->wdev.bootstatus |= WDIOF_POWERUNDER; 191 + if (poff[1] & PON_POFF_REASON2_OTST3) 192 + wdt->wdev.bootstatus |= WDIOF_OVERHEAT; 193 + 194 + err = regmap_read(wdt->regmap, wdt->baseaddr + PON_PMIC_WD_RESET_S2_CTL2, 195 + &val); 196 + if (err) { 197 + dev_err(dev, "failed to check if watchdog is active: %d\n", err); 198 + return err; 199 + } 200 + if (val & S2_RESET_EN_BIT) 201 + set_bit(WDOG_HW_RUNNING, &wdt->wdev.status); 187 202 188 203 /* Configure watchdog to hard-reset mode */ 189 204 err = regmap_write(wdt->regmap,
+1
drivers/watchdog/realtek_otto_wdt.c
··· 366 366 { .compatible = "realtek,rtl8380-wdt" }, 367 367 { .compatible = "realtek,rtl8390-wdt" }, 368 368 { .compatible = "realtek,rtl9300-wdt" }, 369 + { .compatible = "realtek,rtl9310-wdt" }, 369 370 { } 370 371 }; 371 372 MODULE_DEVICE_TABLE(of, otto_wdt_ids);
+3 -6
drivers/watchdog/s3c2410_wdt.c
··· 845 845 s3c2410wdt_stop(&wdt->wdt_device); 846 846 } 847 847 848 - #ifdef CONFIG_PM_SLEEP 849 - 850 848 static int s3c2410wdt_suspend(struct device *dev) 851 849 { 852 850 int ret; ··· 883 885 884 886 return 0; 885 887 } 886 - #endif 887 888 888 - static SIMPLE_DEV_PM_OPS(s3c2410wdt_pm_ops, s3c2410wdt_suspend, 889 - s3c2410wdt_resume); 889 + static DEFINE_SIMPLE_DEV_PM_OPS(s3c2410wdt_pm_ops, 890 + s3c2410wdt_suspend, s3c2410wdt_resume); 890 891 891 892 static struct platform_driver s3c2410wdt_driver = { 892 893 .probe = s3c2410wdt_probe, ··· 894 897 .id_table = s3c2410_wdt_ids, 895 898 .driver = { 896 899 .name = "s3c2410-wdt", 897 - .pm = &s3c2410wdt_pm_ops, 900 + .pm = pm_sleep_ptr(&s3c2410wdt_pm_ops), 898 901 .of_match_table = of_match_ptr(s3c2410_wdt_match), 899 902 }, 900 903 };
+3 -5
drivers/watchdog/sama5d4_wdt.c
··· 339 339 }; 340 340 MODULE_DEVICE_TABLE(of, sama5d4_wdt_of_match); 341 341 342 - #ifdef CONFIG_PM_SLEEP 343 342 static int sama5d4_wdt_suspend_late(struct device *dev) 344 343 { 345 344 struct sama5d4_wdt *wdt = dev_get_drvdata(dev); ··· 365 366 366 367 return 0; 367 368 } 368 - #endif 369 369 370 370 static const struct dev_pm_ops sama5d4_wdt_pm_ops = { 371 - SET_LATE_SYSTEM_SLEEP_PM_OPS(sama5d4_wdt_suspend_late, 372 - sama5d4_wdt_resume_early) 371 + LATE_SYSTEM_SLEEP_PM_OPS(sama5d4_wdt_suspend_late, 372 + sama5d4_wdt_resume_early) 373 373 }; 374 374 375 375 static struct platform_driver sama5d4_wdt_driver = { 376 376 .probe = sama5d4_wdt_probe, 377 377 .driver = { 378 378 .name = "sama5d4_wdt", 379 - .pm = &sama5d4_wdt_pm_ops, 379 + .pm = pm_sleep_ptr(&sama5d4_wdt_pm_ops), 380 380 .of_match_table = sama5d4_wdt_of_match, 381 381 } 382 382 };
+1
drivers/watchdog/sp5100_tco.c
··· 402 402 iounmap(addr); 403 403 404 404 release_resource(res); 405 + kfree(res); 405 406 406 407 return ret; 407 408 }
+5
drivers/watchdog/sp805_wdt.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 1 2 /* 2 3 * drivers/char/watchdog/sp805-wdt.c 3 4 * ··· 341 340 { 342 341 .id = 0x00141805, 343 342 .mask = 0x00ffffff, 343 + }, 344 + { 345 + .id = 0x001bb824, 346 + .mask = 0x00ffffff, 344 347 }, 345 348 { 0, 0 }, 346 349 };
+3 -6
drivers/watchdog/st_lpc_wdt.c
··· 248 248 return 0; 249 249 } 250 250 251 - #ifdef CONFIG_PM_SLEEP 252 251 static int st_wdog_suspend(struct device *dev) 253 252 { 254 253 struct st_wdog *st_wdog = watchdog_get_drvdata(&st_wdog_dev); ··· 284 285 285 286 return 0; 286 287 } 287 - #endif 288 288 289 - static SIMPLE_DEV_PM_OPS(st_wdog_pm_ops, 290 - st_wdog_suspend, 291 - st_wdog_resume); 289 + static DEFINE_SIMPLE_DEV_PM_OPS(st_wdog_pm_ops, 290 + st_wdog_suspend, st_wdog_resume); 292 291 293 292 static struct platform_driver st_wdog_driver = { 294 293 .driver = { 295 294 .name = "st-lpc-wdt", 296 - .pm = &st_wdog_pm_ops, 295 + .pm = pm_sleep_ptr(&st_wdog_pm_ops), 297 296 .of_match_table = st_wdog_match, 298 297 }, 299 298 .probe = st_wdog_probe,
+5 -9
drivers/watchdog/tegra_wdt.c
··· 230 230 return 0; 231 231 } 232 232 233 - #ifdef CONFIG_PM_SLEEP 234 - static int tegra_wdt_runtime_suspend(struct device *dev) 233 + static int tegra_wdt_suspend(struct device *dev) 235 234 { 236 235 struct tegra_wdt *wdt = dev_get_drvdata(dev); 237 236 ··· 240 241 return 0; 241 242 } 242 243 243 - static int tegra_wdt_runtime_resume(struct device *dev) 244 + static int tegra_wdt_resume(struct device *dev) 244 245 { 245 246 struct tegra_wdt *wdt = dev_get_drvdata(dev); 246 247 ··· 249 250 250 251 return 0; 251 252 } 252 - #endif 253 253 254 254 static const struct of_device_id tegra_wdt_of_match[] = { 255 255 { .compatible = "nvidia,tegra30-timer", }, ··· 256 258 }; 257 259 MODULE_DEVICE_TABLE(of, tegra_wdt_of_match); 258 260 259 - static const struct dev_pm_ops tegra_wdt_pm_ops = { 260 - SET_SYSTEM_SLEEP_PM_OPS(tegra_wdt_runtime_suspend, 261 - tegra_wdt_runtime_resume) 262 - }; 261 + static DEFINE_SIMPLE_DEV_PM_OPS(tegra_wdt_pm_ops, 262 + tegra_wdt_suspend, tegra_wdt_resume); 263 263 264 264 static struct platform_driver tegra_wdt_driver = { 265 265 .probe = tegra_wdt_probe, 266 266 .driver = { 267 267 .name = "tegra-wdt", 268 - .pm = &tegra_wdt_pm_ops, 268 + .pm = pm_sleep_ptr(&tegra_wdt_pm_ops), 269 269 .of_match_table = tegra_wdt_of_match, 270 270 }, 271 271 };
+2 -5
drivers/watchdog/wdat_wdt.c
··· 467 467 return devm_watchdog_register_device(dev, &wdat->wdd); 468 468 } 469 469 470 - #ifdef CONFIG_PM_SLEEP 471 470 static int wdat_wdt_suspend_noirq(struct device *dev) 472 471 { 473 472 struct wdat_wdt *wdat = dev_get_drvdata(dev); ··· 527 528 528 529 return wdat_wdt_start(&wdat->wdd); 529 530 } 530 - #endif 531 531 532 532 static const struct dev_pm_ops wdat_wdt_pm_ops = { 533 - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(wdat_wdt_suspend_noirq, 534 - wdat_wdt_resume_noirq) 533 + NOIRQ_SYSTEM_SLEEP_PM_OPS(wdat_wdt_suspend_noirq, wdat_wdt_resume_noirq) 535 534 }; 536 535 537 536 static struct platform_driver wdat_wdt_driver = { 538 537 .probe = wdat_wdt_probe, 539 538 .driver = { 540 539 .name = "wdat_wdt", 541 - .pm = &wdat_wdt_pm_ops, 540 + .pm = pm_sleep_ptr(&wdat_wdt_pm_ops), 542 541 }, 543 542 }; 544 543