Skip to content

Commit

Permalink
Merge tag 'linux-watchdog-5.16-rc1' of git://www.linux-watchdog.org/l…
Browse files Browse the repository at this point in the history
…inux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

 - f71808e_wdt: convert to watchdog framework

 - db8500_wdt: Rename driver (was ux500_wdt.c)

 - sunxi: Add compatibles for R329 and D1

 - mtk: add disable_wdt_extrst support

 - several other small fixes and improvements

* tag 'linux-watchdog-5.16-rc1' of git://www.linux-watchdog.org/linux-watchdog: (30 commits)
  watchdog: db8500_wdt: Rename symbols
  watchdog: db8500_wdt: Rename driver
  watchdog: ux500_wdt: Drop platform data
  watchdog: bcm63xx_wdt: fix fallthrough warning
  watchdog: iTCO_wdt: No need to stop the timer in probe
  watchdog: s3c2410: describe driver in KConfig
  watchdog: sp5100_tco: Add support for get_timeleft
  watchdog: mtk: add disable_wdt_extrst support
  dt-bindings: watchdog: mtk-wdt: add disable_wdt_extrst support
  watchdog: rza_wdt: Use semicolons instead of commas
  watchdog: mlx-wdt: Use regmap_write_bits()
  watchdog: rti-wdt: Make use of the helper function devm_platform_ioremap_resource()
  watchdog: iTCO_wdt: Make use of the helper function devm_platform_ioremap_resource()
  watchdog: ar7_wdt: Make use of the helper function devm_platform_ioremap_resource_byname()
  watchdog: sunxi_wdt: Add support for D1
  dt-bindings: watchdog: sunxi: Add compatibles for D1
  ar7: fix kernel builds for compiler test
  dt-bindings: watchdog: sunxi: Add compatibles for R329
  watchdog: meson_gxbb_wdt: add timeout parameter
  watchdog: meson_gxbb_wdt: add nowayout parameter
  ...
  • Loading branch information
torvalds committed Nov 10, 2021
2 parents bd485d2 + c738888 commit 89d714a
Show file tree
Hide file tree
Showing 22 changed files with 384 additions and 795 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,33 @@ properties:
- allwinner,sun50i-a100-wdt
- allwinner,sun50i-h6-wdt
- allwinner,sun50i-h616-wdt
- allwinner,sun50i-r329-wdt
- allwinner,sun50i-r329-wdt-reset
- const: allwinner,sun6i-a31-wdt
- items:
- const: allwinner,suniv-f1c100s-wdt
- const: allwinner,sun4i-a10-wdt
- const: allwinner,sun20i-d1-wdt
- items:
- const: allwinner,sun20i-d1-wdt-reset
- const: allwinner,sun20i-d1-wdt

reg:
maxItems: 1

clocks:
maxItems: 1
minItems: 1
maxItems: 2
items:
- description: High-frequency oscillator input, divided internally
- description: Low-frequency oscillator input, only found on some variants

clock-names:
minItems: 1
maxItems: 2
items:
- const: hosc
- const: losc

interrupts:
maxItems: 1
Expand All @@ -44,6 +61,35 @@ required:
- clocks
- interrupts

if:
properties:
compatible:
contains:
enum:
- allwinner,sun20i-d1-wdt
- allwinner,sun20i-d1-wdt-reset
- allwinner,sun50i-r329-wdt
- allwinner,sun50i-r329-wdt-reset

then:
properties:
clocks:
minItems: 2

clock-names:
minItems: 2

required:
- clock-names

else:
properties:
clocks:
maxItems: 1

clock-names:
maxItems: 1

unevaluatedProperties: false

examples:
Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Required properties:
- reg : Specifies base physical address and size of the registers.

