Lines Matching +full:mode +full:- +full:recovery
1 // SPDX-License-Identifier: GPL-2.0-only
18 return sysfs_emit(buf, "%s", rproc->recovery_disabled ? "disabled\n" : "enabled\n"); in recovery_show()
22 * By writing to the 'recovery' sysfs entry, we control the behavior of the
23 * recovery mechanism dynamically. The default value of this entry is "enabled".
25 * The 'recovery' sysfs entry supports these commands:
29 * processor crashes while recovery is disabled, it will
30 * be automatically recovered too as soon as recovery is enabled.
36 * recover: This function will trigger an immediate recovery if the
38 * or checking the recovery state (enabled/disabled).
40 * additional crashes to happen after enabling recovery. In this
41 * case, enabling recovery will make it hard to debug subsequent
42 * crashes, so it's recommended to keep recovery disabled, and
52 /* change the flag and begin the recovery process if needed */ in recovery_store()
53 rproc->recovery_disabled = false; in recovery_store()
56 rproc->recovery_disabled = true; in recovery_store()
58 /* begin the recovery process without changing the flag */ in recovery_store()
61 return -EINVAL; in recovery_store()
66 static DEVICE_ATTR_RW(recovery);
69 * A coredump-configuration-to-string lookup table, for exposing a
85 return sysfs_emit(buf, "%s\n", rproc_coredump_str[rproc->dump_conf]); in coredump_show()
94 * disabled: This is the default coredump mechanism. Recovery will proceed
101 * recovery process will have to wait until data is read by
110 if (rproc->state == RPROC_CRASHED) { in coredump_store()
111 dev_err(&rproc->dev, "can't change coredump configuration\n"); in coredump_store()
112 return -EBUSY; in coredump_store()
116 rproc->dump_conf = RPROC_COREDUMP_DISABLED; in coredump_store()
118 rproc->dump_conf = RPROC_COREDUMP_ENABLED; in coredump_store()
120 rproc->dump_conf = RPROC_COREDUMP_INLINE; in coredump_store()
122 dev_err(&rproc->dev, "Invalid coredump configuration\n"); in coredump_store()
123 return -EINVAL; in coredump_store()
135 const char *firmware = rproc->firmware; in firmware_show()
140 * simply display a generic string rather then rproc->firmware. in firmware_show()
142 if (rproc->state == RPROC_ATTACHED) in firmware_show()
163 * A state-to-string lookup table, for exposing a human readable state
184 state = rproc->state > RPROC_LAST ? RPROC_LAST : rproc->state; in state_show()
199 dev_err(&rproc->dev, "Boot failed: %d\n", ret); in state_store()
205 dev_err(&rproc->dev, "Unrecognised option: %s\n", buf); in state_store()
206 ret = -EINVAL; in state_store()
218 return sprintf(buf, "%s\n", rproc->name); in name_show()
227 umode_t mode = attr->mode; in rproc_is_visible() local
229 if (rproc->sysfs_read_only && (attr == &dev_attr_recovery.attr || in rproc_is_visible()
233 mode = 0444; in rproc_is_visible()
235 return mode; in rproc_is_visible()