Lines Matching refs:dn
324 static int dlpar_offline_cpu(struct device_node *dn) in dlpar_offline_cpu() argument
332 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len); in dlpar_offline_cpu()
356 pr_warn("Unable to remove last online CPU %pOFn\n", dn); in dlpar_offline_cpu()
380 static int dlpar_online_cpu(struct device_node *dn) in dlpar_online_cpu() argument
388 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len); in dlpar_online_cpu()
404 dlpar_offline_cpu(dn); in dlpar_online_cpu()
519 static int pseries_cpuhp_attach_nodes(struct device_node *dn) in pseries_cpuhp_attach_nodes() argument
528 for (of_changeset_init(&cs); dn != NULL; dn = dn->sibling) { in pseries_cpuhp_attach_nodes()
529 ret = of_changeset_attach_node(&cs, dn); in pseries_cpuhp_attach_nodes()
542 struct device_node *dn, *parent; in dlpar_cpu_add() local
573 dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent); in dlpar_cpu_add()
574 if (!dn) { in dlpar_cpu_add()
582 rc = pseries_cpuhp_attach_nodes(dn); in dlpar_cpu_add()
590 dn, rc, drc_index); in dlpar_cpu_add()
594 dlpar_free_cc_nodes(dn); in dlpar_cpu_add()
599 update_numa_distance(dn); in dlpar_cpu_add()
601 rc = dlpar_online_cpu(dn); in dlpar_cpu_add()
605 dn, rc, drc_index); in dlpar_cpu_add()
607 rc = dlpar_detach_node(dn); in dlpar_cpu_add()
614 pr_debug("Successfully added CPU %pOFn, drc index: %x\n", dn, in dlpar_cpu_add()
622 struct device_node *dn, *tn; in pseries_cpuhp_cache_use_count() local
626 for_each_of_cpu_node(dn) { in pseries_cpuhp_cache_use_count()
627 tn = of_find_next_cache_node(dn); in pseries_cpuhp_cache_use_count()
633 for_each_node_by_type(dn, "cache") { in pseries_cpuhp_cache_use_count()
634 tn = of_find_next_cache_node(dn); in pseries_cpuhp_cache_use_count()
645 struct device_node *dn; in pseries_cpuhp_detach_nodes() local
654 dn = cpudn; in pseries_cpuhp_detach_nodes()
655 while ((dn = of_find_next_cache_node(dn))) { in pseries_cpuhp_detach_nodes()
656 if (pseries_cpuhp_cache_use_count(dn) > 1) { in pseries_cpuhp_detach_nodes()
657 of_node_put(dn); in pseries_cpuhp_detach_nodes()
661 ret = of_changeset_detach_node(&cs, dn); in pseries_cpuhp_detach_nodes()
662 of_node_put(dn); in pseries_cpuhp_detach_nodes()
673 static ssize_t dlpar_cpu_remove(struct device_node *dn, u32 drc_index) in dlpar_cpu_remove() argument
678 dn, drc_index); in dlpar_cpu_remove()
680 rc = dlpar_offline_cpu(dn); in dlpar_cpu_remove()
682 pr_warn("Failed to offline CPU %pOFn, rc: %d\n", dn, rc); in dlpar_cpu_remove()
689 drc_index, dn, rc); in dlpar_cpu_remove()
690 dlpar_online_cpu(dn); in dlpar_cpu_remove()
694 rc = pseries_cpuhp_detach_nodes(dn); in dlpar_cpu_remove()
698 pr_warn("Failed to detach CPU %pOFn, rc: %d", dn, rc); in dlpar_cpu_remove()
702 dlpar_online_cpu(dn); in dlpar_cpu_remove()
713 struct device_node *dn; in cpu_drc_index_to_dn() local
717 for_each_node_by_type(dn, "cpu") { in cpu_drc_index_to_dn()
718 rc = of_property_read_u32(dn, "ibm,my-drc-index", &my_index); in cpu_drc_index_to_dn()
726 return dn; in cpu_drc_index_to_dn()
731 struct device_node *dn; in dlpar_cpu_remove_by_index() local
734 dn = cpu_drc_index_to_dn(drc_index); in dlpar_cpu_remove_by_index()
735 if (!dn) { in dlpar_cpu_remove_by_index()
741 rc = dlpar_cpu_remove(dn, drc_index); in dlpar_cpu_remove_by_index()
742 of_node_put(dn); in dlpar_cpu_remove_by_index()
804 struct device_node *dn; in dlpar_cpu_release() local
808 dn = of_find_node_by_path(buf); in dlpar_cpu_release()
809 if (!dn) in dlpar_cpu_release()
812 rc = of_property_read_u32(dn, "ibm,my-drc-index", &drc_index); in dlpar_cpu_release()
814 of_node_put(dn); in dlpar_cpu_release()
818 rc = dlpar_cpu_remove(dn, drc_index); in dlpar_cpu_release()
819 of_node_put(dn); in dlpar_cpu_release()
834 err = pseries_add_processor(rd->dn); in pseries_smp_notifier()
837 pseries_remove_processor(rd->dn); in pseries_smp_notifier()