Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188107
b: refs/heads/master
c: bc32df0
h: refs/heads/master
i:
  188105: 71d1dc2
  188103: 3cf98d1
v: v3
  • Loading branch information
Heiko Carstens authored and Linus Torvalds committed Mar 18, 2010
1 parent e3507fe commit bf6051e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 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: e5d6151115aee73825c1752aff7cd09adfece839
refs/heads/master: bc32df00894f0e1dbf583cc3dab210d2969b078a
15 changes: 10 additions & 5 deletions trunk/drivers/base/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,16 @@ static inline int memory_fail_init(void)
* differentiation between which *physical* devices each
* section belongs to...
*/
int __weak arch_get_memory_phys_device(unsigned long start_pfn)
{
return 0;
}

static int add_memory_block(int nid, struct mem_section *section,
unsigned long state, int phys_device,
enum mem_add_context context)
unsigned long state, enum mem_add_context context)
{
struct memory_block *mem = kzalloc(sizeof(*mem), GFP_KERNEL);
unsigned long start_pfn;
int ret = 0;

if (!mem)
Expand All @@ -443,7 +447,8 @@ static int add_memory_block(int nid, struct mem_section *section,
mem->phys_index = __section_nr(section);
mem->state = state;
mutex_init(&mem->state_mutex);
mem->phys_device = phys_device;
start_pfn = section_nr_to_pfn(mem->phys_index);
mem->phys_device = arch_get_memory_phys_device(start_pfn);

ret = register_memory(mem, section);
if (!ret)
Expand Down Expand Up @@ -515,7 +520,7 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section,
*/
int register_new_memory(int nid, struct mem_section *section)
{
return add_memory_block(nid, section, MEM_OFFLINE, 0, HOTPLUG);
return add_memory_block(nid, section, MEM_OFFLINE, HOTPLUG);
}

int unregister_memory_section(struct mem_section *section)
Expand Down Expand Up @@ -548,7 +553,7 @@ int __init memory_dev_init(void)
if (!present_section_nr(i))
continue;
err = add_memory_block(0, __nr_to_section(i), MEM_ONLINE,
0, BOOT);
BOOT);
if (!ret)
ret = err;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ struct memory_block {
struct sys_device sysdev;
};

int arch_get_memory_phys_device(unsigned long start_pfn);

/* These states are exposed to userspace as text strings in sysfs */
#define MEM_ONLINE (1<<0) /* exposed to userspace */
#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */
Expand Down

0 comments on commit bf6051e

Please sign in to comment.