// SPDX-License-Identifier: GPL-2.0-or-later /* * IBM ASM Service Processor Device Driver * * Copyright (C) IBM Corporation, 2004 * * Author: Max Asböck <[email protected]> */ #include <linux/notifier.h> #include <linux/panic_notifier.h> #include "ibmasm.h" #include "dot_command.h" #include "lowlevel.h" static int suspend_heartbeats = …; /* * Once the driver indicates to the service processor that it is running * - see send_os_state() - the service processor sends periodic heartbeats * to the driver. The driver must respond to the heartbeats or else the OS * will be rebooted. * In the case of a panic the interrupt handler continues to work and thus * continues to respond to heartbeats, making the service processor believe * the OS is still running and thus preventing a reboot. * To prevent this from happening a callback is added the panic_notifier_list. * Before responding to a heartbeat the driver checks if a panic has happened, * if yes it suspends heartbeat, causing the service processor to reboot as * expected. */ static int panic_happened(struct notifier_block *n, unsigned long val, void *v) { … } static struct notifier_block panic_notifier = …; void ibmasm_register_panic_notifier(void) { … } void ibmasm_unregister_panic_notifier(void) { … } int ibmasm_heartbeat_init(struct service_processor *sp) { … } void ibmasm_heartbeat_exit(struct service_processor *sp) { … } void ibmasm_receive_heartbeat(struct service_processor *sp, void *message, size_t size) { … }