Commit Graph

2800 Commits

Author SHA1 Message Date
Andy Shevchenko
5f1cda5110 platform/x86: intel_scu_wdt: Move intel_scu_wdt.h to x86 subfolder
This is a platform/x86 library that can only be used on x86 devices.
so it makes sense that it lives under the platform_data/x86/ directory
instead.

No functional changes intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240909124952.1152017-4-andriy.shevchenko@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2024-09-11 14:26:08 +02:00
Mika Westerberg
c912ac66b3 platform/x86: intel_scu_ipc: Move intel_scu_ipc.h out of arch/x86/include/asm
This is a platform/x86 library that is mostly being used by other
drivers not directly under arch/x86 anyway (with the exception of the
Intel MID setup code) so it makes sense that it lives under the
platform_data/x86/ directory instead.

No functional changes intended.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240909124952.1152017-3-andriy.shevchenko@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2024-09-11 14:26:03 +02:00
Linus Torvalds
b2eed73360 linux-watchdog 6.11-rc1 tag
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iEYEABECAAYFAmaglhIACgkQ+iyteGJfRspBfQCgnL07s+8mWMcfjYhc92La4573
 Z8QAniBh5nvymZRNKpslMR4UEuCCI3gt
 =IrbV
 -----END PGP SIGNATURE-----

Merge tag 'linux-watchdog-6.11-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

 - make watchdog_class const

 - rework of the rzg2l_wdt driver

 - other small fixes and improvements

* tag 'linux-watchdog-6.11-rc1' of git://www.linux-watchdog.org/linux-watchdog:
  dt-bindings: watchdog: dlg,da9062-watchdog: Drop blank space
  watchdog: rzn1: Convert comma to semicolon
  watchdog: lenovo_se10_wdt: Convert comma to semicolon
  dt-bindings: watchdog: renesas,wdt: Document RZ/G3S support
  watchdog: rzg2l_wdt: Add suspend/resume support
  watchdog: rzg2l_wdt: Rely on the reset driver for doing proper reset
  watchdog: rzg2l_wdt: Remove comparison with zero
  watchdog: rzg2l_wdt: Remove reset de-assert from probe
  watchdog: rzg2l_wdt: Check return status of pm_runtime_put()
  watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
  watchdog: rzg2l_wdt: Make the driver depend on PM
  watchdog: rzg2l_wdt: Restrict the driver to ARCH_RZG2L and ARCH_R9A09G011
  watchdog: imx7ulp_wdt: keep already running watchdog enabled
  watchdog: starfive: Add missing clk_disable_unprepare()
  watchdog: Make watchdog_class const
