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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'acpi-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
"Revert a recent ACPICA commit that introduced a suspend-to-RAM
regression on one system due to incorrect information in its ACPI
tables that had not been taken into consideration at all before (and
everything worked), but the commit in question started to use it"

* tag 'acpi-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
Revert "ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for acpi_hw_write()"

+8 -136
+8 -136
drivers/acpi/acpica/hwregs.c
··· 306 306 acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg) 307 307 { 308 308 u64 address; 309 - u8 access_width; 310 - u32 bit_width; 311 - u8 bit_offset; 312 - u64 value64; 313 - u32 new_value32, old_value32; 314 - u8 index; 315 309 acpi_status status; 316 310 317 311 ACPI_FUNCTION_NAME(hw_write); ··· 317 323 return (status); 318 324 } 319 325 320 - /* Convert access_width into number of bits based */ 321 - 322 - access_width = acpi_hw_get_access_bit_width(reg, 32); 323 - bit_width = reg->bit_offset + reg->bit_width; 324 - bit_offset = reg->bit_offset; 325 - 326 326 /* 327 327 * Two address spaces supported: Memory or IO. PCI_Config is 328 328 * not supported here because the GAS structure is insufficient 329 329 */ 330 - index = 0; 331 - while (bit_width) { 332 - /* 333 - * Use offset style bit reads because "Index * AccessWidth" is 334 - * ensured to be less than 32-bits by acpi_hw_validate_register(). 335 - */ 336 - new_value32 = ACPI_GET_BITS(&value, index * access_width, 337 - ACPI_MASK_BITS_ABOVE_32 338 - (access_width)); 330 + if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 331 + status = acpi_os_write_memory((acpi_physical_address) 332 + address, (u64)value, 333 + reg->bit_width); 334 + } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ 339 335 340 - if (bit_offset >= access_width) { 341 - bit_offset -= access_width; 342 - } else { 343 - /* 344 - * Use offset style bit masks because access_width is ensured 345 - * to be less than 32-bits by acpi_hw_validate_register() and 346 - * bit_offset/bit_width is less than access_width here. 347 - */ 348 - if (bit_offset) { 349 - new_value32 &= ACPI_MASK_BITS_BELOW(bit_offset); 350 - } 351 - if (bit_width < access_width) { 352 - new_value32 &= ACPI_MASK_BITS_ABOVE(bit_width); 353 - } 354 - 355 - if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 356 - if (bit_offset || bit_width < access_width) { 357 - /* 358 - * Read old values in order not to modify the bits that 359 - * are beyond the register bit_width/bit_offset setting. 360 - */ 361 - status = 362 - acpi_os_read_memory((acpi_physical_address) 363 - address + 364 - index * 365 - ACPI_DIV_8 366 - (access_width), 367 - &value64, 368 - access_width); 369 - old_value32 = (u32)value64; 370 - 371 - /* 372 - * Use offset style bit masks because access_width is 373 - * ensured to be less than 32-bits by 374 - * acpi_hw_validate_register() and bit_offset/bit_width is 375 - * less than access_width here. 376 - */ 377 - if (bit_offset) { 378 - old_value32 &= 379 - ACPI_MASK_BITS_ABOVE 380 - (bit_offset); 381 - bit_offset = 0; 382 - } 383 - if (bit_width < access_width) { 384 - old_value32 &= 385 - ACPI_MASK_BITS_BELOW 386 - (bit_width); 387 - } 388 - 389 - new_value32 |= old_value32; 390 - } 391 - 392 - value64 = (u64)new_value32; 393 - status = 394 - acpi_os_write_memory((acpi_physical_address) 395 - address + 396 - index * 397 - ACPI_DIV_8 398 - (access_width), 399 - value64, access_width); 400 - } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ 401 - 402 - if (bit_offset || bit_width < access_width) { 403 - /* 404 - * Read old values in order not to modify the bits that 405 - * are beyond the register bit_width/bit_offset setting. 406 - */ 407 - status = 408 - acpi_hw_read_port((acpi_io_address) 409 - address + 410 - index * 411 - ACPI_DIV_8 412 - (access_width), 413 - &old_value32, 414 - access_width); 415 - 416 - /* 417 - * Use offset style bit masks because access_width is 418 - * ensured to be less than 32-bits by 419 - * acpi_hw_validate_register() and bit_offset/bit_width is 420 - * less than access_width here. 421 - */ 422 - if (bit_offset) { 423 - old_value32 &= 424 - ACPI_MASK_BITS_ABOVE 425 - (bit_offset); 426 - bit_offset = 0; 427 - } 428 - if (bit_width < access_width) { 429 - old_value32 &= 430 - ACPI_MASK_BITS_BELOW 431 - (bit_width); 432 - } 433 - 434 - new_value32 |= old_value32; 435 - } 436 - 437 - status = acpi_hw_write_port((acpi_io_address) 438 - address + 439 - index * 440 - ACPI_DIV_8 441 - (access_width), 442 - new_value32, 443 - access_width); 444 - } 445 - } 446 - 447 - /* 448 - * Index * access_width is ensured to be less than 32-bits by 449 - * acpi_hw_validate_register(). 450 - */ 451 - bit_width -= 452 - bit_width > access_width ? access_width : bit_width; 453 - index++; 336 + status = acpi_hw_write_port((acpi_io_address) 337 + address, value, reg->bit_width); 454 338 } 455 339 456 340 ACPI_DEBUG_PRINT((ACPI_DB_IO, 457 341 "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", 458 - value, access_width, ACPI_FORMAT_UINT64(address), 342 + value, reg->bit_width, ACPI_FORMAT_UINT64(address), 459 343 acpi_ut_get_region_name(reg->space_id))); 460 344 461 345 return (status);