diff options
-rw-r--r-- | drivers/base/memory.c | 7 | ||||
-rw-r--r-- | include/linux/memory.h | 5 | ||||
-rw-r--r-- | mm/memory_hotplug.c | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 7ae413fdd5fc..1f3801a8184d 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/kobject.h> | 20 | #include <linux/kobject.h> |
21 | #include <linux/memory_hotplug.h> | 21 | #include <linux/memory_hotplug.h> |
22 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
23 | #include <linux/mutex.h> | ||
23 | #include <asm/atomic.h> | 24 | #include <asm/atomic.h> |
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
25 | 26 | ||
@@ -205,7 +206,7 @@ static int memory_block_change_state(struct memory_block *mem, | |||
205 | unsigned long to_state, unsigned long from_state_req) | 206 | unsigned long to_state, unsigned long from_state_req) |
206 | { | 207 | { |
207 | int ret = 0; | 208 | int ret = 0; |
208 | down(&mem->state_sem); | 209 | mutex_lock(&mem->state_mutex); |
209 | 210 | ||
210 | if (mem->state != from_state_req) { | 211 | if (mem->state != from_state_req) { |
211 | ret = -EINVAL; | 212 | ret = -EINVAL; |
@@ -217,7 +218,7 @@ static int memory_block_change_state(struct memory_block *mem, | |||
217 | mem->state = to_state; | 218 | mem->state = to_state; |
218 | 219 | ||
219 | out: | 220 | out: |
220 | up(&mem->state_sem); | 221 | mutex_unlock(&mem->state_mutex); |
221 | return ret; | 222 | return ret; |
222 | } | 223 | } |
223 | 224 | ||
@@ -341,7 +342,7 @@ static int add_memory_block(unsigned long node_id, struct mem_section *section, | |||
341 | 342 | ||
342 | mem->phys_index = __section_nr(section); | 343 | mem->phys_index = __section_nr(section); |
343 | mem->state = state; | 344 | mem->state = state; |
344 | init_MUTEX(&mem->state_sem); | 345 | mutex_init(&mem->state_mutex); |
345 | mem->phys_device = phys_device; | 346 | mem->phys_device = phys_device; |
346 | 347 | ||
347 | ret = register_memory(mem, section, NULL); | 348 | ret = register_memory(mem, section, NULL); |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 33f0ff0cf634..f80e0e331cb7 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -18,8 +18,7 @@ | |||
18 | #include <linux/sysdev.h> | 18 | #include <linux/sysdev.h> |
19 | #include <linux/node.h> | 19 | #include <linux/node.h> |
20 | #include <linux/compiler.h> | 20 | #include <linux/compiler.h> |
21 | 21 | #include <linux/mutex.h> | |
22 | #include <asm/semaphore.h> | ||
23 | 22 | ||
24 | struct memory_block { | 23 | struct memory_block { |
25 | unsigned long phys_index; | 24 | unsigned long phys_index; |
@@ -30,7 +29,7 @@ struct memory_block { | |||
30 | * created long after the critical areas during | 29 | * created long after the critical areas during |
31 | * initialization. | 30 | * initialization. |
32 | */ | 31 | */ |
33 | struct semaphore state_sem; | 32 | struct mutex state_mutex; |
34 | int phys_device; /* to which fru does this belong? */ | 33 | int phys_device; /* to which fru does this belong? */ |
35 | void *hw; /* optional pointer to fw/hw data */ | 34 | void *hw; /* optional pointer to fw/hw data */ |
36 | int (*phys_callback)(struct memory_block *); | 35 | int (*phys_callback)(struct memory_block *); |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 7469c503580d..0fb330271271 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -208,7 +208,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages) | |||
208 | /* | 208 | /* |
209 | * This doesn't need a lock to do pfn_to_page(). | 209 | * This doesn't need a lock to do pfn_to_page(). |
210 | * The section can't be removed here because of the | 210 | * The section can't be removed here because of the |
211 | * memory_block->state_sem. | 211 | * memory_block->state_mutex. |
212 | */ | 212 | */ |
213 | zone = page_zone(pfn_to_page(pfn)); | 213 | zone = page_zone(pfn_to_page(pfn)); |
214 | pgdat_resize_lock(zone->zone_pgdat, &flags); | 214 | pgdat_resize_lock(zone->zone_pgdat, &flags); |