public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic
@ 2023-07-17 23:29 Rob Barnes
  2023-07-17 23:48 ` Benson Leung
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rob Barnes @ 2023-07-17 23:29 UTC (permalink / raw)
  To: pmalani, chrome-platform
  Cc: robbarnes, briannorris, Benson Leung, Guenter Roeck, linux-kernel

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic
  2023-07-17 23:29 [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic Rob Barnes
@ 2023-07-17 23:48 ` Benson Leung
  2023-07-17 23:54 ` Guenter Roeck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Benson Leung @ 2023-07-17 23:48 UTC (permalink / raw)
  To: Rob Barnes
  Cc: pmalani, chrome-platform, briannorris, Guenter Roeck,
	linux-kernel, Tzung-Bi Shih

Hi Rob,

On Mon, Jul 17, 2023 at 4:29 PM Rob Barnes <robbarnes@google.com> wrote:
>
> 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>

Reviewed-by: Benson Leung <bleung@chromium.org>


> ---
>
>  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
>


-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic
  2023-07-17 23:29 [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic Rob Barnes
  2023-07-17 23:48 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2023-07-17 23:54 UTC (permalink / raw)
  To: Rob Barnes
  Cc: pmalani, chrome-platform, briannorris, Benson Leung,
	Guenter Roeck, linux-kernel

On Mon, Jul 17, 2023 at 4:29 PM Rob Barnes <robbarnes@google.com> wrote:
>
> 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>

Makes sense.

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> ---
>
>  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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic
  2023-07-17 23:29 [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic Rob Barnes
  2023-07-17 23:48 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-07-18  2:50 UTC (permalink / raw)
  To: Rob Barnes
  Cc: pmalani, chrome-platform, briannorris, bleung, groeck,
	linux-kernel

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Mon, 17 Jul 2023 23:29:32 +0000 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - drivers/cros_ec: Emergency sync filesystem on EC panic
    https://git.kernel.org/chrome-platform/c/a6edd5f5d9cc

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic
  2023-07-17 23:29 [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic Rob Barnes
                   ` (2 preceding siblings ...)
  2023-07-18  2:50 ` patchwork-bot+chrome-platform
@ 2023-07-19  2:10 ` patchwork-bot+chrome-platform
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-07-19  2:10 UTC (permalink / raw)
  To: Rob Barnes
  Cc: pmalani, chrome-platform, briannorris, bleung, groeck,
	linux-kernel

Hello:

This patch was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Mon, 17 Jul 2023 23:29:32 +0000 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - drivers/cros_ec: Emergency sync filesystem on EC panic
    https://git.kernel.org/chrome-platform/c/a6edd5f5d9cc

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-19  2:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 23:29 [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic Rob Barnes
2023-07-17 23:48 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox