2 * pseries Memory Hotplug infrastructure.
4 * Copyright (C) 2008 Badari Pulavarty, IBM Corporation
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #define pr_fmt(fmt) "pseries-hotplug-mem: " fmt
15 #include <linux/of_address.h>
16 #include <linux/memblock.h>
17 #include <linux/memory.h>
18 #include <linux/memory_hotplug.h>
19 #include <linux/slab.h>
21 #include <asm/firmware.h>
22 #include <asm/machdep.h>
24 #include <asm/sparsemem.h>
25 #include <asm/fadump.h>
26 #include <asm/drmem.h>
29 static bool rtas_hp_event;
31 unsigned long pseries_memory_block_size(void)
33 struct device_node *np;
34 u64 memblock_size = MIN_MEMORY_BLOCK_SIZE;
37 np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
41 size = of_get_property(np, "ibm,lmb-size", NULL);
43 memblock_size = be64_to_cpup(size);
45 } else if (machine_is(pseries)) {
46 /* This fallback really only applies to pseries */
47 unsigned int memzero_size = 0;
49 np = of_find_node_by_path("/memory@0");
51 if (!of_address_to_resource(np, 0, &r))
52 memzero_size = resource_size(&r);
57 /* We now know the size of memory@0, use this to find
58 * the first memoryblock and get its size.
62 sprintf(buf, "/memory@%x", memzero_size);
63 np = of_find_node_by_path(buf);
65 if (!of_address_to_resource(np, 0, &r))
66 memblock_size = resource_size(&r);
74 static void dlpar_free_property(struct property *prop)
81 static struct property *dlpar_clone_property(struct property *prop,
84 struct property *new_prop;
86 new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL);
90 new_prop->name = kstrdup(prop->name, GFP_KERNEL);
91 new_prop->value = kzalloc(prop_size, GFP_KERNEL);
92 if (!new_prop->name || !new_prop->value) {
93 dlpar_free_property(new_prop);
97 memcpy(new_prop->value, prop->value, prop->length);
98 new_prop->length = prop_size;
100 of_property_set_flag(new_prop, OF_DYNAMIC);
104 static bool find_aa_index(struct device_node *dr_node,
105 struct property *ala_prop,
106 const u32 *lmb_assoc, u32 *aa_index)
108 u32 *assoc_arrays, new_prop_size;
109 struct property *new_prop;
110 int aa_arrays, aa_array_entries, aa_array_sz;
114 * The ibm,associativity-lookup-arrays property is defined to be
115 * a 32-bit value specifying the number of associativity arrays
116 * followed by a 32-bitvalue specifying the number of entries per
117 * array, followed by the associativity arrays.
119 assoc_arrays = ala_prop->value;
121 aa_arrays = be32_to_cpu(assoc_arrays[0]);
122 aa_array_entries = be32_to_cpu(assoc_arrays[1]);
123 aa_array_sz = aa_array_entries * sizeof(u32);
125 for (i = 0; i < aa_arrays; i++) {
126 index = (i * aa_array_entries) + 2;
128 if (memcmp(&assoc_arrays[index], &lmb_assoc[1], aa_array_sz))
135 new_prop_size = ala_prop->length + aa_array_sz;
136 new_prop = dlpar_clone_property(ala_prop, new_prop_size);
140 assoc_arrays = new_prop->value;
142 /* increment the number of entries in the lookup array */
143 assoc_arrays[0] = cpu_to_be32(aa_arrays + 1);
145 /* copy the new associativity into the lookup array */
146 index = aa_arrays * aa_array_entries + 2;
147 memcpy(&assoc_arrays[index], &lmb_assoc[1], aa_array_sz);
149 of_update_property(dr_node, new_prop);
152 * The associativity lookup array index for this lmb is
153 * number of entries - 1 since we added its associativity
154 * to the end of the lookup array.
156 *aa_index = be32_to_cpu(assoc_arrays[0]) - 1;
160 static int update_lmb_associativity_index(struct drmem_lmb *lmb)
162 struct device_node *parent, *lmb_node, *dr_node;
163 struct property *ala_prop;
164 const u32 *lmb_assoc;
168 parent = of_find_node_by_path("/");
172 lmb_node = dlpar_configure_connector(cpu_to_be32(lmb->drc_index),
178 lmb_assoc = of_get_property(lmb_node, "ibm,associativity", NULL);
180 dlpar_free_cc_nodes(lmb_node);
184 dr_node = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
186 dlpar_free_cc_nodes(lmb_node);
190 ala_prop = of_find_property(dr_node, "ibm,associativity-lookup-arrays",
193 of_node_put(dr_node);
194 dlpar_free_cc_nodes(lmb_node);
198 found = find_aa_index(dr_node, ala_prop, lmb_assoc, &aa_index);
200 of_node_put(dr_node);
201 dlpar_free_cc_nodes(lmb_node);
204 pr_err("Could not find LMB associativity\n");
208 lmb->aa_index = aa_index;
212 static struct memory_block *lmb_to_memblock(struct drmem_lmb *lmb)
214 unsigned long section_nr;
215 struct mem_section *mem_sect;
216 struct memory_block *mem_block;
218 section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr));
219 mem_sect = __nr_to_section(section_nr);
221 mem_block = find_memory_block(mem_sect);
225 static int get_lmb_range(u32 drc_index, int n_lmbs,
226 struct drmem_lmb **start_lmb,
227 struct drmem_lmb **end_lmb)
229 struct drmem_lmb *lmb, *start, *end;
230 struct drmem_lmb *limit;
233 for_each_drmem_lmb(lmb) {
234 if (lmb->drc_index == drc_index) {
243 end = &start[n_lmbs];
245 limit = &drmem_info->lmbs[drmem_info->n_lmbs];
254 static int dlpar_change_lmb_state(struct drmem_lmb *lmb, bool online)
256 struct memory_block *mem_block;
259 mem_block = lmb_to_memblock(lmb);
263 if (online && mem_block->dev.offline)
264 rc = device_online(&mem_block->dev);
265 else if (!online && !mem_block->dev.offline)
266 rc = device_offline(&mem_block->dev);
270 put_device(&mem_block->dev);
275 static int dlpar_online_lmb(struct drmem_lmb *lmb)
277 return dlpar_change_lmb_state(lmb, true);
280 #ifdef CONFIG_MEMORY_HOTREMOVE
281 static int dlpar_offline_lmb(struct drmem_lmb *lmb)
283 return dlpar_change_lmb_state(lmb, false);
286 static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
288 unsigned long block_sz, start_pfn;
289 int sections_per_block;
292 start_pfn = base >> PAGE_SHIFT;
294 lock_device_hotplug();
296 if (!pfn_valid(start_pfn))
299 block_sz = pseries_memory_block_size();
300 sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
301 nid = memory_add_physaddr_to_nid(base);
303 for (i = 0; i < sections_per_block; i++) {
304 __remove_memory(nid, base, MIN_MEMORY_BLOCK_SIZE);
305 base += MIN_MEMORY_BLOCK_SIZE;
309 /* Update memory regions for memory remove */
310 memblock_remove(base, memblock_size);
311 unlock_device_hotplug();
315 static int pseries_remove_mem_node(struct device_node *np)
320 unsigned int lmb_size;
324 * Check to see if we are actually removing memory
326 type = of_get_property(np, "device_type", NULL);
327 if (type == NULL || strcmp(type, "memory") != 0)
331 * Find the base address and size of the memblock
333 regs = of_get_property(np, "reg", NULL);
337 base = be64_to_cpu(*(unsigned long *)regs);
338 lmb_size = be32_to_cpu(regs[3]);
340 pseries_remove_memblock(base, lmb_size);
344 static bool lmb_is_removable(struct drmem_lmb *lmb)
346 int i, scns_per_block;
348 unsigned long pfn, block_sz;
351 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
354 block_sz = memory_block_size_bytes();
355 scns_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
356 phys_addr = lmb->base_addr;
358 #ifdef CONFIG_FA_DUMP
360 * Don't hot-remove memory that falls in fadump boot memory area
361 * and memory that is reserved for capturing old kernel memory.
363 if (is_fadump_memory_area(phys_addr, block_sz))
367 for (i = 0; i < scns_per_block; i++) {
368 pfn = PFN_DOWN(phys_addr);
369 if (!pfn_present(pfn)) {
370 phys_addr += MIN_MEMORY_BLOCK_SIZE;
374 rc &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
375 phys_addr += MIN_MEMORY_BLOCK_SIZE;
378 return rc ? true : false;
381 static int dlpar_add_lmb(struct drmem_lmb *);
383 static int dlpar_remove_lmb(struct drmem_lmb *lmb)
385 unsigned long block_sz;
388 if (!lmb_is_removable(lmb))
391 rc = dlpar_offline_lmb(lmb);
395 block_sz = pseries_memory_block_size();
396 nid = memory_add_physaddr_to_nid(lmb->base_addr);
398 __remove_memory(nid, lmb->base_addr, block_sz);
400 /* Update memory regions for memory remove */
401 memblock_remove(lmb->base_addr, block_sz);
403 invalidate_lmb_associativity_index(lmb);
404 lmb->flags &= ~DRCONF_MEM_ASSIGNED;
409 static int dlpar_memory_remove_by_count(u32 lmbs_to_remove)
411 struct drmem_lmb *lmb;
412 int lmbs_removed = 0;
413 int lmbs_available = 0;
416 pr_info("Attempting to hot-remove %d LMB(s)\n", lmbs_to_remove);
418 if (lmbs_to_remove == 0)
421 /* Validate that there are enough LMBs to satisfy the request */
422 for_each_drmem_lmb(lmb) {
423 if (lmb_is_removable(lmb))
426 if (lmbs_available == lmbs_to_remove)
430 if (lmbs_available < lmbs_to_remove) {
431 pr_info("Not enough LMBs available (%d of %d) to satisfy request\n",
432 lmbs_available, lmbs_to_remove);
436 for_each_drmem_lmb(lmb) {
437 rc = dlpar_remove_lmb(lmb);
441 /* Mark this lmb so we can add it later if all of the
442 * requested LMBs cannot be removed.
444 drmem_mark_lmb_reserved(lmb);
447 if (lmbs_removed == lmbs_to_remove)
451 if (lmbs_removed != lmbs_to_remove) {
452 pr_err("Memory hot-remove failed, adding LMB's back\n");
454 for_each_drmem_lmb(lmb) {
455 if (!drmem_lmb_reserved(lmb))
458 rc = dlpar_add_lmb(lmb);
460 pr_err("Failed to add LMB back, drc index %x\n",
463 drmem_remove_lmb_reservation(lmb);
468 for_each_drmem_lmb(lmb) {
469 if (!drmem_lmb_reserved(lmb))
472 dlpar_release_drc(lmb->drc_index);
473 pr_info("Memory at %llx was hot-removed\n",
476 drmem_remove_lmb_reservation(lmb);
484 static int dlpar_memory_remove_by_index(u32 drc_index)
486 struct drmem_lmb *lmb;
490 pr_info("Attempting to hot-remove LMB, drc index %x\n", drc_index);
493 for_each_drmem_lmb(lmb) {
494 if (lmb->drc_index == drc_index) {
496 rc = dlpar_remove_lmb(lmb);
498 dlpar_release_drc(lmb->drc_index);
508 pr_info("Failed to hot-remove memory at %llx\n",
511 pr_info("Memory at %llx was hot-removed\n", lmb->base_addr);
516 static int dlpar_memory_readd_by_index(u32 drc_index)
518 struct drmem_lmb *lmb;
522 pr_info("Attempting to update LMB, drc index %x\n", drc_index);
525 for_each_drmem_lmb(lmb) {
526 if (lmb->drc_index == drc_index) {
528 rc = dlpar_remove_lmb(lmb);
530 rc = dlpar_add_lmb(lmb);
532 dlpar_release_drc(lmb->drc_index);
542 pr_info("Failed to update memory at %llx\n",
545 pr_info("Memory at %llx was updated\n", lmb->base_addr);
550 static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
552 struct drmem_lmb *lmb, *start_lmb, *end_lmb;
553 int lmbs_available = 0;
556 pr_info("Attempting to hot-remove %u LMB(s) at %x\n",
557 lmbs_to_remove, drc_index);
559 if (lmbs_to_remove == 0)
562 rc = get_lmb_range(drc_index, lmbs_to_remove, &start_lmb, &end_lmb);
566 /* Validate that there are enough LMBs to satisfy the request */
567 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
568 if (lmb->flags & DRCONF_MEM_RESERVED)
574 if (lmbs_available < lmbs_to_remove)
577 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
578 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
581 rc = dlpar_remove_lmb(lmb);
585 drmem_mark_lmb_reserved(lmb);
589 pr_err("Memory indexed-count-remove failed, adding any removed LMBs\n");
592 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
593 if (!drmem_lmb_reserved(lmb))
596 rc = dlpar_add_lmb(lmb);
598 pr_err("Failed to add LMB, drc index %x\n",
601 drmem_remove_lmb_reservation(lmb);
605 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
606 if (!drmem_lmb_reserved(lmb))
609 dlpar_release_drc(lmb->drc_index);
610 pr_info("Memory at %llx (drc index %x) was hot-removed\n",
611 lmb->base_addr, lmb->drc_index);
613 drmem_remove_lmb_reservation(lmb);
621 static inline int pseries_remove_memblock(unsigned long base,
622 unsigned int memblock_size)
626 static inline int pseries_remove_mem_node(struct device_node *np)
630 static inline int dlpar_memory_remove(struct pseries_hp_errorlog *hp_elog)
634 static int dlpar_remove_lmb(struct drmem_lmb *lmb)
638 static int dlpar_memory_remove_by_count(u32 lmbs_to_remove)
642 static int dlpar_memory_remove_by_index(u32 drc_index)
646 static int dlpar_memory_readd_by_index(u32 drc_index)
651 static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
655 #endif /* CONFIG_MEMORY_HOTREMOVE */
657 static int dlpar_add_lmb(struct drmem_lmb *lmb)
659 unsigned long block_sz;
662 if (lmb->flags & DRCONF_MEM_ASSIGNED)
665 rc = update_lmb_associativity_index(lmb);
667 dlpar_release_drc(lmb->drc_index);
671 block_sz = memory_block_size_bytes();
673 /* Find the node id for this address */
674 nid = memory_add_physaddr_to_nid(lmb->base_addr);
677 rc = __add_memory(nid, lmb->base_addr, block_sz);
679 invalidate_lmb_associativity_index(lmb);
683 rc = dlpar_online_lmb(lmb);
685 __remove_memory(nid, lmb->base_addr, block_sz);
686 invalidate_lmb_associativity_index(lmb);
688 lmb->flags |= DRCONF_MEM_ASSIGNED;
694 static int dlpar_memory_add_by_count(u32 lmbs_to_add)
696 struct drmem_lmb *lmb;
697 int lmbs_available = 0;
701 pr_info("Attempting to hot-add %d LMB(s)\n", lmbs_to_add);
703 if (lmbs_to_add == 0)
706 /* Validate that there are enough LMBs to satisfy the request */
707 for_each_drmem_lmb(lmb) {
708 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
711 if (lmbs_available == lmbs_to_add)
715 if (lmbs_available < lmbs_to_add)
718 for_each_drmem_lmb(lmb) {
719 if (lmb->flags & DRCONF_MEM_ASSIGNED)
722 rc = dlpar_acquire_drc(lmb->drc_index);
726 rc = dlpar_add_lmb(lmb);
728 dlpar_release_drc(lmb->drc_index);
732 /* Mark this lmb so we can remove it later if all of the
733 * requested LMBs cannot be added.
735 drmem_mark_lmb_reserved(lmb);
738 if (lmbs_added == lmbs_to_add)
742 if (lmbs_added != lmbs_to_add) {
743 pr_err("Memory hot-add failed, removing any added LMBs\n");
745 for_each_drmem_lmb(lmb) {
746 if (!drmem_lmb_reserved(lmb))
749 rc = dlpar_remove_lmb(lmb);
751 pr_err("Failed to remove LMB, drc index %x\n",
754 dlpar_release_drc(lmb->drc_index);
756 drmem_remove_lmb_reservation(lmb);
760 for_each_drmem_lmb(lmb) {
761 if (!drmem_lmb_reserved(lmb))
764 pr_info("Memory at %llx (drc index %x) was hot-added\n",
765 lmb->base_addr, lmb->drc_index);
766 drmem_remove_lmb_reservation(lmb);
774 static int dlpar_memory_add_by_index(u32 drc_index)
776 struct drmem_lmb *lmb;
779 pr_info("Attempting to hot-add LMB, drc index %x\n", drc_index);
782 for_each_drmem_lmb(lmb) {
783 if (lmb->drc_index == drc_index) {
785 rc = dlpar_acquire_drc(lmb->drc_index);
787 rc = dlpar_add_lmb(lmb);
789 dlpar_release_drc(lmb->drc_index);
800 pr_info("Failed to hot-add memory, drc index %x\n", drc_index);
802 pr_info("Memory at %llx (drc index %x) was hot-added\n",
803 lmb->base_addr, drc_index);
808 static int dlpar_memory_add_by_ic(u32 lmbs_to_add, u32 drc_index)
810 struct drmem_lmb *lmb, *start_lmb, *end_lmb;
811 int lmbs_available = 0;
814 pr_info("Attempting to hot-add %u LMB(s) at index %x\n",
815 lmbs_to_add, drc_index);
817 if (lmbs_to_add == 0)
820 rc = get_lmb_range(drc_index, lmbs_to_add, &start_lmb, &end_lmb);
824 /* Validate that the LMBs in this range are not reserved */
825 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
826 if (lmb->flags & DRCONF_MEM_RESERVED)
832 if (lmbs_available < lmbs_to_add)
835 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
836 if (lmb->flags & DRCONF_MEM_ASSIGNED)
839 rc = dlpar_acquire_drc(lmb->drc_index);
843 rc = dlpar_add_lmb(lmb);
845 dlpar_release_drc(lmb->drc_index);
849 drmem_mark_lmb_reserved(lmb);
853 pr_err("Memory indexed-count-add failed, removing any added LMBs\n");
855 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
856 if (!drmem_lmb_reserved(lmb))
859 rc = dlpar_remove_lmb(lmb);
861 pr_err("Failed to remove LMB, drc index %x\n",
864 dlpar_release_drc(lmb->drc_index);
866 drmem_remove_lmb_reservation(lmb);
870 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
871 if (!drmem_lmb_reserved(lmb))
874 pr_info("Memory at %llx (drc index %x) was hot-added\n",
875 lmb->base_addr, lmb->drc_index);
876 drmem_remove_lmb_reservation(lmb);
883 int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
885 u32 count, drc_index;
888 lock_device_hotplug();
890 switch (hp_elog->action) {
891 case PSERIES_HP_ELOG_ACTION_ADD:
892 if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_COUNT) {
893 count = hp_elog->_drc_u.drc_count;
894 rc = dlpar_memory_add_by_count(count);
895 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_INDEX) {
896 drc_index = hp_elog->_drc_u.drc_index;
897 rc = dlpar_memory_add_by_index(drc_index);
898 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_IC) {
899 count = hp_elog->_drc_u.ic.count;
900 drc_index = hp_elog->_drc_u.ic.index;
901 rc = dlpar_memory_add_by_ic(count, drc_index);
907 case PSERIES_HP_ELOG_ACTION_REMOVE:
908 if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_COUNT) {
909 count = hp_elog->_drc_u.drc_count;
910 rc = dlpar_memory_remove_by_count(count);
911 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_INDEX) {
912 drc_index = hp_elog->_drc_u.drc_index;
913 rc = dlpar_memory_remove_by_index(drc_index);
914 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_IC) {
915 count = hp_elog->_drc_u.ic.count;
916 drc_index = hp_elog->_drc_u.ic.index;
917 rc = dlpar_memory_remove_by_ic(count, drc_index);
923 case PSERIES_HP_ELOG_ACTION_READD:
924 drc_index = hp_elog->_drc_u.drc_index;
925 rc = dlpar_memory_readd_by_index(drc_index);
928 pr_err("Invalid action (%d) specified\n", hp_elog->action);
934 rtas_hp_event = true;
935 rc = drmem_update_dt();
936 rtas_hp_event = false;
939 unlock_device_hotplug();
943 static int pseries_add_mem_node(struct device_node *np)
948 unsigned int lmb_size;
952 * Check to see if we are actually adding memory
954 type = of_get_property(np, "device_type", NULL);
955 if (type == NULL || strcmp(type, "memory") != 0)
959 * Find the base and size of the memblock
961 regs = of_get_property(np, "reg", NULL);
965 base = be64_to_cpu(*(unsigned long *)regs);
966 lmb_size = be32_to_cpu(regs[3]);
969 * Update memory region to represent the memory add
971 ret = memblock_add(base, lmb_size);
972 return (ret < 0) ? -EINVAL : 0;
975 static int pseries_update_drconf_memory(struct of_reconfig_data *pr)
977 struct of_drconf_cell_v1 *new_drmem, *old_drmem;
978 unsigned long memblock_size;
986 memblock_size = pseries_memory_block_size();
993 p = (__be32 *) pr->old_prop->value;
997 /* The first int of the property is the number of lmb's described
998 * by the property. This is followed by an array of of_drconf_cell
999 * entries. Get the number of entries and skip to the array of
1002 entries = be32_to_cpu(*p++);
1003 old_drmem = (struct of_drconf_cell_v1 *)p;
1005 p = (__be32 *)pr->prop->value;
1007 new_drmem = (struct of_drconf_cell_v1 *)p;
1009 for (i = 0; i < entries; i++) {
1010 if ((be32_to_cpu(old_drmem[i].flags) & DRCONF_MEM_ASSIGNED) &&
1011 (!(be32_to_cpu(new_drmem[i].flags) & DRCONF_MEM_ASSIGNED))) {
1012 rc = pseries_remove_memblock(
1013 be64_to_cpu(old_drmem[i].base_addr),
1016 } else if ((!(be32_to_cpu(old_drmem[i].flags) &
1017 DRCONF_MEM_ASSIGNED)) &&
1018 (be32_to_cpu(new_drmem[i].flags) &
1019 DRCONF_MEM_ASSIGNED)) {
1020 rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr),
1022 rc = (rc < 0) ? -EINVAL : 0;
1029 static int pseries_memory_notifier(struct notifier_block *nb,
1030 unsigned long action, void *data)
1032 struct of_reconfig_data *rd = data;
1036 case OF_RECONFIG_ATTACH_NODE:
1037 err = pseries_add_mem_node(rd->dn);
1039 case OF_RECONFIG_DETACH_NODE:
1040 err = pseries_remove_mem_node(rd->dn);
1042 case OF_RECONFIG_UPDATE_PROPERTY:
1043 if (!strcmp(rd->prop->name, "ibm,dynamic-memory"))
1044 err = pseries_update_drconf_memory(rd);
1047 return notifier_from_errno(err);
1050 static struct notifier_block pseries_mem_nb = {
1051 .notifier_call = pseries_memory_notifier,
1054 static int __init pseries_memory_hotplug_init(void)
1056 if (firmware_has_feature(FW_FEATURE_LPAR))
1057 of_reconfig_notifier_register(&pseries_mem_nb);
1061 machine_device_initcall(pseries, pseries_memory_hotplug_init);