2024-07-25 10:18:35 -07:00
Chen Ni
1bb3b542cb watchdog: rzn1: Convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Fixes: d65112f584 ("watchdog: Add Renesas RZ/N1 Watchdog driver")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240716031137.400502-1-nichen@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-18 20:35:40 +02:00
Chen Ni
2c58070fde watchdog: lenovo_se10_wdt: Convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Fixes: 1f6602c8ed ("watchdog: lenovo_se10_wdt: Watchdog driver for Lenovo SE10 platform")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://lore.kernel.org/r/20240716030725.400400-1-nichen@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-18 20:35:40 +02:00
Linus Torvalds
1200af3ac1 - New Drivers
- Add support for ROHM BD96801 Power Management IC
    - Add support for Cirrus Logic CS40L50 Haptic Driver with Waveform Memory
    - Add support for Marvell 88PM886 Power Management IC
 
  - New Device Support
    - Add support for Keyboard Backlight to ChromeOS Embedded Controller
    - Add support for LEDs to ChromeOS Embedded Controller
    - Add support for Charge Control to ChromeOS Embedded Controller
    - Add support for the HW Monitoring Service to ChromeOS Embedded Controller
    - Add support for AUXADCs to MediaTek MT635{7,8,9} Power Management ICs
 
  - New Functionality
    - Allow Syscon consumers to supply their own Regmaps on registration
 
  - Fix-ups
    - Constify/staticise applicable data structures
    - Remove superfluous/duplicated/unused sections
    - Device Tree binding adaptions/conversions/creation
    - Trivial; spelling, whitespace, coding-style adaptions
    - Utilise centrally provided helpers and macros to aid simplicity/duplication
    - Drop i2c_device_id::driver_data where the value is unused
    - Replace ACPI/DT firmware helpers with agnostic variants
    - Move over to GPIOD (descriptor-based) APIs
    - Annotate a bunch of __counted_by() cases
    - Straighten out some includes
 
  - Bug Fixes
    - Ensure potentially asserted recent lines are deasserted during initialisation
    - Avoid "<module>.ko is added to multiple modules" warnings
    - Supply a bunch of MODULE_DESCRIPTIONs to silence modpost warnings
    - Fix Wvoid-pointer-to-enum-cast warnings
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmaWf6sACgkQUa+KL4f8
 d2HhAw//UMujhKk/IfzGck3RoaKH3H22oVpd98BpzJCZBKSpl9pGsumHCicBMVAK
 gp8SuwKNCAX+Fa/TubHz0xH6FWxLFXezh5DvO1t1DrPNokG+u4QPTfgMJ1IfBMHO
 w7aL74rtJEyWBeod4+qNVoq6KNDaWjiWQlxGQ+9IoSNmxSTL6pkYMqo935RnqhRr
 nm2TfSOIshk4tiO9tVA1ecCgjVwsG51803hypmd1AH6qBb7JsY6k1HWukLGaqUiV
 +57oQzCTPIRYJhYdca06xi4ZmPg2kmoYKlxqW5ExyM7Mxs9aZZzwwZ7929LKXC6o
 ebAPDc3auoww7B5mHbbVuBj0gDZKtfXpBRKSHLNtmhi0xmjnwZxQIumkpVGQALkI
 0TQffgYVU4O7IXsAZG9w5igyMzEo9SZJMyrfFaQ0iB3rx5bXuh4b6btfewAkyI1H
 +o3Yjymf4CR1trY9qnWCGWM/COQLIiGRhsk/RqGjy0xtpQo1Skx+AIkc6QD2zl6Y
 ohC0JzEWTQe7c1DOM3SLpNoCb/GbFpVi0RrXRVfRltPHpVb/r54Zlbo+PrCaC8FB
 EkU+86XbxGMh7hLtz5yhmnNCWKHQ6jbaFESwtZLo4d42CKvZaobL4xVCL56OntsH
 ikmTNG+X0mUAZiCwGgK5OhEVCAtCcjRtz1U93wgDBaz7Y39z+yM=
 =DSjk
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Drivers:
   - ROHM BD96801 Power Management IC
   - Cirrus Logic CS40L50 Haptic Driver with Waveform Memory
   - Marvell 88PM886 Power Management IC

  New Device Support:
   - Keyboard Backlight to ChromeOS Embedded Controller
   - LEDs to ChromeOS Embedded Controller
   - Charge Control to ChromeOS Embedded Controller
   - HW Monitoring Service to ChromeOS Embedded Controller
   - AUXADCs to MediaTek MT635{7,8,9} Power Management ICs

  New Functionality:
   - Allow Syscon consumers to supply their own Regmaps on registration

  Fix-ups:
   - Constify/staticise applicable data structures
   - Remove superfluous/duplicated/unused sections
   - Device Tree binding adaptions/conversions/creation
   - Trivial; spelling, whitespace, coding-style adaptions
   - Utilise centrally provided helpers and macros to aid
     simplicity/duplication
   - Drop i2c_device_id::driver_data where the value is unused
   - Replace ACPI/DT firmware helpers with agnostic variants
   - Move over to GPIOD (descriptor-based) APIs
   - Annotate a bunch of __counted_by() cases
   - Straighten out some includes

  Bug Fixes:
   - Ensure potentially asserted recent lines are deasserted during
     initialisation
   - Avoid "<module>.ko is added to multiple modules" warnings
   - Supply a bunch of MODULE_DESCRIPTIONs to silence modpost warnings
   - Fix Wvoid-pointer-to-enum-cast warnings"

* tag 'mfd-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (87 commits)
  mfd: timberdale: Attach device properties to TSC2007 board info
  mfd: tmio: Move header to platform_data
  mfd: tmio: Sanitize comments
  mfd: tmio: Update include files
  mmc: tmio/sdhi: Fix includes
  mfd: tmio: Remove obsolete io accessors
  mfd: tmio: Remove obsolete platform_data
  watchdog: bd96801_wdt: Add missing include for FIELD_*()
  dt-bindings: mfd: syscon: Add APM poweroff mailbox
  dt-bindings: mfd: syscon: Split and enforce documenting MFD children
  dt-bindings: mfd: rk817: Merge support for RK809
  dt-bindings: mfd: rk817: Fixup clocks and reference dai-common
  dt-bindings: mfd: syscon: Add TI's opp table compatible
  mfd: omap-usb-tll: Use struct_size to allocate tll
  dt-bindings: mfd: Explain lack of child dependency in simple-mfd
  dt-bindings: mfd: Dual licensing for st,stpmic1 bindings
  mfd: omap-usb-tll: Annotate struct usbtll_omap with __counted_by
  mfd: tps6594-core: Remove unneeded semicolon in tps6594_check_crc_mode()
  mfd: lm3533: Move to new GPIO descriptor-based APIs
  mfd: tps65912: Use devm helper functions to simplify probe
  ...
