lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 19 Jan 2024 11:42:03 +0800
From: Tzung-Bi Shih <tzungbi@...nel.org>
To: Lukasz Majczak <lma@...omium.org>
Cc: Gwendal Grignou <gwendal@...omium.org>,
	Radoslaw Biernacki <biernacki@...gle.com>,
	Wim Van Sebroeck <wim@...ux-watchdog.org>,
	Lee Jones <lee@...nel.org>, Benson Leung <bleung@...omium.org>,
	Guenter Roeck <groeck@...omium.org>,
	Krzysztof Kozlowski <krzk@...nel.org>,
	linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org,
	chrome-platform@...ts.linux.dev
Subject: Re: [PATCH v2 2/3] watchdog: Add ChromeOS EC-based watchdog driver

On Thu, Jan 18, 2024 at 07:53:23PM +0000, Lukasz Majczak wrote:
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 7d22051b15a2..4700b218340f 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -181,6 +181,17 @@ config BD957XMUF_WATCHDOG
>  	  watchdog. Alternatively say M to compile the driver as a module,
>  	  which will be called bd9576_wdt.
>  
> +config CROS_EC_WATCHDOG
> +	tristate "ChromeOS EC-based watchdog"
> +	select WATCHDOG_CORE
> +	depends on CROS_EC
> +	help
> +	  Watchdog driver for Chromebook devices equipped with embedded controller.
> +	  Trigger event is recorded in EC and checked on the subsequent boot.

Perhaps unrelated to the patch, but I'm curious what the mechanism is.  Does
it use any existing paths for checking the saved events in EC?  What it does
if there is a saved WDT reset event?

> diff --git a/drivers/watchdog/cros_ec_wdt.c b/drivers/watchdog/cros_ec_wdt.c
[...]
> +static int cros_ec_wdt_ping(struct watchdog_device *wdd)
> +{
[...]
> +	arg.req.command = EC_HANG_DETECT_CMD_RELOAD;
> +	ret = cros_ec_wdt_send_cmd(cros_ec, &arg);
> +	if (ret < 0)
> +		dev_dbg(wdd->parent, "Failed to ping watchdog (%d)", ret);

I think this would be worth dev_info() or dev_warn()?

> +static int cros_ec_wdt_start(struct watchdog_device *wdd)
> +{
[...]
> +	/* Prepare watchdog on EC side */
> +	arg.req.command = EC_HANG_DETECT_CMD_SET_TIMEOUT;
> +	arg.req.reboot_timeout_sec = wdd->timeout;
> +	ret = cros_ec_wdt_send_cmd(cros_ec, &arg);
> +	if (ret < 0)
> +		dev_dbg(wdd->parent, "Failed to start watchdog (%d)", ret);

Same here: dev_info() or dev_warn()?

> +static int cros_ec_wdt_stop(struct watchdog_device *wdd)
> +{
[...]
> +	arg.req.command = EC_HANG_DETECT_CMD_CANCEL;
> +	ret = cros_ec_wdt_send_cmd(cros_ec, &arg);
> +	if (ret < 0)
> +		dev_dbg(wdd->parent, "Failed to stop watchdog (%d)", ret);

Same here: dev_info() or dev_warn()?

> +static int cros_ec_wdt_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
> +	struct cros_ec_device *cros_ec = ec_dev->ec_dev;
> +	struct watchdog_device *wdd;
> +	union cros_ec_wdt_data arg;
> +	int ret = 0;

nit: `ret` doesn't need to be initialized.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