Lines Matching +full:always +full:- +full:running
1 // SPDX-License-Identifier: GPL-2.0-only
18 return sprintf(buf, "%s", rproc->recovery_disabled ? "disabled\n" : "enabled\n"); in recovery_show()
53 rproc->recovery_disabled = false; in recovery_store()
56 rproc->recovery_disabled = true; in recovery_store()
61 return -EINVAL; in recovery_store()
69 * A coredump-configuration-to-string lookup table, for exposing a
70 * human readable configuration via sysfs. Always keep in sync with
85 return sprintf(buf, "%s\n", rproc_coredump_str[rproc->dump_conf]); in coredump_show()
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()
130 /* Expose the loaded / running firmware name via sysfs */
135 const char *firmware = rproc->firmware; in firmware_show()
139 * entity we have no idea of what image it is running. As such in firmware_show()
140 * simply display a generic string rather then rproc->firmware. in firmware_show()
143 * may have been attached to and currently in a running state. in firmware_show()
145 if (rproc->autonomous) in firmware_show()
160 err = mutex_lock_interruptible(&rproc->lock); in firmware_store()
162 dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, err); in firmware_store()
163 return -EINVAL; in firmware_store()
166 if (rproc->state != RPROC_OFFLINE) { in firmware_store()
167 dev_err(dev, "can't change firmware while running\n"); in firmware_store()
168 err = -EBUSY; in firmware_store()
175 err = -EINVAL; in firmware_store()
181 err = -ENOMEM; in firmware_store()
185 kfree(rproc->firmware); in firmware_store()
186 rproc->firmware = p; in firmware_store()
188 mutex_unlock(&rproc->lock); in firmware_store()
195 * A state-to-string lookup table, for exposing a human readable state
196 * via sysfs. Always keep in sync with enum rproc_state
201 [RPROC_RUNNING] = "running",
215 state = rproc->state > RPROC_LAST ? RPROC_LAST : rproc->state; in state_show()
228 if (rproc->state == RPROC_RUNNING) in state_store()
229 return -EBUSY; in state_store()
233 dev_err(&rproc->dev, "Boot failed: %d\n", ret); in state_store()
235 if (rproc->state != RPROC_RUNNING) in state_store()
236 return -EINVAL; in state_store()
240 dev_err(&rproc->dev, "Unrecognised option: %s\n", buf); in state_store()
241 ret = -EINVAL; in state_store()
253 return sprintf(buf, "%s\n", rproc->name); in name_show()