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 unsigned int 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 u32 find_aa_index(struct device_node *dr_node,
105 struct property *ala_prop, const u32 *lmb_assoc)
109 int aa_arrays, aa_array_entries, aa_array_sz;
113 * The ibm,associativity-lookup-arrays property is defined to be
114 * a 32-bit value specifying the number of associativity arrays
115 * followed by a 32-bitvalue specifying the number of entries per
116 * array, followed by the associativity arrays.
118 assoc_arrays = ala_prop->value;
120 aa_arrays = be32_to_cpu(assoc_arrays[0]);
121 aa_array_entries = be32_to_cpu(assoc_arrays[1]);
122 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 if (aa_index == -1) {
136 struct property *new_prop;
139 new_prop_size = ala_prop->length + aa_array_sz;
140 new_prop = dlpar_clone_property(ala_prop, new_prop_size);
144 assoc_arrays = new_prop->value;
146 /* increment the number of entries in the lookup array */
147 assoc_arrays[0] = cpu_to_be32(aa_arrays + 1);
149 /* copy the new associativity into the lookup array */
150 index = aa_arrays * aa_array_entries + 2;
151 memcpy(&assoc_arrays[index], &lmb_assoc[1], aa_array_sz);
153 of_update_property(dr_node, new_prop);
156 * The associativity lookup array index for this lmb is
157 * number of entries - 1 since we added its associativity
158 * to the end of the lookup array.
160 aa_index = be32_to_cpu(assoc_arrays[0]) - 1;
166 static int update_lmb_associativity_index(struct drmem_lmb *lmb)
168 struct device_node *parent, *lmb_node, *dr_node;
169 struct property *ala_prop;
170 const u32 *lmb_assoc;
173 parent = of_find_node_by_path("/");
177 lmb_node = dlpar_configure_connector(cpu_to_be32(lmb->drc_index),
183 lmb_assoc = of_get_property(lmb_node, "ibm,associativity", NULL);
185 dlpar_free_cc_nodes(lmb_node);
189 dr_node = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
191 dlpar_free_cc_nodes(lmb_node);
195 ala_prop = of_find_property(dr_node, "ibm,associativity-lookup-arrays",
198 of_node_put(dr_node);
199 dlpar_free_cc_nodes(lmb_node);
203 aa_index = find_aa_index(dr_node, ala_prop, lmb_assoc);
205 dlpar_free_cc_nodes(lmb_node);
208 pr_err("Could not find LMB associativity\n");
212 lmb->aa_index = aa_index;
216 static struct memory_block *lmb_to_memblock(struct drmem_lmb *lmb)
218 unsigned long section_nr;
219 struct mem_section *mem_sect;
220 struct memory_block *mem_block;
222 section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr));
223 mem_sect = __nr_to_section(section_nr);
225 mem_block = find_memory_block(mem_sect);
229 static int get_lmb_range(u32 drc_index, int n_lmbs,
230 struct drmem_lmb **start_lmb,
231 struct drmem_lmb **end_lmb)
233 struct drmem_lmb *lmb, *start, *end;
234 struct drmem_lmb *last_lmb;
237 for_each_drmem_lmb(lmb) {
238 if (lmb->drc_index == drc_index) {
247 end = &start[n_lmbs - 1];
249 last_lmb = &drmem_info->lmbs[drmem_info->n_lmbs - 1];
258 static int dlpar_change_lmb_state(struct drmem_lmb *lmb, bool online)
260 struct memory_block *mem_block;
263 mem_block = lmb_to_memblock(lmb);
267 if (online && mem_block->dev.offline)
268 rc = device_online(&mem_block->dev);
269 else if (!online && !mem_block->dev.offline)
270 rc = device_offline(&mem_block->dev);
274 put_device(&mem_block->dev);
279 static int dlpar_online_lmb(struct drmem_lmb *lmb)
281 return dlpar_change_lmb_state(lmb, true);
284 #ifdef CONFIG_MEMORY_HOTREMOVE
285 static int dlpar_offline_lmb(struct drmem_lmb *lmb)
287 return dlpar_change_lmb_state(lmb, false);
290 static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
292 unsigned long block_sz, start_pfn;
293 int sections_per_block;
296 start_pfn = base >> PAGE_SHIFT;
298 lock_device_hotplug();
300 if (!pfn_valid(start_pfn))
303 block_sz = pseries_memory_block_size();
304 sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
305 nid = memory_add_physaddr_to_nid(base);
307 for (i = 0; i < sections_per_block; i++) {
308 remove_memory(nid, base, MIN_MEMORY_BLOCK_SIZE);
309 base += MIN_MEMORY_BLOCK_SIZE;
313 /* Update memory regions for memory remove */
314 memblock_remove(base, memblock_size);
315 unlock_device_hotplug();
319 static int pseries_remove_mem_node(struct device_node *np)
324 unsigned int lmb_size;
328 * Check to see if we are actually removing memory
330 type = of_get_property(np, "device_type", NULL);
331 if (type == NULL || strcmp(type, "memory") != 0)
335 * Find the base address and size of the memblock
337 regs = of_get_property(np, "reg", NULL);
341 base = be64_to_cpu(*(unsigned long *)regs);
342 lmb_size = be32_to_cpu(regs[3]);
344 pseries_remove_memblock(base, lmb_size);
348 static bool lmb_is_removable(struct drmem_lmb *lmb)
350 int i, scns_per_block;
352 unsigned long pfn, block_sz;
355 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
358 block_sz = memory_block_size_bytes();
359 scns_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
360 phys_addr = lmb->base_addr;
362 #ifdef CONFIG_FA_DUMP
363 /* Don't hot-remove memory that falls in fadump boot memory area */
364 if (is_fadump_boot_memory_area(phys_addr, block_sz))
368 for (i = 0; i < scns_per_block; i++) {
369 pfn = PFN_DOWN(phys_addr);
370 if (!pfn_present(pfn))
373 rc &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
374 phys_addr += MIN_MEMORY_BLOCK_SIZE;
377 return rc ? true : false;
380 static int dlpar_add_lmb(struct drmem_lmb *);
382 static int dlpar_remove_lmb(struct drmem_lmb *lmb)
384 unsigned long block_sz;
387 if (!lmb_is_removable(lmb))
390 rc = dlpar_offline_lmb(lmb);
394 block_sz = pseries_memory_block_size();
395 nid = memory_add_physaddr_to_nid(lmb->base_addr);
397 remove_memory(nid, lmb->base_addr, block_sz);
399 /* Update memory regions for memory remove */
400 memblock_remove(lmb->base_addr, block_sz);
402 invalidate_lmb_associativity_index(lmb);
403 lmb->flags &= ~DRCONF_MEM_ASSIGNED;
408 static int dlpar_memory_remove_by_count(u32 lmbs_to_remove)
410 struct drmem_lmb *lmb;
411 int lmbs_removed = 0;
412 int lmbs_available = 0;
415 pr_info("Attempting to hot-remove %d LMB(s)\n", lmbs_to_remove);
417 if (lmbs_to_remove == 0)
420 /* Validate that there are enough LMBs to satisfy the request */
421 for_each_drmem_lmb(lmb) {
422 if (lmb_is_removable(lmb))
425 if (lmbs_available == lmbs_to_remove)
429 if (lmbs_available < lmbs_to_remove) {
430 pr_info("Not enough LMBs available (%d of %d) to satisfy request\n",
431 lmbs_available, lmbs_to_remove);
435 for_each_drmem_lmb(lmb) {
436 rc = dlpar_remove_lmb(lmb);
440 /* Mark this lmb so we can add it later if all of the
441 * requested LMBs cannot be removed.
443 drmem_mark_lmb_reserved(lmb);
446 if (lmbs_removed == lmbs_to_remove)
450 if (lmbs_removed != lmbs_to_remove) {
451 pr_err("Memory hot-remove failed, adding LMB's back\n");
453 for_each_drmem_lmb(lmb) {
454 if (!drmem_lmb_reserved(lmb))
457 rc = dlpar_add_lmb(lmb);
459 pr_err("Failed to add LMB back, drc index %x\n",
462 drmem_remove_lmb_reservation(lmb);
467 for_each_drmem_lmb(lmb) {
468 if (!drmem_lmb_reserved(lmb))
471 dlpar_release_drc(lmb->drc_index);
472 pr_info("Memory at %llx was hot-removed\n",
475 drmem_remove_lmb_reservation(lmb);
483 static int dlpar_memory_remove_by_index(u32 drc_index)
485 struct drmem_lmb *lmb;
489 pr_info("Attempting to hot-remove LMB, drc index %x\n", drc_index);
492 for_each_drmem_lmb(lmb) {
493 if (lmb->drc_index == drc_index) {
495 rc = dlpar_remove_lmb(lmb);
497 dlpar_release_drc(lmb->drc_index);
507 pr_info("Failed to hot-remove memory at %llx\n",
510 pr_info("Memory at %llx was hot-removed\n", lmb->base_addr);
515 static int dlpar_memory_readd_by_index(u32 drc_index)
517 struct drmem_lmb *lmb;
521 pr_info("Attempting to update LMB, drc index %x\n", drc_index);
524 for_each_drmem_lmb(lmb) {
525 if (lmb->drc_index == drc_index) {
527 rc = dlpar_remove_lmb(lmb);
529 rc = dlpar_add_lmb(lmb);
531 dlpar_release_drc(lmb->drc_index);
541 pr_info("Failed to update memory at %llx\n",
544 pr_info("Memory at %llx was updated\n", lmb->base_addr);
549 static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
551 struct drmem_lmb *lmb, *start_lmb, *end_lmb;
552 int lmbs_available = 0;
555 pr_info("Attempting to hot-remove %u LMB(s) at %x\n",
556 lmbs_to_remove, drc_index);
558 if (lmbs_to_remove == 0)
561 rc = get_lmb_range(drc_index, lmbs_to_remove, &start_lmb, &end_lmb);
565 /* Validate that there are enough LMBs to satisfy the request */
566 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
567 if (lmb->flags & DRCONF_MEM_RESERVED)
573 if (lmbs_available < lmbs_to_remove)
576 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
577 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
580 rc = dlpar_remove_lmb(lmb);
584 drmem_mark_lmb_reserved(lmb);
588 pr_err("Memory indexed-count-remove failed, adding any removed LMBs\n");
591 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
592 if (!drmem_lmb_reserved(lmb))
595 rc = dlpar_add_lmb(lmb);
597 pr_err("Failed to add LMB, drc index %x\n",
600 drmem_remove_lmb_reservation(lmb);
604 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
605 if (!drmem_lmb_reserved(lmb))
608 dlpar_release_drc(lmb->drc_index);
609 pr_info("Memory at %llx (drc index %x) was hot-removed\n",
610 lmb->base_addr, lmb->drc_index);
612 drmem_remove_lmb_reservation(lmb);
620 static inline int pseries_remove_memblock(unsigned long base,
621 unsigned int memblock_size)
625 static inline int pseries_remove_mem_node(struct device_node *np)
629 static inline int dlpar_memory_remove(struct pseries_hp_errorlog *hp_elog)
633 static int dlpar_remove_lmb(struct drmem_lmb *lmb)
637 static int dlpar_memory_remove_by_count(u32 lmbs_to_remove)
641 static int dlpar_memory_remove_by_index(u32 drc_index)
645 static int dlpar_memory_readd_by_index(u32 drc_index)
650 static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
654 #endif /* CONFIG_MEMORY_HOTREMOVE */
656 static int dlpar_add_lmb(struct drmem_lmb *lmb)
658 unsigned long block_sz;
661 if (lmb->flags & DRCONF_MEM_ASSIGNED)
664 rc = update_lmb_associativity_index(lmb);
666 dlpar_release_drc(lmb->drc_index);
670 block_sz = memory_block_size_bytes();
672 /* Find the node id for this address */
673 nid = memory_add_physaddr_to_nid(lmb->base_addr);
676 rc = add_memory(nid, lmb->base_addr, block_sz);
678 invalidate_lmb_associativity_index(lmb);
682 rc = dlpar_online_lmb(lmb);
684 remove_memory(nid, lmb->base_addr, block_sz);
685 invalidate_lmb_associativity_index(lmb);
687 lmb->flags |= DRCONF_MEM_ASSIGNED;
693 static int dlpar_memory_add_by_count(u32 lmbs_to_add)
695 struct drmem_lmb *lmb;
696 int lmbs_available = 0;
700 pr_info("Attempting to hot-add %d LMB(s)\n", lmbs_to_add);
702 if (lmbs_to_add == 0)
705 /* Validate that there are enough LMBs to satisfy the request */
706 for_each_drmem_lmb(lmb) {
707 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
710 if (lmbs_available == lmbs_to_add)
714 if (lmbs_available < lmbs_to_add)
717 for_each_drmem_lmb(lmb) {
718 if (lmb->flags & DRCONF_MEM_ASSIGNED)
721 rc = dlpar_acquire_drc(lmb->drc_index);
725 rc = dlpar_add_lmb(lmb);
727 dlpar_release_drc(lmb->drc_index);
731 /* Mark this lmb so we can remove it later if all of the
732 * requested LMBs cannot be added.
734 drmem_mark_lmb_reserved(lmb);
737 if (lmbs_added == lmbs_to_add)
741 if (lmbs_added != lmbs_to_add) {
742 pr_err("Memory hot-add failed, removing any added LMBs\n");
744 for_each_drmem_lmb(lmb) {
745 if (!drmem_lmb_reserved(lmb))
748 rc = dlpar_remove_lmb(lmb);
750 pr_err("Failed to remove LMB, drc index %x\n",
753 dlpar_release_drc(lmb->drc_index);
755 drmem_remove_lmb_reservation(lmb);
759 for_each_drmem_lmb(lmb) {
760 if (!drmem_lmb_reserved(lmb))
763 pr_info("Memory at %llx (drc index %x) was hot-added\n",
764 lmb->base_addr, lmb->drc_index);
765 drmem_remove_lmb_reservation(lmb);
773 static int dlpar_memory_add_by_index(u32 drc_index)
775 struct drmem_lmb *lmb;
778 pr_info("Attempting to hot-add LMB, drc index %x\n", drc_index);
781 for_each_drmem_lmb(lmb) {
782 if (lmb->drc_index == drc_index) {
784 rc = dlpar_acquire_drc(lmb->drc_index);
786 rc = dlpar_add_lmb(lmb);
788 dlpar_release_drc(lmb->drc_index);
799 pr_info("Failed to hot-add memory, drc index %x\n", drc_index);
801 pr_info("Memory at %llx (drc index %x) was hot-added\n",
802 lmb->base_addr, drc_index);
807 static int dlpar_memory_add_by_ic(u32 lmbs_to_add, u32 drc_index)
809 struct drmem_lmb *lmb, *start_lmb, *end_lmb;
810 int lmbs_available = 0;
813 pr_info("Attempting to hot-add %u LMB(s) at index %x\n",
814 lmbs_to_add, drc_index);
816 if (lmbs_to_add == 0)
819 rc = get_lmb_range(drc_index, lmbs_to_add, &start_lmb, &end_lmb);
823 /* Validate that the LMBs in this range are not reserved */
824 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
825 if (lmb->flags & DRCONF_MEM_RESERVED)
831 if (lmbs_available < lmbs_to_add)
834 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
835 if (lmb->flags & DRCONF_MEM_ASSIGNED)
838 rc = dlpar_acquire_drc(lmb->drc_index);
842 rc = dlpar_add_lmb(lmb);
844 dlpar_release_drc(lmb->drc_index);
848 drmem_mark_lmb_reserved(lmb);
852 pr_err("Memory indexed-count-add failed, removing any added LMBs\n");
854 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
855 if (!drmem_lmb_reserved(lmb))
858 rc = dlpar_remove_lmb(lmb);
860 pr_err("Failed to remove LMB, drc index %x\n",
863 dlpar_release_drc(lmb->drc_index);
865 drmem_remove_lmb_reservation(lmb);
869 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
870 if (!drmem_lmb_reserved(lmb))
873 pr_info("Memory at %llx (drc index %x) was hot-added\n",
874 lmb->base_addr, lmb->drc_index);
875 drmem_remove_lmb_reservation(lmb);
882 int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
884 u32 count, drc_index;
887 lock_device_hotplug();
889 switch (hp_elog->action) {
890 case PSERIES_HP_ELOG_ACTION_ADD:
891 if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_COUNT) {
892 count = hp_elog->_drc_u.drc_count;
893 rc = dlpar_memory_add_by_count(count);
894 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_INDEX) {
895 drc_index = hp_elog->_drc_u.drc_index;
896 rc = dlpar_memory_add_by_index(drc_index);
897 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_IC) {
898 count = hp_elog->_drc_u.ic.count;
899 drc_index = hp_elog->_drc_u.ic.index;
900 rc = dlpar_memory_add_by_ic(count, drc_index);
906 case PSERIES_HP_ELOG_ACTION_REMOVE:
907 if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_COUNT) {
908 count = hp_elog->_drc_u.drc_count;
909 rc = dlpar_memory_remove_by_count(count);
910 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_INDEX) {
911 drc_index = hp_elog->_drc_u.drc_index;
912 rc = dlpar_memory_remove_by_index(drc_index);
913 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_IC) {
914 count = hp_elog->_drc_u.ic.count;
915 drc_index = hp_elog->_drc_u.ic.index;
916 rc = dlpar_memory_remove_by_ic(count, drc_index);
922 case PSERIES_HP_ELOG_ACTION_READD:
923 drc_index = hp_elog->_drc_u.drc_index;
924 rc = dlpar_memory_readd_by_index(drc_index);
927 pr_err("Invalid action (%d) specified\n", hp_elog->action);
933 rtas_hp_event = true;
934 rc = drmem_update_dt();
935 rtas_hp_event = false;
938 unlock_device_hotplug();
942 static int pseries_add_mem_node(struct device_node *np)
947 unsigned int lmb_size;
951 * Check to see if we are actually adding memory
953 type = of_get_property(np, "device_type", NULL);
954 if (type == NULL || strcmp(type, "memory") != 0)
958 * Find the base and size of the memblock
960 regs = of_get_property(np, "reg", NULL);
964 base = be64_to_cpu(*(unsigned long *)regs);
965 lmb_size = be32_to_cpu(regs[3]);
968 * Update memory region to represent the memory add
970 ret = memblock_add(base, lmb_size);
971 return (ret < 0) ? -EINVAL : 0;
974 static int pseries_update_drconf_memory(struct of_reconfig_data *pr)
976 struct of_drconf_cell_v1 *new_drmem, *old_drmem;
977 unsigned long memblock_size;
985 memblock_size = pseries_memory_block_size();
989 p = (__be32 *) pr->old_prop->value;
993 /* The first int of the property is the number of lmb's described
994 * by the property. This is followed by an array of of_drconf_cell
995 * entries. Get the number of entries and skip to the array of
998 entries = be32_to_cpu(*p++);
999 old_drmem = (struct of_drconf_cell_v1 *)p;
1001 p = (__be32 *)pr->prop->value;
1003 new_drmem = (struct of_drconf_cell_v1 *)p;
1005 for (i = 0; i < entries; i++) {
1006 if ((be32_to_cpu(old_drmem[i].flags) & DRCONF_MEM_ASSIGNED) &&
1007 (!(be32_to_cpu(new_drmem[i].flags) & DRCONF_MEM_ASSIGNED))) {
1008 rc = pseries_remove_memblock(
1009 be64_to_cpu(old_drmem[i].base_addr),
1012 } else if ((!(be32_to_cpu(old_drmem[i].flags) &
1013 DRCONF_MEM_ASSIGNED)) &&
1014 (be32_to_cpu(new_drmem[i].flags) &
1015 DRCONF_MEM_ASSIGNED)) {
1016 rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr),
1018 rc = (rc < 0) ? -EINVAL : 0;
1025 static int pseries_memory_notifier(struct notifier_block *nb,
1026 unsigned long action, void *data)
1028 struct of_reconfig_data *rd = data;
1032 case OF_RECONFIG_ATTACH_NODE:
1033 err = pseries_add_mem_node(rd->dn);
1035 case OF_RECONFIG_DETACH_NODE:
1036 err = pseries_remove_mem_node(rd->dn);
1038 case OF_RECONFIG_UPDATE_PROPERTY:
1039 if (!strcmp(rd->prop->name, "ibm,dynamic-memory"))
1040 err = pseries_update_drconf_memory(rd);
1043 return notifier_from_errno(err);
1046 static struct notifier_block pseries_mem_nb = {
1047 .notifier_call = pseries_memory_notifier,
1050 static int __init pseries_memory_hotplug_init(void)
1052 if (firmware_has_feature(FW_FEATURE_LPAR))
1053 of_reconfig_notifier_register(&pseries_mem_nb);
1057 machine_device_initcall(pseries, pseries_memory_hotplug_init);