Lines Matching +full:my +full:- +full:drc +full:- +full:index

1 // SPDX-License-Identifier: GPL-2.0-or-later
17 #define pr_fmt(fmt) "pseries-hotplug-cpu: " fmt
88 systemcfg->processorCount--; in pseries_cpu_disable()
111 * the cpu-offline. Here we wait for long enough to allow the cpu in question
112 * to self-destroy so that the cpu-offline thread can send the CPU_DEAD
116 * self-destruct.
144 paca_ptrs[cpu]->cpu_start = 0; in pseries_cpu_die()
148 * find_cpu_id_range - found a linear ranger of @nthreads free CPU ids.
161 int rc = -ENOSPC; in find_cpu_id_range()
164 return -ENOMEM; in find_cpu_id_range()
221 intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len); in pseries_add_processor()
228 return -ENOMEM; in pseries_add_processor()
274 pr_warn("Reusing free CPU ids %d-%d from another node\n", in pseries_add_processor()
275 cpu, cpu + nthreads - 1); in pseries_add_processor()
293 * the hard id in the paca(s) to -1 to be consistent with boot time
294 * convention for non-present cpus.
303 intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len); in pseries_remove_processor()
317 set_hard_smp_processor_id(cpu, -1); in pseries_remove_processor()
318 update_numa_cpu_lookup_table(cpu, -1); in pseries_remove_processor()
336 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len); in dlpar_offline_cpu()
338 return -EINVAL; in dlpar_offline_cpu()
353 * device_offline() will return -EBUSY (via cpu_down()) if there in dlpar_offline_cpu()
361 rc = -EBUSY; in dlpar_offline_cpu()
392 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len); in dlpar_online_cpu()
394 return -EINVAL; in dlpar_online_cpu()
445 rc = of_property_read_u32(child, "ibm,my-drc-index", in dlpar_cpu_exists()
463 struct of_drc_info drc; in drc_info_valid_index() local
465 u32 index; in drc_info_valid_index() local
468 info = of_find_property(parent, "ibm,drc-info", NULL); in drc_info_valid_index()
474 /* First value of ibm,drc-info is number of drc-info records */ in drc_info_valid_index()
481 if (of_read_drc_info_cell(&info, &value, &drc)) in drc_info_valid_index()
484 if (strncmp(drc.drc_type, "CPU", 3)) in drc_info_valid_index()
487 if (drc_index > drc.last_drc_index) in drc_info_valid_index()
490 index = drc.drc_index_start; in drc_info_valid_index()
491 for (j = 0; j < drc.num_sequential_elems; j++) { in drc_info_valid_index()
492 if (drc_index == index) in drc_info_valid_index()
495 index += drc.sequential_inc; in drc_info_valid_index()
505 int rc, index; in valid_cpu_drc_index() local
507 if (of_property_present(parent, "ibm,drc-info")) in valid_cpu_drc_index()
510 /* Note that the format of the ibm,drc-indexes array is in valid_cpu_drc_index()
512 * of drc values so we start looking at index = 1. in valid_cpu_drc_index()
514 index = 1; in valid_cpu_drc_index()
516 u32 drc; in valid_cpu_drc_index() local
518 rc = of_property_read_u32_index(parent, "ibm,drc-indexes", in valid_cpu_drc_index()
519 index++, &drc); in valid_cpu_drc_index()
524 if (drc == drc_index) in valid_cpu_drc_index()
537 * This device node is unattached but may have siblings; open-code the in pseries_cpuhp_attach_nodes()
540 for (of_changeset_init(&cs); dn != NULL; dn = dn->sibling) { in pseries_cpuhp_attach_nodes()
557 pr_debug("Attempting to add CPU, drc index: %x\n", drc_index); in dlpar_cpu_add()
562 return -ENODEV; in dlpar_cpu_add()
567 pr_warn("CPU with drc index %x already exists\n", drc_index); in dlpar_cpu_add()
568 return -EINVAL; in dlpar_cpu_add()
573 pr_warn("Cannot find CPU (drc index %x) to add.\n", drc_index); in dlpar_cpu_add()
574 return -EINVAL; in dlpar_cpu_add()
579 pr_warn("Failed to acquire DRC, rc: %d, drc index: %x\n", in dlpar_cpu_add()
582 return -EINVAL; in dlpar_cpu_add()
587 pr_warn("Failed call to configure-connector, drc index: %x\n", in dlpar_cpu_add()
591 return -EINVAL; in dlpar_cpu_add()
601 pr_warn("Failed to attach node %pOFn, rc: %d, drc index: %x\n", in dlpar_cpu_add()
616 pr_warn("Failed to online cpu %pOFn, rc: %d, drc index: %x\n", in dlpar_cpu_add()
626 pr_debug("Successfully added CPU %pOFn, drc index: %x\n", dn, in dlpar_cpu_add()
689 pr_debug("Attempting to remove CPU %pOFn, drc index: %x\n", in dlpar_cpu_remove()
695 return -EINVAL; in dlpar_cpu_remove()
700 pr_warn("Failed to release drc (%x) for CPU %pOFn, rc: %d\n", in dlpar_cpu_remove()
719 pr_debug("Successfully removed CPU, drc index: %x\n", drc_index); in dlpar_cpu_remove()
730 rc = of_property_read_u32(dn, "ibm,my-drc-index", &my_index); in cpu_drc_index_to_dn()
748 pr_warn("Cannot find CPU (drc index %x) to remove\n", in dlpar_cpu_remove_by_index()
750 return -ENODEV; in dlpar_cpu_remove_by_index()
763 drc_index = be32_to_cpu(hp_elog->_drc_u.drc_index); in dlpar_cpu()
767 switch (hp_elog->action) { in dlpar_cpu()
769 if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_INDEX) { in dlpar_cpu()
773 * device to UNISOLATE is a no-op, but the hypervisor can in dlpar_cpu()
780 rc = -EINVAL; in dlpar_cpu()
783 if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_INDEX) in dlpar_cpu()
786 rc = -EINVAL; in dlpar_cpu()
789 pr_err("Invalid action (%d) specified\n", hp_elog->action); in dlpar_cpu()
790 rc = -EINVAL; in dlpar_cpu()
807 return -EINVAL; in dlpar_cpu_probe()
822 return -EINVAL; in dlpar_cpu_release()
824 rc = of_property_read_u32(dn, "ibm,my-drc-index", &drc_index); in dlpar_cpu_release()
827 return -EINVAL; in dlpar_cpu_release()
846 err = pseries_add_processor(rd->dn); in pseries_smp_notifier()
849 pseries_remove_processor(rd->dn); in pseries_smp_notifier()
869 "- disabling.\n"); in pseries_cpu_hotplug_init()
873 smp_ops->cpu_offline_self = pseries_cpu_offline_self; in pseries_cpu_hotplug_init()
874 smp_ops->cpu_disable = pseries_cpu_disable; in pseries_cpu_hotplug_init()
875 smp_ops->cpu_die = pseries_cpu_die; in pseries_cpu_hotplug_init()
892 return -ENOMEM; in pseries_dlpar_init()