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-extra-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more ACPI updates from Rafael Wysocki:
"These fix the ACPI SPCR table handling and add a workaround for APM
X-Gene 8250 UART on top of that, fix two ACPI hotplug issues related
to hot-remove failures, add a missing "static" to one function and
constify some attribute_group structures.

Specifics:

- Fix the ACPI code handling the SPCR table to check access width of
MMIO regions and add a workaround for APM X-Gene 8250 UART to use
32-bit MMIO accesses with its register (Loc Ho).

- Fix two ACPI-based hotplug issues related to the handling of
hot-remove failures on the OS side (Chun-Yi Lee).

- Constify attribute_group structures in a few places (Arvind Yadav).

- Make one local function static (Colin Ian King)"

* tag 'acpi-extra-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / DPTF: constify attribute_group structures
ACPI / LPSS: constify attribute_group structures
ACPI: BGRT: constify attribute_group structures
ACPI / power: constify attribute_group structures
ACPI / scan: Indicate to platform when hot remove returns busy
ACPI / bus: handle ACPI hotplug schedule errors completely
ACPI / osi: Make local function acpi_osi_dmi_linux() static
ACPI: SPCR: Workaround for APM X-Gene 8250 UART 32-alignment errata
ACPI: SPCR: Use access width to determine mmio usage

+74 -18
+1 -1
drivers/acpi/acpi_lpss.c
··· 576 576 NULL, 577 577 }; 578 578 579 - static struct attribute_group lpss_attr_group = { 579 + static const struct attribute_group lpss_attr_group = { 580 580 .attrs = lpss_attrs, 581 581 .name = "lpss_ltr", 582 582 };
+1 -1
drivers/acpi/bgrt.c
··· 76 76 NULL, 77 77 }; 78 78 79 - static struct attribute_group bgrt_attribute_group = { 79 + static const struct attribute_group bgrt_attribute_group = { 80 80 .attrs = bgrt_attributes, 81 81 .bin_attrs = bgrt_bin_attributes, 82 82 };
+6 -2
drivers/acpi/bus.c
··· 409 409 (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS)) 410 410 driver->ops.notify(adev, type); 411 411 412 - if (hotplug_event && ACPI_SUCCESS(acpi_hotplug_schedule(adev, type))) 412 + if (!hotplug_event) { 413 + acpi_bus_put_acpi_device(adev); 414 + return; 415 + } 416 + 417 + if (ACPI_SUCCESS(acpi_hotplug_schedule(adev, type))) 413 418 return; 414 419 415 420 acpi_bus_put_acpi_device(adev); 416 - return; 417 421 418 422 err: 419 423 acpi_evaluate_ost(handle, type, ost_code, NULL);
+1 -1
drivers/acpi/dptf/dptf_power.c
··· 65 65 NULL 66 66 }; 67 67 68 - static struct attribute_group dptf_power_attribute_group = { 68 + static const struct attribute_group dptf_power_attribute_group = { 69 69 .attrs = dptf_power_attrs, 70 70 .name = "dptf_power" 71 71 };
+2 -1
drivers/acpi/osi.c
··· 265 265 __acpi_osi_setup_darwin(enable); 266 266 } 267 267 268 - void __init acpi_osi_dmi_linux(bool enable, const struct dmi_system_id *d) 268 + static void __init acpi_osi_dmi_linux(bool enable, 269 + const struct dmi_system_id *d) 269 270 { 270 271 pr_notice("DMI detected to setup _OSI(\"Linux\"): %s\n", d->ident); 271 272 osi_config.linux_dmi = 1;
+5 -5
drivers/acpi/power.c
··· 352 352 NULL, 353 353 }; 354 354 355 - static struct attribute_group attr_groups[] = { 355 + static const struct attribute_group attr_groups[] = { 356 356 [ACPI_STATE_D0] = { 357 357 .name = "power_resources_D0", 358 358 .attrs = attrs, ··· 371 371 }, 372 372 }; 373 373 374 - static struct attribute_group wakeup_attr_group = { 374 + static const struct attribute_group wakeup_attr_group = { 375 375 .name = "power_resources_wakeup", 376 376 .attrs = attrs, 377 377 }; 378 378 379 379 static void acpi_power_hide_list(struct acpi_device *adev, 380 380 struct list_head *resources, 381 - struct attribute_group *attr_group) 381 + const struct attribute_group *attr_group) 382 382 { 383 383 struct acpi_power_resource_entry *entry; 384 384 ··· 397 397 398 398 static void acpi_power_expose_list(struct acpi_device *adev, 399 399 struct list_head *resources, 400 - struct attribute_group *attr_group) 400 + const struct attribute_group *attr_group) 401 401 { 402 402 struct acpi_power_resource_entry *entry; 403 403 int ret; ··· 425 425 426 426 static void acpi_power_expose_hide(struct acpi_device *adev, 427 427 struct list_head *resources, 428 - struct attribute_group *attr_group, 428 + const struct attribute_group *attr_group, 429 429 bool expose) 430 430 { 431 431 if (expose)
+13 -5
drivers/acpi/scan.c
··· 404 404 error = dock_notify(adev, src); 405 405 } else if (adev->flags.hotplug_notify) { 406 406 error = acpi_generic_hotplug_event(adev, src); 407 - if (error == -EPERM) { 408 - ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; 409 - goto err_out; 410 - } 411 407 } else { 412 408 int (*notify)(struct acpi_device *, u32); 413 409 ··· 419 423 else 420 424 goto out; 421 425 } 422 - if (!error) 426 + switch (error) { 427 + case 0: 423 428 ost_code = ACPI_OST_SC_SUCCESS; 429 + break; 430 + case -EPERM: 431 + ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; 432 + break; 433 + case -EBUSY: 434 + ost_code = ACPI_OST_SC_DEVICE_BUSY; 435 + break; 436 + default: 437 + ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; 438 + break; 439 + } 424 440 425 441 err_out: 426 442 acpi_evaluate_ost(adev->handle, src, ost_code, NULL);
+38 -2
drivers/acpi/spcr.c
··· 36 36 return false; 37 37 } 38 38 39 + /* 40 + * APM X-Gene v1 and v2 UART hardware is an 16550 like device but has its 41 + * register aligned to 32-bit. In addition, the BIOS also encoded the 42 + * access width to be 8 bits. This function detects this errata condition. 43 + */ 44 + static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb) 45 + { 46 + if (tb->interface_type != ACPI_DBG2_16550_COMPATIBLE) 47 + return false; 48 + 49 + if (memcmp(tb->header.oem_id, "APMC0D", ACPI_OEM_ID_SIZE)) 50 + return false; 51 + 52 + if (!memcmp(tb->header.oem_table_id, "XGENESPC", 53 + ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 0) 54 + return true; 55 + 56 + return false; 57 + } 58 + 39 59 /** 40 60 * parse_spcr() - parse ACPI SPCR table and add preferred console 41 61 * ··· 94 74 goto done; 95 75 } 96 76 97 - iotype = table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY ? 98 - "mmio" : "io"; 77 + if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 78 + switch (table->serial_port.access_width) { 79 + default: 80 + pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n"); 81 + case ACPI_ACCESS_SIZE_BYTE: 82 + iotype = "mmio"; 83 + break; 84 + case ACPI_ACCESS_SIZE_WORD: 85 + iotype = "mmio16"; 86 + break; 87 + case ACPI_ACCESS_SIZE_DWORD: 88 + iotype = "mmio32"; 89 + break; 90 + } 91 + } else 92 + iotype = "io"; 99 93 100 94 switch (table->interface_type) { 101 95 case ACPI_DBG2_ARM_SBSA_32BIT: ··· 149 115 150 116 if (qdf2400_erratum_44_present(&table->header)) 151 117 uart = "qdf2400_e44"; 118 + if (xgene_8250_erratum_present(table)) 119 + iotype = "mmio32"; 152 120 153 121 snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype, 154 122 table->serial_port.address, baud_rate);
+7
include/acpi/acrestyp.h
··· 377 377 u64 address; 378 378 }; 379 379 380 + /* Generic Address Space Access Sizes */ 381 + #define ACPI_ACCESS_SIZE_UNDEFINED 0 382 + #define ACPI_ACCESS_SIZE_BYTE 1 383 + #define ACPI_ACCESS_SIZE_WORD 2 384 + #define ACPI_ACCESS_SIZE_DWORD 3 385 + #define ACPI_ACCESS_SIZE_QWORD 4 386 + 380 387 struct acpi_resource_gpio { 381 388 u8 revision_id; 382 389 u8 connection_type;