Lines Matching defs:scfcp
153 static void scf_add_to_free_list(struct scf_check *scfcp)
158 if (!scfcp)
162 llist_add(&scfcp->scf_node, pool);
169 struct scf_check *scfcp;
174 scfcp = llist_entry(node, struct scf_check, scf_node);
176 kfree(scfcp);
292 struct scf_check *scfcp = scfc_in;
294 if (likely(scfcp)) {
295 WRITE_ONCE(scfcp->scfc_out, false); // For multiple receivers.
296 if (WARN_ON_ONCE(unlikely(!READ_ONCE(scfcp->scfc_in))))
321 if (unlikely(!scfcp))
323 if (scfcp->scfc_wait) {
324 WRITE_ONCE(scfcp->scfc_out, true);
325 if (scfcp->scfc_rpc)
326 complete(&scfcp->scfc_completion);
328 scf_add_to_free_list(scfcp);
335 struct scf_check *scfcp = scfc_in;
337 if (likely(scfcp) && WARN_ONCE(smp_processor_id() != scfcp->scfc_cpu, "%s: Wanted CPU %d got CPU %d\n", __func__, scfcp->scfc_cpu, smp_processor_id())) {
340 scf_handler(scfcp);
349 struct scf_check *scfcp = NULL;
353 scfcp = kmalloc(sizeof(*scfcp), GFP_ATOMIC);
354 if (!scfcp) {
359 scfcp->scfc_cpu = -1;
360 scfcp->scfc_wait = scfsp->scfs_wait;
361 scfcp->scfc_out = false;
362 scfcp->scfc_rpc = false;
384 if (scfcp) {
385 scfcp->scfc_cpu = cpu;
387 scfcp->scfc_in = true;
389 ret = smp_call_function_single(cpu, scf_handler_1, (void *)scfcp, scfsp->scfs_wait);
395 scf_add_to_free_list(scfcp);
396 scfcp = NULL;
400 if (!scfcp)
404 scfcp->scfc_cpu = cpu;
405 scfcp->scfc_wait = true;
406 init_completion(&scfcp->scfc_completion);
407 scfcp->scfc_rpc = true;
409 scfcp->scfc_in = true;
410 ret = smp_call_function_single(cpu, scf_handler_1, (void *)scfcp, 0);
416 wait_for_completion(&scfcp->scfc_completion);
423 scf_add_to_free_list(scfcp);
424 scfcp = NULL;
432 if (scfcp) {
434 scfcp->scfc_in = true;
436 smp_call_function_many(cpu_online_mask, scf_handler, scfcp, scfsp->scfs_wait);
443 if (scfcp) {
445 scfcp->scfc_in = true;
447 smp_call_function(scf_handler, scfcp, scfsp->scfs_wait);
451 if (scfcp)
452 scfcp->scfc_out = true;
454 if (scfcp && scfsp->scfs_wait) {
456 !scfcp->scfc_out)) {
460 scf_add_to_free_list(scfcp);