Optional properties:
- mediatek,disable-extrst: disable send output reset signal
- interrupts: Watchdog pre-timeout (bark) interrupt.
- timeout-sec: contains the watchdog timeout in seconds.
- #reset-cells: Should be 1.
Expand All @@ -31,6 +32,7 @@ Example:
watchdog: watchdog@10007000 {
compatible = "mediatek,mt8183-wdt",
"mediatek,mt6589-wdt";
mediatek,disable-extrst;
reg = <0 0x10007000 0 0x100>;
interrupts = <GIC_SPI 139 IRQ_TYPE_NONE>;
timeout-sec = <10>;
Expand Down
13 changes: 1 addition & 12 deletions drivers/mfd/db8500-prcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <linux/mfd/abx500/ab8500.h>
#include <linux/regulator/db8500-prcmu.h>
#include <linux/regulator/machine.h>
#include <linux/platform_data/ux500_wdt.h>
#include "db8500-prcmu-regs.h"

/* Index of different voltages to be used when accessing AVSData */
Expand Down Expand Up @@ -2939,18 +2938,8 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = {
},
};

static struct ux500_wdt_data db8500_wdt_pdata = {
.timeout = 600, /* 10 minutes */
.has_28_bits_resolution = true,
};

static const struct mfd_cell common_prcmu_devs[] = {
{
.name = "ux500_wdt",
.platform_data = &db8500_wdt_pdata,
.pdata_size = sizeof(db8500_wdt_pdata),
.id = -1,
},
MFD_CELL_NAME("db8500_wdt"),
MFD_CELL_NAME("db8500-cpuidle"),
};

Expand Down
35 changes: 11 additions & 24 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -496,16 +496,18 @@ config S3C2410_WATCHDOG
select WATCHDOG_CORE
select MFD_SYSCON if ARCH_EXYNOS
help
Watchdog timer block in the Samsung SoCs. This will reboot
the system when the timer expires with the watchdog enabled.
Watchdog timer block in the Samsung S3C24xx, S3C64xx, S5Pv210 and
Exynos SoCs. This will reboot the system when the timer expires with
the watchdog enabled.

The driver is limited by the speed of the system's PCLK
signal, so with reasonably fast systems (PCLK around 50-66MHz)
then watchdog intervals of over approximately 20seconds are
unavailable.

Choose Y/M here only if you build for such Samsung SoC.
The driver can be built as a module by choosing M, and will
be called s3c2410_wdt
be called s3c2410_wdt.

config SA1100_WATCHDOG
tristate "SA1100/PXA2xx watchdog"
Expand Down Expand Up @@ -561,22 +563,6 @@ config PNX4008_WATCHDOG

Say N if you are unsure.

config IOP_WATCHDOG
tristate "IOP Watchdog"
depends on ARCH_IOP13XX
select WATCHDOG_NOWAYOUT if (ARCH_IOP32X || ARCH_IOP33X)
help
Say Y here if to include support for the watchdog timer
in the Intel IOP3XX & IOP13XX I/O Processors. This driver can
be built as a module by choosing M. The module will
be called iop_wdt.

Note: The IOP13XX watchdog does an Internal Bus Reset which will
affect both cores and the peripherals of the IOP. The ATU-X
and/or ATUe configuration registers will remain intact, but if
operating as an Root Complex and/or Central Resource, the PCI-X
and/or PCIe busses will also be reset. THIS IS A VERY BIG HAMMER.

config DAVINCI_WATCHDOG
tristate "DaVinci watchdog"
depends on ARCH_DAVINCI || ARCH_KEYSTONE || COMPILE_TEST
Expand Down Expand Up @@ -743,17 +729,17 @@ config IMX7ULP_WDT
To compile this driver as a module, choose M here: the
module will be called imx7ulp_wdt.

config UX500_WATCHDOG
tristate "ST-Ericsson Ux500 watchdog"
config DB500_WATCHDOG
tristate "ST-Ericsson DB800 watchdog"
depends on MFD_DB8500_PRCMU
select WATCHDOG_CORE
default y
help
Say Y here to include Watchdog timer support for the watchdog
existing in the prcmu of ST-Ericsson Ux500 series platforms.
existing in the prcmu of ST-Ericsson DB8500 platform.

To compile this driver as a module, choose M here: the
module will be called ux500_wdt.
module will be called db500_wdt.

