tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: b7bed6628b750ffd687d1da0a170dece4b0c08bd commit: 2e1b00fcf1e3152a1e73846f5f9ec37cef088a65 [29999/30000] ACPI/HMAT: Add missing locality information for hot-added device config: x86_64-randconfig-013-20240903 (https://download.01.org/0day-ci/archive/20240904/202409040825.59qJfROR-lkp@i...) compiler: gcc-11 (Debian 11.3.0-12) 11.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240904/202409040825.59qJfROR-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202409040825.59qJfROR-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: drivers/acpi/acpi_memhotplug.o: in function `acpi_memory_enable_device':
drivers/acpi/acpi_memhotplug.c:236: undefined reference to `hmat_restore_target'
vim +236 drivers/acpi/acpi_memhotplug.c
171 172 static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) 173 { 174 acpi_handle handle = mem_device->device->handle; 175 int result, num_enabled = 0; 176 struct acpi_memory_info *info; 177 int node; 178 179 node = acpi_get_node(handle); 180 /* 181 * Tell the VM there is more memory here... 182 * Note: Assume that this function returns zero on success 183 * We don't have memory-hot-add rollback function,now. 184 * (i.e. memory-hot-remove function) 185 */ 186 list_for_each_entry(info, &mem_device->res_list, list) { 187 if (info->enabled) { /* just sanity check...*/ 188 num_enabled++; 189 continue; 190 } 191 /* 192 * If the memory block size is zero, please ignore it. 193 * Don't try to do the following memory hotplug flowchart. 194 */ 195 if (!info->length) 196 continue; 197 if (node < 0) 198 node = memory_add_physaddr_to_nid(info->start_addr); 199 200 result = __add_memory(node, info->start_addr, info->length, 201 MHP_NONE); 202 203 /* 204 * If the memory block has been used by the kernel, add_memory() 205 * returns -EEXIST. If add_memory() returns the other error, it 206 * means that this memory block is not used by the kernel. 207 */ 208 if (result && result != -EEXIST) 209 continue; 210 211 result = acpi_bind_memory_blocks(info, mem_device->device); 212 if (result) { 213 acpi_unbind_memory_blocks(info); 214 return -ENODEV; 215 } 216 217 info->enabled = 1; 218 219 /* 220 * Add num_enable even if add_memory() returns -EEXIST, so the 221 * device is bound to this driver. 222 */ 223 224 hotplug_mdev[node] = mem_device->device; 225 num_enabled++; 226 } 227 if (acpi_has_method(handle, "_HMA")) { 228 acpi_status status; 229 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 230 231 status = acpi_evaluate_object(handle, "_HMA", NULL, &buffer); 232 if (ACPI_SUCCESS(status) && buffer.length) { 233 union acpi_object *obj = buffer.pointer; 234 235 if (!obj->buffer.length)
236 hmat_restore_target(node);
237 } 238 } 239 240 if (!num_enabled) { 241 dev_err(&mem_device->device->dev, "add_memory failed\n"); 242 return -EINVAL; 243 } 244 /* 245 * Sometimes the memory device will contain several memory blocks. 246 * When one memory block is hot-added to the system memory, it will 247 * be regarded as a success. 248 * Otherwise if the last memory block can't be hot-added to the system 249 * memory, it will be failure and the memory device can't be bound with 250 * driver. 251 */ 252 return 0; 253 } 254