diff options
| -rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 37cbe72d17eb..9a62224cc278 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
| @@ -242,7 +242,12 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) | |||
| 242 | num_enabled++; | 242 | num_enabled++; |
| 243 | continue; | 243 | continue; |
| 244 | } | 244 | } |
| 245 | 245 | /* | |
| 246 | * If the memory block size is zero, please ignore it. | ||
| 247 | * Don't try to do the following memory hotplug flowchart. | ||
| 248 | */ | ||
| 249 | if (!info->length) | ||
| 250 | continue; | ||
| 246 | if (node < 0) | 251 | if (node < 0) |
| 247 | node = memory_add_physaddr_to_nid(info->start_addr); | 252 | node = memory_add_physaddr_to_nid(info->start_addr); |
| 248 | 253 | ||
| @@ -257,8 +262,15 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) | |||
| 257 | mem_device->state = MEMORY_INVALID_STATE; | 262 | mem_device->state = MEMORY_INVALID_STATE; |
| 258 | return -EINVAL; | 263 | return -EINVAL; |
| 259 | } | 264 | } |
| 260 | 265 | /* | |
| 261 | return result; | 266 | * Sometimes the memory device will contain several memory blocks. |
| 267 | * When one memory block is hot-added to the system memory, it will | ||
| 268 | * be regarded as a success. | ||
| 269 | * Otherwise if the last memory block can't be hot-added to the system | ||
| 270 | * memory, it will be failure and the memory device can't be bound with | ||
| 271 | * driver. | ||
| 272 | */ | ||
| 273 | return 0; | ||
| 262 | } | 274 | } |
| 263 | 275 | ||
| 264 | static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) | 276 | static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) |
