Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'acpi-extra-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more ACPI updates from Rafael Wysocki:
"Here are new versions of two ACPICA changes that were deferred
previously due to a problem they had introduced, two cleanups on top
of them and the removal of a useless warning message from the ACPI
core.

Specifics:

- Move some Linux-specific functionality to upstream ACPICA and
update the in-kernel users of it accordingly (Lv Zheng)

- Drop a useless warning (triggered by the lack of an optional
object) from the ACPI namespace scanning code (Zhang Rui)"

* tag 'acpi-extra-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / osl: Remove deprecated acpi_get_table_with_size()/early_acpi_os_unmap_memory()
ACPI / osl: Remove acpi_get_table_with_size()/early_acpi_os_unmap_memory() users
ACPICA: Tables: Allow FADT to be customized with virtual address
ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel
ACPI: do not warn if _BQC does not exist

+228 -129
+1 -1
arch/arm64/include/asm/acpi.h
··· 29 29 30 30 /* Basic configuration for ACPI */ 31 31 #ifdef CONFIG_ACPI 32 - /* ACPI table mapping after acpi_gbl_permanent_mmap is set */ 32 + /* ACPI table mapping after acpi_permanent_mmap is set */ 33 33 static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, 34 34 acpi_size size) 35 35 {
+3 -4
arch/arm64/kernel/acpi.c
··· 132 132 struct acpi_table_header *table; 133 133 struct acpi_table_fadt *fadt; 134 134 acpi_status status; 135 - acpi_size tbl_size; 136 135 int ret = 0; 137 136 138 137 /* 139 138 * FADT is required on arm64; retrieve it to check its presence 140 139 * and carry out revision and ACPI HW reduced compliancy tests 141 140 */ 142 - status = acpi_get_table_with_size(ACPI_SIG_FADT, 0, &table, &tbl_size); 141 + status = acpi_get_table(ACPI_SIG_FADT, 0, &table); 143 142 if (ACPI_FAILURE(status)) { 144 143 const char *msg = acpi_format_exception(status); 145 144 ··· 169 170 170 171 out: 171 172 /* 172 - * acpi_get_table_with_size() creates FADT table mapping that 173 + * acpi_get_table() creates FADT table mapping that 173 174 * should be released after parsing and before resuming boot 174 175 */ 175 - early_acpi_os_unmap_memory(table, tbl_size); 176 + acpi_put_table(table); 176 177 return ret; 177 178 } 178 179
+6
drivers/acpi/acpica/actables.h
··· 166 166 167 167 acpi_status acpi_tb_parse_root_table(acpi_physical_address rsdp_address); 168 168 169 + acpi_status 170 + acpi_tb_get_table(struct acpi_table_desc *table_desc, 171 + struct acpi_table_header **out_table); 172 + 173 + void acpi_tb_put_table(struct acpi_table_desc *table_desc); 174 + 169 175 /* 170 176 * tbxfload 171 177 */
+7 -7
drivers/acpi/acpica/tbfadt.c
··· 311 311 { 312 312 u32 length; 313 313 struct acpi_table_header *table; 314 + struct acpi_table_desc *fadt_desc; 315 + acpi_status status; 314 316 315 317 /* 316 318 * The FADT has multiple versions with different lengths, ··· 321 319 * Get a local copy of the FADT and convert it to a common format 322 320 * Map entire FADT, assumed to be smaller than one page. 323 321 */ 324 - length = acpi_gbl_root_table_list.tables[acpi_gbl_fadt_index].length; 325 - 326 - table = 327 - acpi_os_map_memory(acpi_gbl_root_table_list. 328 - tables[acpi_gbl_fadt_index].address, length); 329 - if (!table) { 322 + fadt_desc = &acpi_gbl_root_table_list.tables[acpi_gbl_fadt_index]; 323 + status = acpi_tb_get_table(fadt_desc, &table); 324 + if (ACPI_FAILURE(status)) { 330 325 return; 331 326 } 327 + length = fadt_desc->length; 332 328 333 329 /* 334 330 * Validate the FADT checksum before we copy the table. Ignore ··· 340 340 341 341 /* All done with the real FADT, unmap it */ 342 342 343 - acpi_os_unmap_memory(table, length); 343 + acpi_tb_put_table(fadt_desc); 344 344 345 345 /* Obtain the DSDT and FACS tables via their addresses within the FADT */ 346 346
+85
drivers/acpi/acpica/tbutils.c
··· 381 381 acpi_os_unmap_memory(table, length); 382 382 return_ACPI_STATUS(AE_OK); 383 383 } 384 + 385 + /******************************************************************************* 386 + * 387 + * FUNCTION: acpi_tb_get_table 388 + * 389 + * PARAMETERS: table_desc - Table descriptor 390 + * out_table - Where the pointer to the table is returned 391 + * 392 + * RETURN: Status and pointer to the requested table 393 + * 394 + * DESCRIPTION: Increase a reference to a table descriptor and return the 395 + * validated table pointer. 396 + * If the table descriptor is an entry of the root table list, 397 + * this API must be invoked with ACPI_MTX_TABLES acquired. 398 + * 399 + ******************************************************************************/ 400 + 401 + acpi_status 402 + acpi_tb_get_table(struct acpi_table_desc *table_desc, 403 + struct acpi_table_header **out_table) 404 + { 405 + acpi_status status; 406 + 407 + ACPI_FUNCTION_TRACE(acpi_tb_get_table); 408 + 409 + if (table_desc->validation_count == 0) { 410 + 411 + /* Table need to be "VALIDATED" */ 412 + 413 + status = acpi_tb_validate_table(table_desc); 414 + if (ACPI_FAILURE(status)) { 415 + return_ACPI_STATUS(status); 416 + } 417 + } 418 + 419 + table_desc->validation_count++; 420 + if (table_desc->validation_count == 0) { 421 + ACPI_ERROR((AE_INFO, 422 + "Table %p, Validation count is zero after increment\n", 423 + table_desc)); 424 + table_desc->validation_count--; 425 + return_ACPI_STATUS(AE_LIMIT); 426 + } 427 + 428 + *out_table = table_desc->pointer; 429 + return_ACPI_STATUS(AE_OK); 430 + } 431 + 432 + /******************************************************************************* 433 + * 434 + * FUNCTION: acpi_tb_put_table 435 + * 436 + * PARAMETERS: table_desc - Table descriptor 437 + * 438 + * RETURN: None 439 + * 440 + * DESCRIPTION: Decrease a reference to a table descriptor and release the 441 + * validated table pointer if no references. 442 + * If the table descriptor is an entry of the root table list, 443 + * this API must be invoked with ACPI_MTX_TABLES acquired. 444 + * 445 + ******************************************************************************/ 446 + 447 + void acpi_tb_put_table(struct acpi_table_desc *table_desc) 448 + { 449 + 450 + ACPI_FUNCTION_TRACE(acpi_tb_put_table); 451 + 452 + if (table_desc->validation_count == 0) { 453 + ACPI_WARNING((AE_INFO, 454 + "Table %p, Validation count is zero before decrement\n", 455 + table_desc)); 456 + return_VOID; 457 + } 458 + table_desc->validation_count--; 459 + 460 + if (table_desc->validation_count == 0) { 461 + 462 + /* Table need to be "INVALIDATED" */ 463 + 464 + acpi_tb_invalidate_table(table_desc); 465 + } 466 + 467 + return_VOID; 468 + }
+86 -52
drivers/acpi/acpica/tbxface.c
··· 282 282 283 283 /******************************************************************************* 284 284 * 285 - * FUNCTION: acpi_get_table_with_size 285 + * FUNCTION: acpi_get_table 286 286 * 287 287 * PARAMETERS: signature - ACPI signature of needed table 288 288 * instance - Which instance (for SSDTs) ··· 292 292 * 293 293 * DESCRIPTION: Finds and verifies an ACPI table. Table must be in the 294 294 * RSDT/XSDT. 295 + * Note that an early stage acpi_get_table() call must be paired 296 + * with an early stage acpi_put_table() call. otherwise the table 297 + * pointer mapped by the early stage mapping implementation may be 298 + * erroneously unmapped by the late stage unmapping implementation 299 + * in an acpi_put_table() invoked during the late stage. 295 300 * 296 301 ******************************************************************************/ 297 302 acpi_status 298 - acpi_get_table_with_size(char *signature, 299 - u32 instance, struct acpi_table_header **out_table, 300 - acpi_size *tbl_size) 303 + acpi_get_table(char *signature, 304 + u32 instance, struct acpi_table_header ** out_table) 301 305 { 302 306 u32 i; 303 307 u32 j; 304 - acpi_status status; 308 + acpi_status status = AE_NOT_FOUND; 309 + struct acpi_table_desc *table_desc; 305 310 306 311 /* Parameter validation */ 307 312 ··· 314 309 return (AE_BAD_PARAMETER); 315 310 } 316 311 312 + /* 313 + * Note that the following line is required by some OSPMs, they only 314 + * check if the returned table is NULL instead of the returned status 315 + * to determined if this function is succeeded. 316 + */ 317 + *out_table = NULL; 318 + 319 + (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); 320 + 317 321 /* Walk the root table list */ 318 322 319 323 for (i = 0, j = 0; i < acpi_gbl_root_table_list.current_table_count; 320 324 i++) { 321 - if (!ACPI_COMPARE_NAME 322 - (&(acpi_gbl_root_table_list.tables[i].signature), 323 - signature)) { 325 + table_desc = &acpi_gbl_root_table_list.tables[i]; 326 + 327 + if (!ACPI_COMPARE_NAME(&table_desc->signature, signature)) { 324 328 continue; 325 329 } 326 330 ··· 337 323 continue; 338 324 } 339 325 340 - status = 341 - acpi_tb_validate_table(&acpi_gbl_root_table_list.tables[i]); 342 - if (ACPI_SUCCESS(status)) { 343 - *out_table = acpi_gbl_root_table_list.tables[i].pointer; 344 - *tbl_size = acpi_gbl_root_table_list.tables[i].length; 345 - } 346 - 347 - if (!acpi_gbl_permanent_mmap) { 348 - acpi_gbl_root_table_list.tables[i].pointer = NULL; 349 - } 350 - 351 - return (status); 326 + status = acpi_tb_get_table(table_desc, out_table); 327 + break; 352 328 } 353 329 354 - return (AE_NOT_FOUND); 355 - } 356 - 357 - ACPI_EXPORT_SYMBOL(acpi_get_table_with_size) 358 - 359 - acpi_status 360 - acpi_get_table(char *signature, 361 - u32 instance, struct acpi_table_header **out_table) 362 - { 363 - acpi_size tbl_size; 364 - 365 - return acpi_get_table_with_size(signature, 366 - instance, out_table, &tbl_size); 330 + (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 331 + return (status); 367 332 } 368 333 369 334 ACPI_EXPORT_SYMBOL(acpi_get_table) 370 335 371 336 /******************************************************************************* 372 337 * 338 + * FUNCTION: acpi_put_table 339 + * 340 + * PARAMETERS: table - The pointer to the table 341 + * 342 + * RETURN: None 343 + * 344 + * DESCRIPTION: Release a table returned by acpi_get_table() and its clones. 345 + * Note that it is not safe if this function was invoked after an 346 + * uninstallation happened to the original table descriptor. 347 + * Currently there is no OSPMs' requirement to handle such 348 + * situations. 349 + * 350 + ******************************************************************************/ 351 + void acpi_put_table(struct acpi_table_header *table) 352 + { 353 + u32 i; 354 + struct acpi_table_desc *table_desc; 355 + 356 + ACPI_FUNCTION_TRACE(acpi_put_table); 357 + 358 + (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); 359 + 360 + /* Walk the root table list */ 361 + 362 + for (i = 0; i < acpi_gbl_root_table_list.current_table_count; i++) { 363 + table_desc = &acpi_gbl_root_table_list.tables[i]; 364 + 365 + if (table_desc->pointer != table) { 366 + continue; 367 + } 368 + 369 + acpi_tb_put_table(table_desc); 370 + break; 371 + } 372 + 373 + (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 374 + return_VOID; 375 + } 376 + 377 + ACPI_EXPORT_SYMBOL(acpi_put_table) 378 + 379 + /******************************************************************************* 380 + * 373 381 * FUNCTION: acpi_get_table_by_index 374 382 * 375 383 * PARAMETERS: table_index - Table index 376 - * table - Where the pointer to the table is returned 384 + * out_table - Where the pointer to the table is returned 377 385 * 378 386 * RETURN: Status and pointer to the requested table 379 387 * ··· 404 368 * 405 369 ******************************************************************************/ 406 370 acpi_status 407 - acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table) 371 + acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table) 408 372 { 409 373 acpi_status status; 410 374 ··· 412 376 413 377 /* Parameter validation */ 414 378 415 - if (!table) { 379 + if (!out_table) { 416 380 return_ACPI_STATUS(AE_BAD_PARAMETER); 417 381 } 382 + 383 + /* 384 + * Note that the following line is required by some OSPMs, they only 385 + * check if the returned table is NULL instead of the returned status 386 + * to determined if this function is succeeded. 387 + */ 388 + *out_table = NULL; 418 389 419 390 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); 420 391 421 392 /* Validate index */ 422 393 423 394 if (table_index >= acpi_gbl_root_table_list.current_table_count) { 424 - (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 425 - return_ACPI_STATUS(AE_BAD_PARAMETER); 395 + status = AE_BAD_PARAMETER; 396 + goto unlock_and_exit; 426 397 } 427 398 428 - if (!acpi_gbl_root_table_list.tables[table_index].pointer) { 399 + status = 400 + acpi_tb_get_table(&acpi_gbl_root_table_list.tables[table_index], 401 + out_table); 429 402 430 - /* Table is not mapped, map it */ 431 - 432 - status = 433 - acpi_tb_validate_table(&acpi_gbl_root_table_list. 434 - tables[table_index]); 435 - if (ACPI_FAILURE(status)) { 436 - (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 437 - return_ACPI_STATUS(status); 438 - } 439 - } 440 - 441 - *table = acpi_gbl_root_table_list.tables[table_index].pointer; 403 + unlock_and_exit: 442 404 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 443 - return_ACPI_STATUS(AE_OK); 405 + return_ACPI_STATUS(status); 444 406 } 445 407 446 408 ACPI_EXPORT_SYMBOL(acpi_get_table_by_index)
+1 -1
drivers/acpi/bus.c
··· 974 974 if (!acpi_strict) 975 975 acpi_gbl_enable_interpreter_slack = TRUE; 976 976 977 - acpi_gbl_permanent_mmap = 1; 977 + acpi_permanent_mmap = true; 978 978 979 979 /* 980 980 * If the machine falls into the DMI check table,
+2 -1
drivers/acpi/nfit/core.c
··· 2806 2806 acpi_size sz; 2807 2807 int rc = 0; 2808 2808 2809 - status = acpi_get_table_with_size(ACPI_SIG_NFIT, 0, &tbl, &sz); 2809 + status = acpi_get_table(ACPI_SIG_NFIT, 0, &tbl); 2810 2810 if (ACPI_FAILURE(status)) { 2811 2811 /* This is ok, we could have an nvdimm hotplugged later */ 2812 2812 dev_dbg(dev, "failed to find NFIT at startup\n"); 2813 2813 return 0; 2814 2814 } 2815 + sz = tbl->length; 2815 2816 2816 2817 acpi_desc = devm_kzalloc(dev, sizeof(*acpi_desc), GFP_KERNEL); 2817 2818 if (!acpi_desc)
+5 -10
drivers/acpi/osl.c
··· 76 76 static struct workqueue_struct *kacpi_hotplug_wq; 77 77 static bool acpi_os_initialized; 78 78 unsigned int acpi_sci_irq = INVALID_ACPI_IRQ; 79 + bool acpi_permanent_mmap = false; 79 80 80 81 /* 81 82 * This list of permanent mappings is for memory that may be accessed from ··· 307 306 * virtual address). If not found, map it, add it to that list and return a 308 307 * pointer to it. 309 308 * 310 - * During early init (when acpi_gbl_permanent_mmap has not been set yet) this 309 + * During early init (when acpi_permanent_mmap has not been set yet) this 311 310 * routine simply calls __acpi_map_table() to get the job done. 312 311 */ 313 312 void __iomem *__ref ··· 323 322 return NULL; 324 323 } 325 324 326 - if (!acpi_gbl_permanent_mmap) 325 + if (!acpi_permanent_mmap) 327 326 return __acpi_map_table((unsigned long)phys, size); 328 327 329 328 mutex_lock(&acpi_ioremap_lock); ··· 393 392 * mappings, drop a reference to it and unmap it if there are no more active 394 393 * references to it. 395 394 * 396 - * During early init (when acpi_gbl_permanent_mmap has not been set yet) this 395 + * During early init (when acpi_permanent_mmap has not been set yet) this 397 396 * routine simply calls __acpi_unmap_table() to get the job done. Since 398 397 * __acpi_unmap_table() is an __init function, the __ref annotation is needed 399 398 * here. ··· 402 401 { 403 402 struct acpi_ioremap *map; 404 403 405 - if (!acpi_gbl_permanent_mmap) { 404 + if (!acpi_permanent_mmap) { 406 405 __acpi_unmap_table(virt, size); 407 406 return; 408 407 } ··· 426 425 return acpi_os_unmap_iomem((void __iomem *)virt, size); 427 426 } 428 427 EXPORT_SYMBOL_GPL(acpi_os_unmap_memory); 429 - 430 - void __init early_acpi_os_unmap_memory(void __iomem *virt, acpi_size size) 431 - { 432 - if (!acpi_gbl_permanent_mmap) 433 - __acpi_unmap_table(virt, size); 434 - } 435 428 436 429 int acpi_os_map_generic_address(struct acpi_generic_address *gas) 437 430 {
+3 -5
drivers/acpi/processor_core.c
··· 154 154 phys_cpuid_t __init acpi_map_madt_entry(u32 acpi_id) 155 155 { 156 156 struct acpi_table_madt *madt = NULL; 157 - acpi_size tbl_size; 158 157 phys_cpuid_t rv; 159 158 160 - acpi_get_table_with_size(ACPI_SIG_MADT, 0, 161 - (struct acpi_table_header **)&madt, 162 - &tbl_size); 159 + acpi_get_table(ACPI_SIG_MADT, 0, 160 + (struct acpi_table_header **)&madt); 163 161 if (!madt) 164 162 return PHYS_CPUID_INVALID; 165 163 166 164 rv = map_madt_entry(madt, 1, acpi_id, true); 167 165 168 - early_acpi_os_unmap_memory(madt, tbl_size); 166 + acpi_put_table((struct acpi_table_header *)madt); 169 167 170 168 return rv; 171 169 }
-3
drivers/acpi/scan.c
··· 1120 1120 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight " 1121 1121 "support\n")); 1122 1122 *cap |= ACPI_VIDEO_BACKLIGHT; 1123 - if (!acpi_has_method(handle, "_BQC")) 1124 - printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, " 1125 - "cannot determine initial brightness\n"); 1126 1123 /* We have backlight support, no need to scan further */ 1127 1124 return AE_CTRL_TERMINATE; 1128 1125 }
+3 -5
drivers/acpi/spcr.c
··· 33 33 { 34 34 static char opts[64]; 35 35 struct acpi_table_spcr *table; 36 - acpi_size table_size; 37 36 acpi_status status; 38 37 char *uart; 39 38 char *iotype; ··· 42 43 if (acpi_disabled) 43 44 return -ENODEV; 44 45 45 - status = acpi_get_table_with_size(ACPI_SIG_SPCR, 0, 46 - (struct acpi_table_header **)&table, 47 - &table_size); 46 + status = acpi_get_table(ACPI_SIG_SPCR, 0, 47 + (struct acpi_table_header **)&table); 48 48 49 49 if (ACPI_FAILURE(status)) 50 50 return -ENOENT; ··· 104 106 err = add_preferred_console(uart, 0, opts + strlen(uart) + 1); 105 107 106 108 done: 107 - early_acpi_os_unmap_memory((void __iomem *)table, table_size); 109 + acpi_put_table((struct acpi_table_header *)table); 108 110 return err; 109 111 }
+7 -10
drivers/acpi/tables.c
··· 333 333 unsigned int max_entries) 334 334 { 335 335 struct acpi_table_header *table_header = NULL; 336 - acpi_size tbl_size; 337 336 int count; 338 337 u32 instance = 0; 339 338 ··· 345 346 if (!strncmp(id, ACPI_SIG_MADT, 4)) 346 347 instance = acpi_apic_instance; 347 348 348 - acpi_get_table_with_size(id, instance, &table_header, &tbl_size); 349 + acpi_get_table(id, instance, &table_header); 349 350 if (!table_header) { 350 351 pr_warn("%4.4s not present\n", id); 351 352 return -ENODEV; ··· 354 355 count = acpi_parse_entries_array(id, table_size, table_header, 355 356 proc, proc_num, max_entries); 356 357 357 - early_acpi_os_unmap_memory((char *)table_header, tbl_size); 358 + acpi_put_table(table_header); 358 359 return count; 359 360 } 360 361 ··· 396 397 int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler) 397 398 { 398 399 struct acpi_table_header *table = NULL; 399 - acpi_size tbl_size; 400 400 401 401 if (acpi_disabled) 402 402 return -ENODEV; ··· 404 406 return -EINVAL; 405 407 406 408 if (strncmp(id, ACPI_SIG_MADT, 4) == 0) 407 - acpi_get_table_with_size(id, acpi_apic_instance, &table, &tbl_size); 409 + acpi_get_table(id, acpi_apic_instance, &table); 408 410 else 409 - acpi_get_table_with_size(id, 0, &table, &tbl_size); 411 + acpi_get_table(id, 0, &table); 410 412 411 413 if (table) { 412 414 handler(table); 413 - early_acpi_os_unmap_memory(table, tbl_size); 415 + acpi_put_table(table); 414 416 return 0; 415 417 } else 416 418 return -ENODEV; ··· 424 426 static void __init check_multiple_madt(void) 425 427 { 426 428 struct acpi_table_header *table = NULL; 427 - acpi_size tbl_size; 428 429 429 - acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size); 430 + acpi_get_table(ACPI_SIG_MADT, 2, &table); 430 431 if (table) { 431 432 pr_warn("BIOS bug: multiple APIC/MADT found, using %d\n", 432 433 acpi_apic_instance); 433 434 pr_warn("If \"acpi_apic_instance=%d\" works better, " 434 435 "notify linux-acpi@vger.kernel.org\n", 435 436 acpi_apic_instance ? 0 : 2); 436 - early_acpi_os_unmap_memory(table, tbl_size); 437 + acpi_put_table(table); 437 438 438 439 } else 439 440 acpi_apic_instance = 0;
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
··· 305 305 GOP_VBIOS_CONTENT *vbios; 306 306 VFCT_IMAGE_HEADER *vhdr; 307 307 308 - if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size))) 308 + if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr))) 309 309 return false; 310 + tbl_size = hdr->length; 310 311 if (tbl_size < sizeof(UEFI_ACPI_VFCT)) { 311 312 DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n"); 312 313 goto out_unmap;
+2 -1
drivers/gpu/drm/radeon/radeon_bios.c
··· 603 603 GOP_VBIOS_CONTENT *vbios; 604 604 VFCT_IMAGE_HEADER *vhdr; 605 605 606 - if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size))) 606 + if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr))) 607 607 return false; 608 + tbl_size = hdr->length; 608 609 if (tbl_size < sizeof(UEFI_ACPI_VFCT)) { 609 610 DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n"); 610 611 goto out_unmap;
+4 -6
drivers/iommu/amd_iommu_init.c
··· 2209 2209 static int __init early_amd_iommu_init(void) 2210 2210 { 2211 2211 struct acpi_table_header *ivrs_base; 2212 - acpi_size ivrs_size; 2213 2212 acpi_status status; 2214 2213 int i, remap_cache_sz, ret = 0; 2215 2214 2216 2215 if (!amd_iommu_detected) 2217 2216 return -ENODEV; 2218 2217 2219 - status = acpi_get_table_with_size("IVRS", 0, &ivrs_base, &ivrs_size); 2218 + status = acpi_get_table("IVRS", 0, &ivrs_base); 2220 2219 if (status == AE_NOT_FOUND) 2221 2220 return -ENODEV; 2222 2221 else if (ACPI_FAILURE(status)) { ··· 2337 2338 2338 2339 out: 2339 2340 /* Don't leak any ACPI memory */ 2340 - early_acpi_os_unmap_memory((char __iomem *)ivrs_base, ivrs_size); 2341 + acpi_put_table(ivrs_base); 2341 2342 ivrs_base = NULL; 2342 2343 2343 2344 return ret; ··· 2361 2362 static bool detect_ivrs(void) 2362 2363 { 2363 2364 struct acpi_table_header *ivrs_base; 2364 - acpi_size ivrs_size; 2365 2365 acpi_status status; 2366 2366 2367 - status = acpi_get_table_with_size("IVRS", 0, &ivrs_base, &ivrs_size); 2367 + status = acpi_get_table("IVRS", 0, &ivrs_base); 2368 2368 if (status == AE_NOT_FOUND) 2369 2369 return false; 2370 2370 else if (ACPI_FAILURE(status)) { ··· 2372 2374 return false; 2373 2375 } 2374 2376 2375 - early_acpi_os_unmap_memory((char __iomem *)ivrs_base, ivrs_size); 2377 + acpi_put_table(ivrs_base); 2376 2378 2377 2379 /* Make sure ACS will be enabled during PCI probe */ 2378 2380 pci_request_acs();
+2 -5
drivers/iommu/dmar.c
··· 68 68 LIST_HEAD(dmar_drhd_units); 69 69 70 70 struct acpi_table_header * __initdata dmar_tbl; 71 - static acpi_size dmar_tbl_size; 72 71 static int dmar_dev_scope_status = 1; 73 72 static unsigned long dmar_seq_ids[BITS_TO_LONGS(DMAR_UNITS_SUPPORTED)]; 74 73 ··· 542 543 acpi_status status = AE_OK; 543 544 544 545 /* if we could find DMAR table, then there are DMAR devices */ 545 - status = acpi_get_table_with_size(ACPI_SIG_DMAR, 0, 546 - (struct acpi_table_header **)&dmar_tbl, 547 - &dmar_tbl_size); 546 + status = acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_tbl); 548 547 549 548 if (ACPI_SUCCESS(status) && !dmar_tbl) { 550 549 pr_warn("Unable to map DMAR\n"); ··· 903 906 x86_init.iommu.iommu_init = intel_iommu_init; 904 907 #endif 905 908 906 - early_acpi_os_unmap_memory((void __iomem *)dmar_tbl, dmar_tbl_size); 909 + acpi_put_table(dmar_tbl); 907 910 dmar_tbl = NULL; 908 911 up_write(&dmar_global_lock); 909 912
+1 -4
drivers/mailbox/pcc.c
··· 447 447 */ 448 448 static int __init acpi_pcc_probe(void) 449 449 { 450 - acpi_size pcct_tbl_header_size; 451 450 struct acpi_table_header *pcct_tbl; 452 451 struct acpi_subtable_header *pcct_entry; 453 452 struct acpi_table_pcct *acpi_pcct_tbl; ··· 455 456 acpi_status status = AE_OK; 456 457 457 458 /* Search for PCCT */ 458 - status = acpi_get_table_with_size(ACPI_SIG_PCCT, 0, 459 - &pcct_tbl, 460 - &pcct_tbl_header_size); 459 + status = acpi_get_table(ACPI_SIG_PCCT, 0, &pcct_tbl); 461 460 462 461 if (ACPI_FAILURE(status) || !pcct_tbl) { 463 462 pr_warn("PCCT header not found.\n");
+2
include/acpi/acpi_io.h
··· 13 13 } 14 14 #endif 15 15 16 + extern bool acpi_permanent_mmap; 17 + 16 18 void __iomem *__ref 17 19 acpi_os_map_iomem(acpi_physical_address phys, acpi_size size); 18 20 void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size);
+5 -12
include/acpi/acpixf.h
··· 513 513 acpi_get_table(acpi_string signature, u32 instance, 514 514 struct acpi_table_header 515 515 **out_table)) 516 + ACPI_EXTERNAL_RETURN_VOID(void acpi_put_table(struct acpi_table_header *table)) 517 + 516 518 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 517 - acpi_get_table_by_index(u32 table_index, 518 - struct acpi_table_header 519 - **out_table)) 519 + acpi_get_table_by_index(u32 table_index, 520 + struct acpi_table_header 521 + **out_table)) 520 522 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 521 523 acpi_install_table_handler(acpi_table_handler 522 524 handler, void *context)) ··· 967 965 /* 968 966 * Divergences 969 967 */ 970 - ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap); 971 - 972 - ACPI_EXTERNAL_RETURN_STATUS(acpi_status 973 - acpi_get_table_with_size(acpi_string signature, 974 - u32 instance, 975 - struct acpi_table_header 976 - **out_table, 977 - acpi_size *tbl_size)) 978 - 979 968 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 980 969 acpi_get_data_full(acpi_handle object, 981 970 acpi_object_handler handler,
+1
include/acpi/actbl.h
··· 371 371 union acpi_name_union signature; 372 372 acpi_owner_id owner_id; 373 373 u8 flags; 374 + u16 validation_count; 374 375 }; 375 376 376 377 /* Masks for Flags field above */
-1
include/acpi/platform/aclinuxex.h
··· 142 142 /* 143 143 * OSL interfaces added by Linux 144 144 */ 145 - void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size); 146 145 147 146 #endif /* __KERNEL__ */ 148 147