2024-07-17 17:42:20 -07:00
Claudiu Beznea
0aad7c4438 watchdog: rzg2l_wdt: Add suspend/resume support
The RZ/G3S supports deep sleep states where power to most of the IP blocks
is cut off. To ensure proper working of the watchdog when resuming from
such states, the suspend function is stopping the watchdog and the resume
function is starting it. There is no need to configure the watchdog
in case the watchdog was stopped prior to starting suspend.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-9-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:34 +02:00
Claudiu Beznea
d8997ed79e watchdog: rzg2l_wdt: Rely on the reset driver for doing proper reset
The reset driver has been adapted in commit da235d2fac
("clk: renesas: rzg2l: Check reset monitor registers") to check the reset
monitor bits before declaring reset asserts/de-asserts as
successful/failure operations. With that, there is no need to keep the
reset workaround for RZ/V2M in place in the watchdog driver.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-8-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:34 +02:00
Claudiu Beznea
900b938335 watchdog: rzg2l_wdt: Remove comparison with zero
devm_add_action_or_reset() could return -ENOMEM or zero. Thus, remove
comparison with zero of the returning value to make code simpler.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-7-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:33 +02:00
Claudiu Beznea
064319c3fa watchdog: rzg2l_wdt: Remove reset de-assert from probe
There is no need to de-assert the reset signal on probe as the watchdog
is not used prior executing start. Also, the clocks are not enabled in
probe (pm_runtime_enable() doesn't do that), thus this is another indicator
that the watchdog wasn't used previously like this. Instead, keep the
watchdog hardware in its previous state at probe (by default it is in
reset state), enable it when it is started and move it to reset state
when it is stopped. This saves some extra power when the watchdog is
unused.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-6-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:33 +02:00
Claudiu Beznea
471e45a333 watchdog: rzg2l_wdt: Check return status of pm_runtime_put()
pm_runtime_put() may return an error code. Check its return status.

Along with it the rzg2l_wdt_set_timeout() function was updated to
propagate the result of rzg2l_wdt_stop() to its caller.

Fixes: 2cbc5cd0b5 ("watchdog: Add Watchdog Timer driver for RZ/G2L")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-5-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:32 +02:00
Claudiu Beznea
f0ba0fcdd1 watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
pm_runtime_get_sync() may return with error. In case it returns with error
dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get()
takes care of this. Thus use it.

Along with it the rzg2l_wdt_set_timeout() function was updated to
propagate the result of rzg2l_wdt_start() to its caller.

Fixes: 2cbc5cd0b5 ("watchdog: Add Watchdog Timer driver for RZ/G2L")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-4-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:32 +02:00
Claudiu Beznea
9e69846c68 watchdog: rzg2l_wdt: Make the driver depend on PM
The rzg2l_wdt watchdog driver cannot work w/o CONFIG_PM=y (e.g. the
clocks are enabled though pm_runtime_* specific APIs). To avoid building
a driver that doesn't work make explicit the dependency on CONFIG_PM.

Suggested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-3-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:31 +02:00
Claudiu Beznea
5e7069f296 watchdog: rzg2l_wdt: Restrict the driver to ARCH_RZG2L and ARCH_R9A09G011
The rzg2l_wdt driver is used only by ARCH_RZG2L and ARCH_R9A09G011
micro-architectures of Renesas. Thus, limit it's usage only to these.

Suggested-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-2-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:31 +02:00
Sascha Hauer
b771d14f41 watchdog: imx7ulp_wdt: keep already running watchdog enabled
When the bootloader enabled the watchdog before Kernel started then
keep it enabled during initialization. Otherwise the time between
the watchdog probing and the userspace taking over the watchdog
won't be covered by the watchdog. When keeping the watchdog enabled
inform the Kernel about this by setting the WDOG_HW_RUNNING so that
the periodic watchdog feeder is started when desired.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240703111603.1096424-1-s.hauer@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:30 +02:00
Chen Ni
9dca7a0ae5 watchdog: starfive: Add missing clk_disable_unprepare()
Add the missing clk_disable_unprepare() before return in
starfive_wdt_enable_clock().

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240628033508.281058-1-nichen@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:30 +02:00
Thomas Weißschuh
d794a74101 watchdog: Make watchdog_class const
Now that the driver core allows for struct class to be in read-only
memory, mark watchdog_class as const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240614-class-const-wdt-v1-1-f9a4e2b1ba76@weissschuh.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-07-10 20:01:30 +02:00
Matti Vaittinen
8b6742e5b3 watchdog: bd96801_wdt: Add missing include for FIELD_*()
The FIELD_PREP() and FIELD_GET() macros are defined in the
linux/bitfield.h. Include this header to avoid missing the macro
definitions.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406300817.hcJ9VtLf-lkp@intel.com/
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/ZoJhQVF-U6sSJ_Sg@fedora
Signed-off-by: Lee Jones <lee@kernel.org>
2024-07-09 10:40:02 +01:00
Matti Vaittinen
09dad69757 watchdog: ROHM BD96801 PMIC WDG driver
Introduce driver for WDG block on ROHM BD96801 scalable PMIC.

This driver only supports watchdog with I2C feeding and delayed
response detection. Whether the watchdog toggles PRSTB pin or
just causes an interrupt can be configured via device-tree.

The BD96801 PMIC HW supports also window watchdog (too early
feeding detection) and Q&A mode. These are not supported by
this driver.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/bb3a49d606e793a61b0c033170ff2a9f30f3c2a5.1719473802.git.mazziesaccount@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-06-27 09:24:45 +01:00
Jeff Johnson
acf9e67a76 watchdog: add missing MODULE_DESCRIPTION() macros
make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/watchdog/omap_wdt.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/watchdog/twl4030_wdt.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/watchdog/ts4800_wdt.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/watchdog/simatic-ipc-wdt.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/watchdog/menz69_wdt.o

Add the missing invocations of the MODULE_DESCRIPTION() macro.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240607-md-drivers-watchdog-v1-1-485c1c58301f@quicinc.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-06-15 12:49:57 +02:00
Arnd Bergmann
68e5afd8f4 watchdog: lenovo_se10_wdt: add HAS_IOPORT dependency
Once the inb()/outb() helpers become conditional, the newly added driver
fails to link on targets without CONFIG_HAS_IOPORT:

In file included from arch/arm64/include/asm/io.h:299,
                 from include/linux/io.h:14,
                 from drivers/watchdog/lenovo_se10_wdt.c:8:
drivers/watchdog/lenovo_se10_wdt.c: In function 'set_bram':
include/asm-generic/io.h:596:15: error: call to '_outb' declared with attribute error: outb() requires CONFIG_HAS_IOPORT
  596 | #define _outb _outb
include/asm-generic/io.h:655:14: note: in expansion of macro '_outb'
  655 | #define outb _outb
      |              ^~~~~
drivers/watchdog/lenovo_se10_wdt.c:67:9: note: in expansion of macro 'outb'
   67 |         outb(offset, bram_base);
      |         ^~~~

Add the same dependency we added to the other such drivers.

Fixes: 1f6602c8ed ("watchdog: lenovo_se10_wdt: Watchdog driver for Lenovo SE10 platform")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240528120759.3491774-1-arnd@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-06-15 12:49:57 +02:00
Geert Uytterhoeven
c45b8cfc6d watchdog: LENOVO_SE10_WDT should depend on X86 && DMI
The Lenovo SE10 watchdog is only present on Lenovo ThinkEdge SE10
platforms, which are based on Intel Atom SoCs, and its driver relies on
DMI tables.  Hence add dependencies on X86 && DMI, to prevent asking the
user about this driver when configuring a kernel without Intel Atom or
DMI support.

While at it, fix the odd indentation (spaces instead of TABs).

Fixes: 1f6602c8ed ("watchdog: lenovo_se10_wdt: Watchdog driver for Lenovo SE10 platform")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/58005595a05ef803b454b78d3ae9b8ee0675bd5d.1715076440.git.geert+renesas@glider.be
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-11 11:32:06 +02:00
Chen Ni
413bf4e857 watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe()
devm_ioremap() doesn't return error pointers, it returns NULL on error.
Update the check accordingly.

Fixes: e86bd43bcf ("watchdog: sa1100: use platform device registration")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240426075808.1582678-1-nichen@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-04 12:50:43 +02:00
Judith Mendez
cae5851653 watchdog: rti_wdt: Set min_hw_heartbeat_ms to accommodate a safety margin
On AM62x, the watchdog is pet before the valid window is open. Fix
min_hw_heartbeat and accommodate a 2% + static offset safety margin.
The static offset accounts for max hardware error.

Remove the hack in the driver which shifts the open window boundary,
since it is no longer necessary due to the fix mentioned above.

cc: stable@vger.kernel.org
Fixes: 5527483f8f ("watchdog: rti-wdt: attach to running watchdog during probe")
Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240417205700.3947408-1-jm@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-04 12:50:43 +02:00
Niklas Schnelle
52df67b6b3 watchdog: add HAS_IOPORT dependencies
In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at
compile time. We thus need to add HAS_IOPORT as dependency for those
drivers using them.

Co-developed-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240410084201.1481930-2-schnelle@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-04 12:50:42 +02:00
Dawei Li
4c97f0433d watchdog/wdt-main: Use cpumask_of() to avoid cpumask var on stack
In general it's preferable to avoid placing cpumasks on the stack, as
for large values of NR_CPUS these can consume significant amounts of
stack space and make stack overflows more likely.

Use cpumask_of() to avoid the need for a temporary cpumask on the stack

Signed-off-by: Dawei Li <set_pte_at@outlook.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/TYTP286MB3564B037A81DAAE1AC3A16F3CA062@TYTP286MB3564.JPNP286.PROD.OUTLOOK.COM
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-04 12:50:42 +02:00
Matti Vaittinen
e3b3afd34d watchdog: bd9576: Drop "always-running" property
The always-running (from linux,wdt-gpio.yaml) is abused by the BD9576
watchdog driver. It's defined meaning is "the watchdog is always running
and can not be stopped". The BD9576 watchdog driver has implemented it
as "start watchdog when loading the module and prevent it from being
stopped".

Furthermore, the implementation does not set the WDOG_HW_RUNNING when
enabling the watchdog due to the "always-running" at module loading.
This will end up resulting a watchdog timeout if the device is not
opened.

The culprit was pointed out by Guenter, discussion can be found from
https://lore.kernel.org/lkml/4fa3a64b-60fb-4e5e-8785-0f14da37eea2@roeck-us.net/

Drop the invalid "always-running" handling.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: b237bcac55 ("wdt: Support wdt on ROHM BD9576MUF and BD9573MUF")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/ZhPAt76yaJMersXf@fedora
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-04 12:50:41 +02:00
Krzysztof Kozlowski
56e23c6d7f watchdog: mtx-1: drop driver owner assignment
Core in platform_driver_register() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240327174638.519445-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-04 12:50:41 +02:00
Duoming Zhou
5736015212 watchdog: cpu5wdt.c: Fix use-after-free bug caused by cpu5wdt_trigger
When the cpu5wdt module is removing, the origin code uses del_timer() to
de-activate the timer. If the timer handler is running, del_timer() could
not stop it and will return directly. If the port region is released by
release_region() and then the timer handler cpu5wdt_trigger() calls outb()
to write into the region that is released, the use-after-free bug will
happen.

Change del_timer() to timer_shutdown_sync() in order that the timer handler
could be finished before the port region is released.

Fixes: e09d9c3e9f ("watchdog: cpu5wdt.c: add missing del_timer call")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240324140444.119584-1-duoming@zju.edu.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-04 12:50:40 +02:00
Mark Pearson
1f6602c8ed watchdog: lenovo_se10_wdt: Watchdog driver for Lenovo SE10 platform
Watchdog driver implementation for Lenovo SE10 platform.

Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: David Ober <dober@lenovo.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240315195227.91282-1-mpearson-lenovo@squebb.ca
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-05-04 12:50:40 +02:00
Linus Torvalds
032e22febf linux-watchdog 6.9-rc1 tag
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iEYEABECAAYFAmX20DQACgkQ+iyteGJfRsqIcgCeNaw/Nrzc2G4Lia/qjyYM2dUu
 geMAn1g5h/ucw07k5p2Oe8qHDp1eC0wu
 =PJHE
 -----END PGP SIGNATURE-----

Merge tag 'linux-watchdog-6.9-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

 - Remove usage of the deprecated ida_simple_xx() API

 - Add kernel-doc for wdt_set_timeout()

 - Add support for R-Car V4M, StarFive's JH8100 and sam9x7-wdt

 - Fixes and small improvements

* tag 'linux-watchdog-6.9-rc1' of git://www.linux-watchdog.org/linux-watchdog:
  watchdog: intel-mid_wdt: Get platform data via dev_get_platdata()
  watchdog: intel-mid_wdt: Don't use "proxy" headers
  watchdog: intel-mid_wdt: Remove unused intel-mid.h
  dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt
  dt-bindings: watchdog: sprd,sp9860-wdt: convert to YAML
  dt-bindings: watchdog: starfive,jh7100-wdt: Add compatible for JH8100
  watchdog: stm32_iwdg: initialize default timeout
  dt-bindings: watchdog: arm,sp805: document the reset signal
  watchdog: sp805_wdt: deassert the reset if available
  watchdog/hpwdt: Support Suspend and Resume
  dt-bindings: watchdog: renesas-wdt: Add support for R-Car V4M
  watchdog: starfive: check watchdog status before enabling in system resume
  watchdog: starfive: Check pm_runtime_enabled() before decrementing usage counter
  watchdog: qcom: fine tune the max timeout value calculation
  watchdog: Add kernel-doc for wdt_set_timeout()
  watchdog: core: Remove usage of the deprecated ida_simple_xx() API
2024-03-17 12:06:10 -07:00
Linus Torvalds
8403ce70be - New Device Support
- Add support for Watchdog to ChromeOS Embedded Controller
    - Add support for GPIOs to ChromeOS Embedded Controller
    - Add supprt for Sound to MediaTek MT6357 CODEC
 
  - New Functionality
    - Add power-off functionality to Texas Instruments TWL series CODECs
 
  - Fix-ups
    - Device Tree binding adaptions/conversions/creation
    - Use/convert to new/better APIs/helpers/MACROs instead of hand-rolling implementations
    - Trivial; spelling, whitespace, clean-ups, etc
    - Remove superfluous code and simplify overall
    - Fix include lists; alphabetise, remove unused, explicitly add used
    - Use dev_err_probe() to clean-up error paths
    - Convert used cache type over to the Maple Tree in many instances
    - Constify a bunch of static structs
    - Refrain from over-riding resources provided via the firmware
 
  - Bug Fixes
    - Fix a clock related firmware bug on Dell XPS 9530 et al.
    - Repair incorrect IRQ designations
    - Increase buffer sizes to omit various snprintf compiler errors
    - Ensure errors are handled properly
    - Balance references and prevent resource leaks
    - Rectify Power Key interrupt processing
    - Fix Kconfig related build errors
    - Correct a bunch of register start-up default values
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmXzCuoACgkQUa+KL4f8
 d2EEZxAAr0/rYzEVdzbkas5OacSLcIeXMrogIiNiFUs0u4yLuNVG9Yp4BsQP96J1
 anfmcaqM0c0ESfq91E5q9QGnB1Kr9MRS67F3JN6+vjo7QZCZorIjkIvQ40xqSqhz
 yz7l9lg3esHKvMEGuxMmDR8mOnyM0HVxul3GG4ss75uA3hJmQ871y2JSanSDs61t
 oRTz3us6Bydyv3RD5++ZtUHwLGtNqIiWO7ykGeeVGtYQYVOg8IbYIveR3bUW0Ij5
 7JGeI9+xw29Bo0pPGgsWpKyh4P17/uO/WobpKv2w6sxSqFgBdFZQSSq6HGFMzyHy
 13Hljpv1BbrOX9B2hSA+JFg2PwCCMnDKOlkepxvokLrldij4l7JJzgT+KNPCGgxz
 0tMJuvJ80nk12CvBh6CGcDi0MwZJQPeEpzMkzHPT/cXY+naVA035HyOzHLEtklAc
 Ssjn1ZNmro8KaBrinQuVztKqdLvIptm53zJiFCGawM8E1Pkb+cW/Tyyen/oVEbnr
 qw7a1q3Y6yCQplrzwRBPgnRn8/ErVv76b/lxrjLDF9QVkY96XIus4k0Zx3NDXwuh
 kwNDwVerduXTK55FvEMxKshcXyoYklVG/+C4tn1jQb49c5d5GKk428W4MYzZG6ML
 6beGWIerRdEzEmNvU0O3L0w6/tw+28rxtEOJLm6pTqHATI/CMLk=
 =YeJS
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Device Support:
   - Add support for Watchdog to ChromeOS Embedded Controller
   - Add support for GPIOs to ChromeOS Embedded Controller
   - Add supprt for Sound to MediaTek MT6357 CODEC

  New Functionality:
   - Add power-off functionality to Texas Instruments TWL series CODECs

  Fix-ups:
   - Device Tree binding adaptions/conversions/creation
   - Use/convert to new/better APIs/helpers/MACROs instead of
     hand-rolling implementations
   - Trivial; spelling, whitespace, clean-ups, etc
   - Remove superfluous code and simplify overall
   - Fix include lists; alphabetise, remove unused, explicitly add used
   - Use dev_err_probe() to clean-up error paths
   - Convert used cache type over to the Maple Tree in many instances
   - Constify a bunch of static structs
   - Refrain from over-riding resources provided via the firmware

  Bug Fixes:
   - Fix a clock related firmware bug on Dell XPS 9530 et al.
   - Repair incorrect IRQ designations
   - Increase buffer sizes to omit various snprintf compiler errors
   - Ensure errors are handled properly
   - Balance references and prevent resource leaks
   - Rectify Power Key interrupt processing
   - Fix Kconfig related build errors
   - Correct a bunch of register start-up default values"

* tag 'mfd-next-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (65 commits)
  mfd: cs42l43: Fix wrong GPIO_FN_SEL and SPI_CLK_CONFIG1 defaults
  mfd: cs42l43: Fix wrong register defaults
  mfd: mt6397-core: Register mt6357 sound codec
  dt-bindings: mfd: syscon: Add ti,am62-usb-phy-ctrl compatible
  dt-bindings: mfd: dlg,da9063: Make #interrupt-cells required
  dt-bindings: mfd: Convert atmel-flexcom to json-schema
  mfd: kempld-core: Don't replace resources provided by ACPI
  mfd: cros_ec_dev: Add GPIO device if feature present on EC
  dt-bindings: mfd: cros-ec: Add properties for GPIO controller
  mfd: twl: Select MFD_CORE
  mfd: core: Constify the struct device_type usage
  mfd: rk8xx-core: Fix interrupt processing order for power key button
  mfd: twl4030-power: Accept standard property for power controller
  mfd: twl-core: Add power off implementation for twl603x
  dt-bindings: mfd: ti,twl: Document system-power-controller
  mfd: altera-sysmgr: Call of_node_put() only when of_parse_phandle() takes a ref
  mfd: syscon: Remove extern from function prototypes
  mfd: syscon: Call of_node_put() only when of_parse_phandle() takes a ref
  mfd: mc13xxx: Use bitfield helpers
  mfd: rc5t583: Convert to use maple tree register cache
  ...
2024-03-14 10:29:47 -07:00
Andy Shevchenko
6fe5aabf7f watchdog: intel-mid_wdt: Get platform data via dev_get_platdata()
Access to platform data via dev_get_platdata() getter to make code cleaner.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240305165306.1366823-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-10 11:14:46 +01:00
Andy Shevchenko
e295eb8235 watchdog: intel-mid_wdt: Don't use "proxy" headers
Update header inclusions to follow IWYU (Include What You Use)
principle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240305165306.1366823-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-10 11:14:46 +01:00
Andy Shevchenko
3250647eed watchdog: intel-mid_wdt: Remove unused intel-mid.h
intel-mid.h is providing some core parts of the South Complex PM,
which are usually are not used by individual drivers. In particular,
this driver doesn't use it, so simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240305165306.1366823-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-10 11:14:45 +01:00
Ben Wolsieffer
dbd7c0088b watchdog: stm32_iwdg: initialize default timeout
The driver never sets a default timeout value, therefore it is
initialized to zero. When CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED is
enabled, the watchdog is started during probe. The kernel is supposed to
automatically ping the watchdog from this point until userspace takes
over, but this does not happen if the configured timeout is zero. A zero
timeout causes watchdog_need_worker() to return false, so the heartbeat
worker does not run and the system therefore resets soon after the
driver is probed.

This patch fixes this by setting an arbitrary non-zero default timeout.
The default could be read from the hardware instead, but I didn't see
any reason to add this complexity.

This has been tested on an STM32F746.

Fixes: 85fdc63fe2 ("drivers: watchdog: stm32_iwdg: set WDOG_HW_RUNNING at probe")
Signed-off-by: Ben Wolsieffer <ben.wolsieffer@hefring.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240228182723.12855-1-ben.wolsieffer@hefring.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-03 14:17:31 +01:00
Yang Xiwen
575f100c1c watchdog: sp805_wdt: deassert the reset if available
According to the datasheet, the core has an WDOGRESn input signal that
needs to be deasserted before being operational. Implement it in the
driver.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240221-hisi-wdt-v3-1-9642613dc2e6@outlook.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-03 14:17:30 +01:00
Jerry Hoemann
12b8ab42e1 watchdog/hpwdt: Support Suspend and Resume
Add call backs to support suspend and resume.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240214164941.630775-2-jerry.hoemann@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-03 14:17:30 +01:00
Ji Sheng Teoh
d869d6352a watchdog: starfive: check watchdog status before enabling in system resume
System resume will start and enable watchdog regardless of whether the
watchdog is enabled/disabled during a system suspend.
Add a check to the watchdog status and only start and enable the
watchdog if the watchdog status is running/active.

Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>
Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240130055118.1917086-1-jisheng.teoh@starfivetech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-03 14:17:29 +01:00
Ji Sheng Teoh
8bc22a2f1b watchdog: starfive: Check pm_runtime_enabled() before decrementing usage counter
In the probe function, pm_runtime_put_sync() will fail on platform with
runtime PM disabled.
Check if runtime PM is enabled before calling pm_runtime_put_sync() to
fix it.

Fixes: db728ea9c7 ("drivers: watchdog: Add StarFive Watchdog driver")
Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240119082722.1133024-1-jisheng.teoh@starfivetech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-03 14:17:28 +01:00
Kathiravan Thirumoorthy
975e4b273e watchdog: qcom: fine tune the max timeout value calculation
To determine the max_timeout value, the below calculation is used.

	max_timeout = 0x10000000 / clk_rate

cat /sys/devices/platform/soc@0/b017000.watchdog/watchdog/watchdog0/max_timeout
8388

However, this is not valid for all the platforms. IPQ SoCs starting from
IPQ40xx and recent Snapdragron SoCs also has the bark and bite time field
length of 20bits, which can hold max up to 32 seconds if the clk_rate is
32KHz.

If the user tries to configure the timeout more than 32s, then the value
will be truncated and the actual value will not be reflected in the HW.

To avoid this, lets add a variable called max_tick_count in the device data,
which defines max counter value of the WDT controller. Using this, max-timeout
will be calculated in runtime for various WDT contorllers.

With this change, we get the proper max_timeout as below and restricts
the user from configuring the timeout higher than this.

cat /sys/devices/platform/soc@0/b017000.watchdog/watchdog/watchdog0/max_timeout
32

Signed-off-by: Kathiravan Thirumoorthy <quic_kathirav@quicinc.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240116-wdt-v2-1-501c7694c3f0@quicinc.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-03 14:17:28 +01:00
Yang Li
d2f656dc49 watchdog: Add kernel-doc for wdt_set_timeout()
The wdt_set_timeout function lacked a complete kernel-doc
description. This patch adds missing parameter and return
value descriptions in accordance with kernel-doc standards.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Guenter Roeck <linux@roeckus.net>
Link: https://lore.kernel.org/r/20240206093857.62444-1-yang.lee@linux.alibaba.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-03 14:17:27 +01:00
Christophe JAILLET
b568b1504d watchdog: core: Remove usage of the deprecated ida_simple_xx() API
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

Note that the upper limit of ida_simple_get() is exclusive, but the one of
ida_alloc_range()/ida_alloc_max() is inclusive. So a -1 has been added when
needed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/bc5b82db59ccac69f2612ba104e2f5100401a862.1705009009.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2024-03-03 14:17:27 +01:00
Peter Griffin
746f0770f9 watchdog: s3c2410_wdt: use exynos_get_pmu_regmap_by_phandle() for PMU regs
Obtain the PMU regmap using the new API added to exynos-pmu driver rather
than syscon_regmap_lookup_by_phandle(). As this driver no longer depends
on mfd syscon remove that header and Kconfig dependency.

Tested-by: Alexey Klimov <alexey.klimov@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20240220220613.797068-3-peter.griffin@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2024-02-25 11:39:25 +01:00
Lukasz Majczak
843dac4d36 watchdog: Add ChromeOS EC-based watchdog driver
Embedded Controller (EC) present on Chromebook devices
can be used as a watchdog.
Implement a driver to support it.

Signed-off-by: Lukasz Majczak <lma@chromium.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240126095721.782782-3-lma@chromium.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-02-01 11:49:30 +00:00
Linus Torvalds
61f4c3e671 linux-watchdog 6.8-rc1 tag
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iEYEABECAAYFAmWZQ70ACgkQ+iyteGJfRsqnWQCdEDp3l3BMyRPveNBdoH4lbhwa
 B9oAoJc0ZmbW4DKavdyWKt4wya7ByD6h
 =+x8M
 -----END PGP SIGNATURE-----

Merge tag 'linux-watchdog-6.8-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

 - Add Mediatek MT7988 watchdog

 - Add IT8659 watchdog

 - watchdog: set cdev owner before adding

 - hpwdt: Only claim UNKNOWN NMI if from iLO

 - Various other fixes and improvements

* tag 'linux-watchdog-6.8-rc1' of git://www.linux-watchdog.org/linux-watchdog: (30 commits)
  watchdog: mlx_wdt: fix all kernel-doc warnings
  dt-bindings: watchdog: qcom,pm8916-wdt: add parent spmi node to example
  dt-bindings: watchdog: nxp,pnx4008-wdt: convert txt to yaml
  dt-bindings: watchdog: qca,ar7130-wdt: convert txt to yaml
  dt-bindings: watchdog: intel,keembay: reference common watchdog schema
  dt-bindings: watchdog: re-order entries to match coding convention
  watchdog: it87_wdt: Keep WDTCTRL bit 3 unmodified for IT8784/IT8786
  watchdog: it87_wdt: Add IT8659 ID
  watchdog: it87_wdt: Remove redundant max_units setting
  watchdog: it87_wdt: add blank line after variable declaration
  dt-bindings: wdt: Add ts72xx
  dt-bindings: watchdog: dlg,da9062-watchdog: Document DA9063 watchdog
  dt-bindings: watchdog: dlg,da9062-watchdog: Add fallback for DA9061 watchdog
  watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused
  watchdog: starfive: add lock annotations to fix context imbalances
  watchdog: mediatek: mt7988: add wdt support
  dt-bindings: watchdog: mediatek,mtk-wdt: add MT7988 watchdog and toprgu
  dt-bindings: watchdog: realtek,rtd1295-watchdog: convert txt to yaml
  watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling
  watchdog/hpwdt: Remove unused variable
  ...
2024-01-12 13:32:30 -08:00
Randy Dunlap
9546b21ea6 watchdog: mlx_wdt: fix all kernel-doc warnings
Correct kernel-doc warnings as reported by kernel test robot:

mlx_wdt.c:56: warning: Function parameter or member 'wdt_type' not described in 'mlxreg_wdt'
mlx_wdt.c:56: warning: Excess struct member 'device' description in 'mlxreg_wdt'
mlx_wdt.c:56: warning: Excess struct member 'timeout' description in 'mlxreg_wdt'
mlx_wdt.c:56: warning: Excess struct member 'wd_type' description in 'mlxreg_wdt'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312171701.xNkzdgdi-lkp@intel.com/
Cc: Michael Shych <michaelsh@nvidia.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231218062659.26916-1-rdunlap@infradead.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2023-12-24 10:44:40 +01:00
Werner Fischer
d12971849d watchdog: it87_wdt: Keep WDTCTRL bit 3 unmodified for IT8784/IT8786
WDTCTRL bit 3 sets the mode choice for the clock input of IT8784/IT8786.
Some motherboards require this bit to be set to 1 (= PCICLK mode),
otherwise the watchdog functionality gets broken. The BIOS of those
motherboards sets WDTCTRL bit 3 already to 1.

Instead of setting all bits of WDTCTRL to 0 by writing 0x00 to it, keep
bit 3 of it unchanged for IT8784/IT8786 chips. In this way, bit 3 keeps
the status as set by the BIOS of the motherboard.

Watchdog tests have been successful with this patch with the following
systems:
  IT8784: Thomas-Krenn LES plus v2 (YANLING YL-KBRL2 V2)
  IT8786: Thomas-Krenn LES plus v3 (YANLING YL-CLU L2)
  IT8786: Thomas-Krenn LES network 6L v2 (YANLING YL-CLU6L)

Link: https://lore.kernel.org/all/140b264d-341f-465b-8715-dacfe84b3f71@roeck-us.net/

Signed-off-by: Werner Fischer <devlists@wefi.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231213094525.11849-4-devlists@wefi.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2023-12-17 16:14:27 +01:00
Werner Fischer
ab6dea00fd watchdog: it87_wdt: Add IT8659 ID
This patch adds watchdog support for the ITE IT8659 watchdog.
IT8659 watchdog works in the same way as the other watchdogs supported
by it87_wdt.

Before this patch, IT8659 watchdog is not supported. After a modprobe,
dmesg reports:
  it87_wdt: Unknown Chip found, Chip 8659 Revision 0007

With this patch, modprobe it87_wdt recognizes the watchdog as the dmesg
output shows:
  it87_wdt: Chip IT8659 revision 7 initialized. timeout=60 sec (nowayout=0
  testmode=0)

Watchdog tests on a YANLING YL-ALP3L2C-1235U system have been successful,
the watchdog works as expected with this patch.

Signed-off-by: Werner Fischer <devlists@wefi.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231213094525.11849-3-devlists@wefi.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2023-12-17 16:14:26 +01:00
Werner Fischer
133530a5b9 watchdog: it87_wdt: Remove redundant max_units setting
Commit 893dc8b5c9 ("watchdog: it87: Drop support for resetting watchdog
though CIR and Game port") removed the try_gameport variable, and left
max_units setting redundant.

To clean up the code, this patch removes this redundant setting.

Signed-off-by: Werner Fischer <devlists@wefi.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231213094525.11849-2-devlists@wefi.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2023-12-17 16:14:26 +01:00