All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Barnes <robbarnes@google.com>
To: pmalani@chromium.org, chrome-platform@lists.linux.dev
Cc: robbarnes@google.com, briannorris@chromium.org,
	 Benson Leung <bleung@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic
Date: Mon, 17 Jul 2023 23:29:32 +0000	[thread overview]
Message-ID: <20230717232932.1.I361812b405bd07772f66660624188339ab158772@changeid> (raw)

Perform an emergency filesystem sync when an EC panic is reported. An
emergency sync actually performs two syncs internally in case some
inodes or pages are temporarily locked.

hw_protection_shutdown is replaced for a few reasons. It is unnecessary
because the EC will force reset either way. hw_protection_shutdown does
not reliably sync filesystem before shutting down. emergency_sync is not
synchronous so hw_protection_shutdown may interrupt emergency_sync.

Signed-off-by: Rob Barnes <robbarnes@google.com>
---

 drivers/platform/chrome/cros_ec_lpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 500a61b093e47..9652fc073c2a4 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -327,8 +327,8 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
 		dev_emerg(ec_dev->dev, "CrOS EC Panic Reported. Shutdown is imminent!");
 		blocking_notifier_call_chain(&ec_dev->panic_notifier, 0, ec_dev);
 		kobject_uevent_env(&ec_dev->dev->kobj, KOBJ_CHANGE, (char **)env);
-		/* Begin orderly shutdown. Force shutdown after 1 second. */
-		hw_protection_shutdown("CrOS EC Panic", 1000);
+		/* Force sync the filesystem before EC resets */
+		emergency_sync();
 		/* Do not query for other events after a panic is reported */
 		return;
 	}
-- 
2.41.0.255.g8b1d071c50-goog


             reply	other threads:[~2023-07-17 23:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 23:29 Rob Barnes [this message]
2023-07-17 23:48 ` [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic Benson Leung
2023-07-17 23:54 ` Guenter Roeck
2023-07-18  2:50 ` patchwork-bot+chrome-platform
2023-07-19  2:10 ` patchwork-bot+chrome-platform

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=20230717232932.1.I361812b405bd07772f66660624188339ab158772@changeid \
    --to=robbarnes@google.com \
    --cc=bleung@chromium.org \
    --cc=briannorris@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=groeck@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmalani@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.