mbox series

[v2,0/3] Introduce EC-based watchdog

Message ID 20240118195325.2964918-1-lma@chromium.org
Headers show
Series Introduce EC-based watchdog | expand

Message

Łukasz Majczak Jan. 18, 2024, 7:53 p.m. UTC
Chromeos devices are equipped with the embedded controller (EC)
that can be used as a watchdog. The following patches
updates the structures and definitions required to
communicate with EC-based watchdog and implements the
driver itself.

The first version of this patch was sent here:
https://patchwork.kernel.org/project/linux-watchdog/patch/20240117102450.4080839-1-lma@chromium.org/

Changelog
V1->V2:
* Splitted into three patches
* Supplement the watchdog configuration with min/max timeouts
* Removed struct cros_ec_wdt_data  and get aligned to watchdog framework
* Simplified suspend/resume callbacks
* Removed excessive log messages
* Reworked cros_ec_wdt_send_hang_detect() function to be more generic
* Usage of devm_* allowed to delete .remove module callback
* Changed MODULE_ALIAS to MODULE_DEVICE_TABLE
* Moved clearing bootstatus (on EC) to probe() and thanks to that
  got rid of .shutdown() module callback
* Fixed/removed comments, removed unused includes and general cleanup

Best regards,
Lukasz

Lukasz Majczak (3):
  platform/chrome: Update binary interface for EC-based watchdog
  watchdog: Add ChromeOS EC-based watchdog driver
  mfd: cros_ec: Register EC-based watchdog subdevice

 MAINTAINERS                                   |   6 +
 drivers/mfd/cros_ec_dev.c                     |   9 +
 drivers/watchdog/Kconfig                      |  11 +
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/cros_ec_wdt.c                | 202 ++++++++++++++++++
 .../linux/platform_data/cros_ec_commands.h    |  78 +++----
 6 files changed, 264 insertions(+), 43 deletions(-)
 create mode 100644 drivers/watchdog/cros_ec_wdt.c

Comments

Tzung-Bi Shih Jan. 19, 2024, 3:41 a.m. UTC | #1
On Thu, Jan 18, 2024 at 07:53:22PM +0000, Lukasz Majczak wrote:
> +#define EC_HANG_DETECT_MIN_TIMEOUT 5
> +#define EC_HANG_DETECT_MAX_TIMEOUT 65535

EC_HANG_DETECT_MAX_TIMEOUT isn't in the latest ec_commands.h [1].  Could you
either add EC_HANG_DETECT_MAX_TIMEOUT to ec_commands.h or drop the macro here?

[1] https://crrev.com/5a76e67210b15fcf67d8a6f90439993598949ae4/include/ec_commands.h#4749
Łukasz Majczak Jan. 19, 2024, 8:34 a.m. UTC | #2
On Fri, Jan 19, 2024 at 4:41 AM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
>
> On Thu, Jan 18, 2024 at 07:53:22PM +0000, Lukasz Majczak wrote:
> > +#define EC_HANG_DETECT_MIN_TIMEOUT 5
> > +#define EC_HANG_DETECT_MAX_TIMEOUT 65535
>
> EC_HANG_DETECT_MAX_TIMEOUT isn't in the latest ec_commands.h [1].  Could you
> either add EC_HANG_DETECT_MAX_TIMEOUT to ec_commands.h or drop the macro here?
>
> [1] https://crrev.com/5a76e67210b15fcf67d8a6f90439993598949ae4/include/ec_commands.h#4749

Yes, I will update ec_commands.h on the EC-side to match above
definitions although it doesn't influence any logic on the EC side.

Best regards
Lukasz