mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
ACPI: Ingore the memory block with zero block size in course of memory hotplug
If the memory block size is zero, ignore it and don't do the memory hotplug flowchart. Otherwise it will complain the following warning message: >System RAM resource 0 - ffffffffffffffff cannot be added Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
aa7b2b2e97
commit
5d2619fca7
1 changed files with 15 additions and 3 deletions
|
@ -242,7 +242,12 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
|
||||||
num_enabled++;
|
num_enabled++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* If the memory block size is zero, please ignore it.
|
||||||
|
* Don't try to do the following memory hotplug flowchart.
|
||||||
|
*/
|
||||||
|
if (!info->length)
|
||||||
|
continue;
|
||||||
if (node < 0)
|
if (node < 0)
|
||||||
node = memory_add_physaddr_to_nid(info->start_addr);
|
node = memory_add_physaddr_to_nid(info->start_addr);
|
||||||
|
|
||||||
|
@ -257,8 +262,15 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
|
||||||
mem_device->state = MEMORY_INVALID_STATE;
|
mem_device->state = MEMORY_INVALID_STATE;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
return result;
|
* Sometimes the memory device will contain several memory blocks.
|
||||||
|
* When one memory block is hot-added to the system memory, it will
|
||||||
|
* be regarded as a success.
|
||||||
|
* Otherwise if the last memory block can't be hot-added to the system
|
||||||
|
* memory, it will be failure and the memory device can't be bound with
|
||||||
|
* driver.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
|
static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
|
||||||
|
|
Loading…
Reference in a new issue