public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Lukasz Majczak <lma@chromium.org>,
	Gwendal Grignou <gwendal@chromium.org>,
	Radoslaw Biernacki <biernacki@google.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Lee Jones <lee@kernel.org>, Benson Leung <bleung@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	chrome-platform@lists.linux.dev
Subject: Re: [PATCH v2 2/3] watchdog: Add ChromeOS EC-based watchdog driver
Date: Fri, 19 Jan 2024 13:28:34 +0800	[thread overview]
Message-ID: <ZaoIguOBWrahSRkv@google.com> (raw)
In-Reply-To: <17e323d8-f8d3-4e5a-91aa-0788b8026f21@roeck-us.net>

On Thu, Jan 18, 2024 at 07:55:39PM -0800, Guenter Roeck wrote:
> On 1/18/24 19:42, Tzung-Bi Shih wrote:
> > 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?
> > 
> 
> Reporting the reason of the previous reset/restart is part of the watchdog API.

Oh, I see.  It is in cros_ec_wdt_probe(): `wdd->bootstatus`.

+static int cros_ec_wdt_probe(struct platform_device *pdev)
+{
[...]
+	arg.req.command = EC_HANG_DETECT_CMD_GET_STATUS;
+	ret = cros_ec_wdt_send_cmd(cros_ec, &arg);
[...]
+	if (arg.resp.status == EC_HANG_DETECT_AP_BOOT_EC_WDT)
+		wdd->bootstatus = WDIOF_CARDRESET;

  reply	other threads:[~2024-01-19  5:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 19:53 [PATCH v2 0/3] Introduce EC-based watchdog Lukasz Majczak
2024-01-18 19:53 ` [PATCH v2 1/3] platform/chrome: Update binary interface for " Lukasz Majczak
2024-01-18 23:42   ` Guenter Roeck
2024-01-19  3:41   ` Tzung-Bi Shih
2024-01-19  8:34     ` Łukasz Majczak
2024-01-18 19:53 ` [PATCH v2 2/3] watchdog: Add ChromeOS EC-based watchdog driver Lukasz Majczak
2024-01-18 23:44   ` Guenter Roeck
2024-01-19  3:42   ` Tzung-Bi Shih
2024-01-19  3:55     ` Guenter Roeck
2024-01-19  5:28       ` Tzung-Bi Shih [this message]
2024-01-18 19:53 ` [PATCH v2 3/3] mfd: cros_ec: Register EC-based watchdog subdevice Lukasz Majczak
2024-01-18 23:44   ` Guenter Roeck
2024-01-19  8:36     ` Łukasz Majczak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZaoIguOBWrahSRkv@google.com \
    --to=tzungbi@kernel.org \
    --cc=biernacki@google.com \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=krzk@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lma@chromium.org \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox