<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/reboot.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-03-17T06:24:14+00:00</updated>
<entry>
<title>reboot: retire hw_protection_reboot and hw_protection_shutdown helpers</title>
<updated>2025-03-17T06:24:14+00:00</updated>
<author>
<name>Ahmad Fatoum</name>
<email>a.fatoum@pengutronix.de</email>
</author>
<published>2025-02-17T20:39:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5e40d0d196595874c3f0606f0642021e6ade8054'/>
<id>urn:sha1:5e40d0d196595874c3f0606f0642021e6ade8054</id>
<content type='text'>
The hw_protection_reboot and hw_protection_shutdown functions mix
mechanism with policy: They let the driver requesting an emergency action
for hardware protection also decide how to deal with it.

This is inadequate in the general case as a driver reporting e.g.  an
imminent power failure can't know whether a shutdown or a reboot would be
more appropriate for a given hardware platform.

With the addition of the hw_protection parameter, it's now possible to
configure at runtime the default emergency action and drivers are expected
to use hw_protection_trigger to have this parameter dictate policy.

As no current users of either hw_protection_shutdown or
hw_protection_shutdown helpers remain, remove them, as not to tempt driver
authors to call them.

Existing users now either defer to hw_protection_trigger or call
__hw_protection_trigger with a suitable argument directly when they have
inside knowledge on whether a reboot or shutdown would be more
appropriate.

Link: https://lkml.kernel.org/r/20250217-hw_protection-reboot-v3-12-e1c09b090c0c@pengutronix.de
Signed-off-by: Ahmad Fatoum &lt;a.fatoum@pengutronix.de&gt;
Reviewed-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Cc: Benson Leung &lt;bleung@chromium.org&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: Fabio Estevam &lt;festevam@denx.de&gt;
Cc: Guenter Roeck &lt;groeck@chromium.org&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Matteo Croce &lt;teknoraver@meta.com&gt;
Cc: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Cc: Rui Zhang &lt;rui.zhang@intel.com&gt;
Cc: Sascha Hauer &lt;kernel@pengutronix.de&gt;
Cc: "Serge E. Hallyn" &lt;serge@hallyn.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>reboot: add support for configuring emergency hardware protection action</title>
<updated>2025-03-17T06:24:14+00:00</updated>
<author>
<name>Ahmad Fatoum</name>
<email>a.fatoum@pengutronix.de</email>
</author>
<published>2025-02-17T20:39:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e016173f656b89f5f71b7d45dfc599ada8107eef'/>
<id>urn:sha1:e016173f656b89f5f71b7d45dfc599ada8107eef</id>
<content type='text'>
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.

[arnd@arndb.de: hide unused hw_protection_attr]
  Link: https://lkml.kernel.org/r/20250224141849.1546019-1-arnd@kernel.org
Link: https://lkml.kernel.org/r/20250217-hw_protection-reboot-v3-7-e1c09b090c0c@pengutronix.de
Signed-off-by: Ahmad Fatoum &lt;a.fatoum@pengutronix.de&gt;
Reviewed-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Cc: Benson Leung &lt;bleung@chromium.org&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: Fabio Estevam &lt;festevam@denx.de&gt;
Cc: Guenter Roeck &lt;groeck@chromium.org&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Matteo Croce &lt;teknoraver@meta.com&gt;
Cc: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Cc: Rui Zhang &lt;rui.zhang@intel.com&gt;
Cc: Sascha Hauer &lt;kernel@pengutronix.de&gt;
Cc: "Serge E. Hallyn" &lt;serge@hallyn.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>reboot: rename now misleading __hw_protection_shutdown symbols</title>
<updated>2025-03-17T06:24:13+00:00</updated>
<author>
<name>Ahmad Fatoum</name>
<email>a.fatoum@pengutronix.de</email>
</author>
<published>2025-02-17T20:39:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=81cab0f94ab864f13e29e561382d722daec6a55a'/>
<id>urn:sha1:81cab0f94ab864f13e29e561382d722daec6a55a</id>
<content type='text'>
The __hw_protection_shutdown function name has become misleading since it
can cause either a shutdown (poweroff) or a reboot depending on its
argument.

To avoid further confusion, let's rename it, so it doesn't suggest that a
poweroff is all it can do.

Link: https://lkml.kernel.org/r/20250217-hw_protection-reboot-v3-5-e1c09b090c0c@pengutronix.de
Signed-off-by: Ahmad Fatoum &lt;a.fatoum@pengutronix.de&gt;
Reviewed-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Cc: Benson Leung &lt;bleung@chromium.org&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: Fabio Estevam &lt;festevam@denx.de&gt;
Cc: Guenter Roeck &lt;groeck@chromium.org&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Matteo Croce &lt;teknoraver@meta.com&gt;
Cc: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Cc: Rui Zhang &lt;rui.zhang@intel.com&gt;
Cc: Sascha Hauer &lt;kernel@pengutronix.de&gt;
Cc: "Serge E. Hallyn" &lt;serge@hallyn.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>reboot: replace __hw_protection_shutdown bool action parameter with an enum</title>
<updated>2025-03-17T06:24:13+00:00</updated>
<author>
<name>Ahmad Fatoum</name>
<email>a.fatoum@pengutronix.de</email>
</author>
<published>2025-02-17T20:39:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=318f05a057157c400a92f17c5f2fa3dd96f57c7e'/>
<id>urn:sha1:318f05a057157c400a92f17c5f2fa3dd96f57c7e</id>
<content type='text'>
Patch series "reboot: support runtime configuration of emergency
hw_protection action", v3.

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.

This is inadequate in the general case though as a driver reporting e.g. 
an imminent power failure can't know whether a shutdown or a reboot would
be more appropriate for a given hardware platform.

To address this, this series adds a hw_protection kernel parameter and
sysfs toggle that can be used to change the action from the shutdown
default to reboot.  A new hw_protection_trigger API then makes use of this
default action.

My particular use case is unattended embedded systems that don't have
support for shutdown and that power on automatically when power is
supplied:

  - A brief power cycle gets detected by the driver
  - The kernel powers down the system and SoC goes into shutdown mode
  - Power is restored
  - The system remains oblivious to the restored power
  - System needs to be manually power cycled for a duration long enough
    to drain the capacitors

With this series, such systems can configure the kernel with
hw_protection=reboot to have the boot firmware worry about critical
conditions.


This patch (of 12):

Currently __hw_protection_shutdown() either reboots or shuts down the
system according to its shutdown argument.

To make the logic easier to follow, both inside __hw_protection_shutdown
and at caller sites, lets replace the bool parameter with an enum.

This will be extra useful, when in a later commit, a third action is added
to the enumeration.

No functional change.

Link: https://lkml.kernel.org/r/20250217-hw_protection-reboot-v3-0-e1c09b090c0c@pengutronix.de
Link: https://lkml.kernel.org/r/20250217-hw_protection-reboot-v3-1-e1c09b090c0c@pengutronix.de
Signed-off-by: Ahmad Fatoum &lt;a.fatoum@pengutronix.de&gt;
Reviewed-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Cc: Benson Leung &lt;bleung@chromium.org&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: Fabio Estevam &lt;festevam@denx.de&gt;
Cc: Guenter Roeck &lt;groeck@chromium.org&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Cc: Matteo Croce &lt;teknoraver@meta.com&gt;
Cc: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Rui Zhang &lt;rui.zhang@intel.com&gt;
Cc: Sascha Hauer &lt;kernel@pengutronix.de&gt;
Cc: "Serge E. Hallyn" &lt;serge@hallyn.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>reboot: Introduce thermal_zone_device_critical_reboot()</title>
<updated>2024-01-02T08:33:18+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>festevam@denx.de</email>
</author>
<published>2023-11-29T12:43:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=79fa723ba84c2b1b3124c72df8a3b07b851a5477'/>
<id>urn:sha1:79fa723ba84c2b1b3124c72df8a3b07b851a5477</id>
<content type='text'>
Introduce thermal_zone_device_critical_reboot() to trigger an
emergency reboot.

It is a counterpart of thermal_zone_device_critical() with the
difference that it will force a reboot instead of shutdown.

The motivation for doing this is to allow the thermal subystem
to trigger a reboot when the temperature reaches the critical
temperature.

Signed-off-by: Fabio Estevam &lt;festevam@denx.de&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20231129124330.519423-3-festevam@gmail.com
</content>
</entry>
<entry>
<title>thermal/core: Prepare for introduction of thermal reboot</title>
<updated>2024-01-02T08:33:18+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>festevam@denx.de</email>
</author>
<published>2023-11-29T12:43:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5a0e241003b80247de59727c945bc94c848f893d'/>
<id>urn:sha1:5a0e241003b80247de59727c945bc94c848f893d</id>
<content type='text'>
Add some helper functions to make it easier introducing the support
for thermal reboot.

No functional change.

Signed-off-by: Fabio Estevam &lt;festevam@denx.de&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20231129124330.519423-2-festevam@gmail.com
</content>
</entry>
<entry>
<title>kernel/reboot: Add device to sys_off_handler</title>
<updated>2023-07-28T10:33:09+00:00</updated>
<author>
<name>Benjamin Bara</name>
<email>benjamin.bara@skidata.com</email>
</author>
<published>2023-07-15T07:53:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=db2d6038c5e795cab4f0a8d3e86b4f7e33338629'/>
<id>urn:sha1:db2d6038c5e795cab4f0a8d3e86b4f7e33338629</id>
<content type='text'>
If the dev is known (e.g. a devm-based sys_off_handler is used), it can
be passed to the handler's callback to have it available there.
Otherwise, cb_data might be set to the dev in most of the cases.

