Lines Matching full:fn
102 * @fn: function to execute
103 * @arg: argument to @fn
105 * Execute @fn(@arg) on @cpu. @fn is run in a process context with
110 * This function doesn't guarantee @cpu stays online till @fn
112 * partially or fully on different cpus. @fn should either be ready
120 * -ENOENT if @fn(@arg) was not executed because @cpu was offline;
121 * otherwise, the return value of @fn.
123 int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg) in stop_one_cpu() argument
126 struct cpu_stop_work work = { .fn = fn, .arg = arg, .done = &done }; in stop_one_cpu()
155 cpu_stop_fn_t fn; member
224 err = msdata->fn(msdata->data); in multi_cpu_stop()
311 * @fn: function to execute
312 * @arg: argument to @fn
314 * Stops both the current and specified CPU and runs @fn on one of them.
318 int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg) in stop_two_cpus() argument
325 .fn = fn, in stop_two_cpus()
332 .fn = multi_cpu_stop, in stop_two_cpus()
352 * @fn: function to execute
353 * @arg: argument to @fn
358 * and will remain untouched until stopper starts executing @fn.
364 * true if cpu_stop_work was queued successfully and @fn will be called,
367 bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg, in stop_one_cpu_nowait() argument
370 *work_buf = (struct cpu_stop_work){ .fn = fn, .arg = arg, }; in stop_one_cpu_nowait()
375 cpu_stop_fn_t fn, void *arg, in queue_stop_cpus_work() argument
385 * to enter @fn which can lead to deadlock. in queue_stop_cpus_work()
392 work->fn = fn; in queue_stop_cpus_work()
406 cpu_stop_fn_t fn, void *arg) in __stop_cpus() argument
411 if (!queue_stop_cpus_work(cpumask, fn, arg, &done)) in __stop_cpus()
420 * @fn: function to execute
421 * @arg: argument to @fn
423 * Execute @fn(@arg) on online cpus in @cpumask. On each target cpu,
424 * @fn is run in a process context with the highest priority
429 * till @fn completes. If some cpus go down in the middle, execution
430 * on the cpu may happen partially or fully on different cpus. @fn
434 * All stop_cpus() calls are serialized making it safe for @fn to wait
441 * -ENOENT if @fn(@arg) was not executed at all because all cpus in
442 * @cpumask were offline; otherwise, 0 if all executions of @fn
445 static int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg) in stop_cpus() argument
451 ret = __stop_cpus(cpumask, fn, arg); in stop_cpus()
484 cpu_stop_fn_t fn = work->fn; in cpu_stopper_thread() local
491 ret = fn(arg); in cpu_stopper_thread()
499 "cpu_stop: %ps(%p) leaked preempt count\n", fn, arg); in cpu_stopper_thread()
566 int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data, in stop_machine_cpuslocked() argument
570 .fn = fn, in stop_machine_cpuslocked()
591 ret = (*fn)(data); in stop_machine_cpuslocked()
602 int stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus) in stop_machine() argument
608 ret = stop_machine_cpuslocked(fn, data, cpus); in stop_machine()
616 * @fn: the function to run
617 * @data: the data ptr for the @fn()
618 * @cpus: the cpus to run the @fn() on (NULL = any online cpu)
626 * using busy-wait for synchronization and executing @fn directly for local
633 * 0 if all executions of @fn returned 0, any non zero return value if any
636 int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, in stop_machine_from_inactive_cpu() argument
639 struct multi_stop_data msdata = { .fn = fn, .data = data, in stop_machine_from_inactive_cpu()