On Mon, Jan 13, 2025 at 05:25:32PM +0100, Ahmad Fatoum wrote: > We currently leave the decision of whether to shutdown or reboot to > protect hardware in an emergency situation to the individual drivers. > > This works out in some cases, where the driver detecting the critical > failure has inside knowledge: It binds to the system management controller > for example or is guided by hardware description that defines what to do. > > In the general case, however, the driver detecting the issue can't know > what the appropriate course of action is and shouldn't be dictating the > policy of dealing with it. > > Therefore, add a global hw_protection toggle that allows the user to > specify whether shutdown or reboot should be the default action when the > driver doesn't set policy. > > This introduces no functional change yet as hw_protection_trigger() has > no callers, but these will be added in subsequent commits. > > Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> With a minor comment, Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx> > diff --git a/Documentation/ABI/testing/sysfs-kernel-reboot b/Documentation/ABI/testing/sysfs-kernel-reboot > index 837330fb251134ffdf29cd68f0b2a845b088e5a0..133f54707d533665c68a5946394540ec50b149e5 100644 > --- a/Documentation/ABI/testing/sysfs-kernel-reboot > +++ b/Documentation/ABI/testing/sysfs-kernel-reboot > @@ -30,3 +30,11 @@ KernelVersion: 5.11 > Contact: Matteo Croce <mcroce@xxxxxxxxxxxxx> > Description: Don't wait for any other CPUs on reboot and > avoid anything that could hang. > + > +What: /sys/kernel/reboot/hw_protection > +Date: Feb 2025 > +KernelVersion: 6.14 The info might need to be adjusted if the series would be for 6.15.