Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201192
b: refs/heads/master
c: 3fdfd99
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed Jul 23, 2010
1 parent 48afc4c commit 48977e0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b8692c022a4b149d0c2cc3f4f7a363453fde72a
refs/heads/master: 3fdfd99051fbc210464378cd44a4b8914282bac3
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
u64 base, size, memblock_size;
unsigned int is_kexec_kdump = 0, rngs;

ls = of_get_flat_dt_prop(node, "ibm,memblock-size", &l);
ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l);
if (ls == NULL || l < dt_root_size_cells * sizeof(__be32))
return 0;
memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls);
Expand Down
24 changes: 12 additions & 12 deletions trunk/arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,15 @@ static int of_get_drconf_memory(struct device_node *memory, const u32 **dm)
}

/*
* Retreive and validate the ibm,memblock-size property for drconf memory
* Retreive and validate the ibm,lmb-size property for drconf memory
* from the device tree.
*/
static u64 of_get_memblock_size(struct device_node *memory)
static u64 of_get_lmb_size(struct device_node *memory)
{
const u32 *prop;
u32 len;

prop = of_get_property(memory, "ibm,memblock-size", &len);
prop = of_get_property(memory, "ibm,lmb-size", &len);
if (!prop || len < sizeof(unsigned int))
return 0;

Expand Down Expand Up @@ -562,7 +562,7 @@ static unsigned long __init numa_enforce_memory_limit(unsigned long start,
static inline int __init read_usm_ranges(const u32 **usm)
{
/*
* For each memblock in ibm,dynamic-memory a corresponding
* For each lmb in ibm,dynamic-memory a corresponding
* entry in linux,drconf-usable-memory property contains
* a counter followed by that many (base, size) duple.
* read the counter from linux,drconf-usable-memory
Expand All @@ -578,16 +578,16 @@ static void __init parse_drconf_memory(struct device_node *memory)
{
const u32 *dm, *usm;
unsigned int n, rc, ranges, is_kexec_kdump = 0;
unsigned long memblock_size, base, size, sz;
unsigned long lmb_size, base, size, sz;
int nid;
struct assoc_arrays aa;

n = of_get_drconf_memory(memory, &dm);
if (!n)
return;

memblock_size = of_get_memblock_size(memory);
if (!memblock_size)
lmb_size = of_get_lmb_size(memory);
if (!lmb_size)
return;

rc = of_get_assoc_arrays(memory, &aa);
Expand All @@ -611,7 +611,7 @@ static void __init parse_drconf_memory(struct device_node *memory)
continue;

base = drmem.base_addr;
size = memblock_size;
size = lmb_size;
ranges = 1;

if (is_kexec_kdump) {
Expand Down Expand Up @@ -1072,16 +1072,16 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
{
const u32 *dm;
unsigned int drconf_cell_cnt, rc;
unsigned long memblock_size;
unsigned long lmb_size;
struct assoc_arrays aa;
int nid = -1;

drconf_cell_cnt = of_get_drconf_memory(memory, &dm);
if (!drconf_cell_cnt)
return -1;

memblock_size = of_get_memblock_size(memory);
if (!memblock_size)
lmb_size = of_get_lmb_size(memory);
if (!lmb_size)
return -1;

rc = of_get_assoc_arrays(memory, &aa);
Expand All @@ -1100,7 +1100,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
continue;

if ((scn_addr < drmem.base_addr)
|| (scn_addr >= (drmem.base_addr + memblock_size)))
|| (scn_addr >= (drmem.base_addr + lmb_size)))
continue;

nid = of_drconf_to_nid_single(&drmem, &aa);
Expand Down
22 changes: 11 additions & 11 deletions trunk/arch/powerpc/platforms/pseries/hotplug-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static int pseries_remove_memory(struct device_node *np)
const char *type;
const unsigned int *regs;
unsigned long base;
unsigned int memblock_size;
unsigned int lmb_size;
int ret = -EINVAL;

/*
Expand All @@ -87,9 +87,9 @@ static int pseries_remove_memory(struct device_node *np)
return ret;

base = *(unsigned long *)regs;
memblock_size = regs[3];
lmb_size = regs[3];

ret = pseries_remove_memblock(base, memblock_size);
ret = pseries_remove_memblock(base, lmb_size);
return ret;
}

Expand All @@ -98,7 +98,7 @@ static int pseries_add_memory(struct device_node *np)
const char *type;
const unsigned int *regs;
unsigned long base;
unsigned int memblock_size;
unsigned int lmb_size;
int ret = -EINVAL;

/*
Expand All @@ -116,36 +116,36 @@ static int pseries_add_memory(struct device_node *np)
return ret;

base = *(unsigned long *)regs;
memblock_size = regs[3];
lmb_size = regs[3];

/*
* Update memory region to represent the memory add
*/
ret = memblock_add(base, memblock_size);
ret = memblock_add(base, lmb_size);
return (ret < 0) ? -EINVAL : 0;
}

static int pseries_drconf_memory(unsigned long *base, unsigned int action)
{
struct device_node *np;
const unsigned long *memblock_size;
const unsigned long *lmb_size;
int rc;

np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
if (!np)
return -EINVAL;

memblock_size = of_get_property(np, "ibm,memblock-size", NULL);
if (!memblock_size) {
lmb_size = of_get_property(np, "ibm,lmb-size", NULL);
if (!lmb_size) {
of_node_put(np);
return -EINVAL;
}

if (action == PSERIES_DRCONF_MEM_ADD) {
rc = memblock_add(*base, *memblock_size);
rc = memblock_add(*base, *lmb_size);
rc = (rc < 0) ? -EINVAL : 0;
} else if (action == PSERIES_DRCONF_MEM_REMOVE) {
rc = pseries_remove_memblock(*base, *memblock_size);
rc = pseries_remove_memblock(*base, *lmb_size);
} else {
rc = -EINVAL;
}
Expand Down

0 comments on commit 48977e0

Please sign in to comment.