Re: [PATCH] platform/chrome: cros_ec: trigger kernel_restart on EC_HOST_EVENT_PANIC

From: Tzung-Bi Shih

Date: Sun Oct 18 2026 - 22:50:53 EST


On Wed, Oct 14, 2026 at 01:57:22PM -0700, Scott Collyer wrote:
> Yes, if the EC crashed, the the AP will be reset. There is a slight benefit
> for the EC case in that a controlled shutdown gets triggered. But, the
> primary motivation for this change is to trigger an AP reset if the ISH
> panics. If the ISH panics, there isn't any trigger currently to reboot the
> AP and this leads to the sensor stack being out of sync.

Please don't top-posting [1].

I don't think this is the right approach, given that:
- cros_ec_handle_event() is a generic event dispatcher for all EC
instances, not a place for device-specific event handling.
- The ISH driver or sensor stack should re-establish the state after an
ISH panic rather than rebooting the AP.

[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html#use-trimmed-interleaved-replies-in-email-discussions

>
> On Wed, Oct 14, 2026 at 12:17 AM Tzung-Bi Shih <tzungbi@xxxxxxxxxx> wrote:
>
> > On Thu, Oct 08, 2026 at 10:22:08AM -0700, Scott Collyer wrote:
> > > When an attached EC or ISH device reports an EC_HOST_EVENT_PANIC host
> > > event, the EC/ISH subsystem has encountered a fatal exception.
> > >
> > > Handle the EC_HOST_EVENT_PANIC event by:
> > > 1. Logging an emergency message (dev_emerg) with the device name.
> > > 2. Calling the panic notifier chain (panic_notifier).
> > > 3. Emitting a uevent (ERROR=PANIC) to userspace.
> > > 4. Triggering kernel_restart("CrOS EC Panic") to cleanly restart the AP
> > > so that panic logs are preserved and collected by crash reporting
> > > services across reboot.
> >
> > If the EC crashed, wouldn't the AP be reset anyway?
> >