Lines Matching +full:used +full:- +full:by +full:- +full:rtas

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * arch/powerpc/kernel/rtas.c, and arch/powerpc/platforms/pseries/smp.c
17 #define pr_fmt(fmt) "pseries-hotplug-cpu: " fmt
28 #include <asm/rtas.h>
44 * Record the CPU ids used on each nodes.
45 * Protected by cpu_add_remove_lock.
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
115 * OTOH, pseries_cpu_offline_self() is called by the @cpu when it wants to
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()
231 * Fetch from the DT nodes read by dlpar_configure_connector() the NUMA in pseries_add_processor()
264 /* Record the newly used CPU ids for the associate node. */ 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()
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()
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()
511 * the number of entries in the array followed by the array in valid_cpu_drc_index()
518 rc = of_property_read_u32_index(parent, "ibm,drc-indexes", 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()
562 return -ENODEV; in dlpar_cpu_add()
568 return -EINVAL; in dlpar_cpu_add()
574 return -EINVAL; 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()
695 return -EINVAL; in dlpar_cpu_remove()
730 rc = of_property_read_u32(dn, "ibm,my-drc-index", &my_index); in cpu_drc_index_to_dn()
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()
868 printk(KERN_INFO "CPU Hotplug not supported by firmware " in pseries_cpu_hotplug_init()
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()