config RETU_WATCHDOG
tristate "Retu watchdog"
Expand Down Expand Up @@ -1052,6 +1038,7 @@ config EBC_C384_WDT
config F71808E_WDT
tristate "Fintek F718xx, F818xx Super I/O Watchdog"
depends on X86
select WATCHDOG_CORE
help
This is the driver for the hardware watchdog on the Fintek F71808E,
F71862FG, F71868, F71869, F71882FG, F71889FG, F81803, F81865, and
Expand Down Expand Up @@ -1679,7 +1666,7 @@ config SIBYTE_WDOG

config AR7_WDT
tristate "TI AR7 Watchdog Timer"
depends on AR7 || (MIPS && COMPILE_TEST)
depends on AR7 || (MIPS && 32BIT && COMPILE_TEST)
help
Hardware driver for the TI AR7 Watchdog Timer.

Expand Down
3 changes: 1 addition & 2 deletions drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ obj-$(CONFIG_SAMA5D4_WATCHDOG) += sama5d4_wdt.o
obj-$(CONFIG_DW_WATCHDOG) += dw_wdt.o
obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
obj-$(CONFIG_K3_RTI_WATCHDOG) += rti_wdt.o
obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
Expand All @@ -69,7 +68,7 @@ obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
obj-$(CONFIG_IMX_SC_WDT) += imx_sc_wdt.o
obj-$(CONFIG_IMX7ULP_WDT) += imx7ulp_wdt.o
obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
obj-$(CONFIG_DB500_WATCHDOG) += db8500_wdt.o
obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
Expand Down
6 changes: 1 addition & 5 deletions drivers/watchdog/ar7_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ static DEFINE_SPINLOCK(wdt_lock);
/* XXX currently fixed, allows max margin ~68.72 secs */
#define prescale_value 0xffff

/* Resource of the WDT registers */
static struct resource *ar7_regs_wdt;
/* Pointer to the remapped WDT IO space */
static struct ar7_wdt *ar7_wdt;

Expand Down Expand Up @@ -265,9 +263,7 @@ static int ar7_wdt_probe(struct platform_device *pdev)
{
int rc;

ar7_regs_wdt =
platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
ar7_wdt = devm_ioremap_resource(&pdev->dev, ar7_regs_wdt);
ar7_wdt = devm_platform_ioremap_resource_byname(pdev, "regs");
if (IS_ERR(ar7_wdt))
return PTR_ERR(ar7_wdt);

Expand Down
2 changes: 2 additions & 0 deletions drivers/watchdog/bcm63xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ static long bcm63xx_wdt_ioctl(struct file *file, unsigned int cmd,

bcm63xx_wdt_pet();

fallthrough;

case WDIOC_GETTIMEOUT:
return put_user(wdt_time, p);

Expand Down
7 changes: 7 additions & 0 deletions drivers/watchdog/da9062_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ static int da9062_wdt_ping(struct watchdog_device *wdd)
struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd);
int ret;

/*
* Prevent pings from occurring late in system poweroff/reboot sequence
* and possibly locking out restart handler from accessing i2c bus.
*/
if (system_state > SYSTEM_RUNNING)
return 0;

ret = da9062_reset_watchdog_timer(wdt);
if (ret)
dev_err(wdt->hw->dev, "Failed to ping the watchdog (err = %d)\n",
Expand Down
7 changes: 7 additions & 0 deletions drivers/watchdog/da9063_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ static int da9063_wdt_ping(struct watchdog_device *wdd)
struct da9063 *da9063 = watchdog_get_drvdata(wdd);
int ret;

/*
* Prevent pings from occurring late in system poweroff/reboot sequence
* and possibly locking out restart handler from accessing i2c bus.
*/
if (system_state > SYSTEM_RUNNING)
return 0;

ret = regmap_write(da9063->regmap, DA9063_REG_CONTROL_F,
DA9063_WATCHDOG);
if (ret)
Expand Down
Loading

0 comments on commit 89d714a

Please sign in to comment.