Reviewed-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Signed-off-by: Benjamin Bara &lt;benjamin.bara@skidata.com&gt;
Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-3-18699d5dcd76@skidata.com
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
</content>
</entry>
<entry>
<title>kernel/reboot: Add SYS_OFF_MODE_RESTART_PREPARE mode</title>
<updated>2022-10-04T13:59:36+00:00</updated>
<author>
<name>Kai-Heng Feng</name>
<email>kai.heng.feng@canonical.com</email>
</author>
<published>2022-09-29T07:05:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e7fd8b68404f3d8bc03f85bc3c078d67096be06f'/>
<id>urn:sha1:e7fd8b68404f3d8bc03f85bc3c078d67096be06f</id>
<content type='text'>
Add SYS_OFF_MODE_RESTART_PREPARE callbacks to be invoked before
a system restart.

Suggested-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Reviewed-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pm-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2022-05-30T18:37:26+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-05-30T18:37:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ff7bc3ba71d398d349c49103a3da34bb4ea02d1'/>
<id>urn:sha1:1ff7bc3ba71d398d349c49103a3da34bb4ea02d1</id>
<content type='text'>
Pull more power management updates from Rafael Wysocki:
 "These update the ARM cpufreq drivers and fix up the CPPC cpufreq
  driver after recent changes, update the OPP code and PM documentation
  and add power sequences support to the system reboot and power off
  code.

  Specifics:

   - Add Tegra234 cpufreq support (Sumit Gupta)

   - Clean up and enhance the Mediatek cpufreq driver (Wan Jiabing,
     Rex-BC Chen, and Jia-Wei Chang)

   - Fix up the CPPC cpufreq driver after recent changes (Zheng Bin,
     Pierre Gondois)

   - Minor update to dt-binding for Qcom's opp-v2-kryo-cpu (Yassine
     Oudjana)

   - Use list iterator only inside the list_for_each_entry loop
     (Xiaomeng Tong, and Jakob Koschel)

   - New APIs related to finding OPP based on interconnect bandwidth
     (Krzysztof Kozlowski)

   - Fix the missing of_node_put() in _bandwidth_supported() (Dan
     Carpenter)

   - Cleanups (Krzysztof Kozlowski, and Viresh Kumar)

   - Add Out of Band mode description to the intel-speed-select utility
     documentation (Srinivas Pandruvada)

   - Add power sequences support to the system reboot and power off code
     and make related platform-specific changes for multiple platforms
     (Dmitry Osipenko, Geert Uytterhoeven)"

* tag 'pm-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (60 commits)
  cpufreq: CPPC: Fix unused-function warning
  cpufreq: CPPC: Fix build error without CONFIG_ACPI_CPPC_CPUFREQ_FIE
  Documentation: admin-guide: PM: Add Out of Band mode
  kernel/reboot: Change registration order of legacy power-off handler
  m68k: virt: Switch to new sys-off handler API
  kernel/reboot: Add devm_register_restart_handler()
  kernel/reboot: Add devm_register_power_off_handler()
  soc/tegra: pmc: Use sys-off handler API to power off Nexus 7 properly
  reboot: Remove pm_power_off_prepare()
  regulator: pfuze100: Use devm_register_sys_off_handler()
  ACPI: power: Switch to sys-off handler API
  memory: emif: Use kernel_can_power_off()
  mips: Use do_kernel_power_off()
  ia64: Use do_kernel_power_off()
  x86: Use do_kernel_power_off()
  sh: Use do_kernel_power_off()
  m68k: Switch to new sys-off handler API
  powerpc: Use do_kernel_power_off()
  xen/x86: Use do_kernel_power_off()
  parisc: Use do_kernel_power_off()
  ...
</content>
</entry>
<entry>
<title>kernel/reboot: Add devm_register_restart_handler()</title>
<updated>2022-05-19T17:30:31+00:00</updated>
<author>
<name>Dmitry Osipenko</name>
<email>dmitry.osipenko@collabora.com</email>
</author>
<published>2022-05-09T23:32:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6779db970bd287bb35b28bd5dc256fd7aef19d1c'/>
<id>urn:sha1:6779db970bd287bb35b28bd5dc256fd7aef19d1c</id>
<content type='text'>
Add devm_register_restart_handler() helper that registers sys-off
handler using restart mode and with a default priority. Most drivers
will want to register restart handler with a default priority, so this
helper will reduce the boilerplate code and make code easier to read and
follow.

Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
