diff options
| -rw-r--r-- | arch/ia64/kernel/acpi.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/acpi/boot.c | 5 | ||||
| -rw-r--r-- | drivers/acpi/acpi_processor.c | 4 | ||||
| -rw-r--r-- | drivers/acpi/bus.c | 42 | ||||
| -rw-r--r-- | drivers/acpi/sleep.c | 19 | ||||
| -rw-r--r-- | drivers/i2c/i2c-core.c | 3 | ||||
| -rw-r--r-- | drivers/spi/spi.c | 4 | ||||
| -rw-r--r-- | include/acpi/acpi_bus.h | 2 | ||||
| -rw-r--r-- | include/linux/acpi.h | 3 |
9 files changed, 77 insertions, 8 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 9273e034b730..7508c306aa9e 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
| @@ -887,7 +887,8 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) | |||
| 887 | } | 887 | } |
| 888 | 888 | ||
| 889 | /* wrapper to silence section mismatch warning */ | 889 | /* wrapper to silence section mismatch warning */ |
| 890 | int __ref acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, int *pcpu) | 890 | int __ref acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id, |
| 891 | int *pcpu) | ||
| 891 | { | 892 | { |
| 892 | return _acpi_map_lsapic(handle, physid, pcpu); | 893 | return _acpi_map_lsapic(handle, physid, pcpu); |
| 893 | } | 894 | } |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 64422f850e95..04bc5f3f9aa1 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -723,11 +723,12 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | |||
| 723 | return 0; | 723 | return 0; |
| 724 | } | 724 | } |
| 725 | 725 | ||
| 726 | int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, int *pcpu) | 726 | int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id, |
| 727 | int *pcpu) | ||
| 727 | { | 728 | { |
| 728 | int cpu; | 729 | int cpu; |
| 729 | 730 | ||
| 730 | cpu = acpi_register_lapic(physid, U32_MAX, ACPI_MADT_ENABLED); | 731 | cpu = acpi_register_lapic(physid, acpi_id, ACPI_MADT_ENABLED); |
| 731 | if (cpu < 0) { | 732 | if (cpu < 0) { |
| 732 | pr_info(PREFIX "Unable to map lapic to logical cpu number\n"); | 733 | pr_info(PREFIX "Unable to map lapic to logical cpu number\n"); |
| 733 | return cpu; | 734 | return cpu; |
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 3de3b6b8f0f1..4467a8089ab8 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c | |||
| @@ -165,7 +165,7 @@ static int acpi_processor_errata(void) | |||
| 165 | 165 | ||
| 166 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 166 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
| 167 | int __weak acpi_map_cpu(acpi_handle handle, | 167 | int __weak acpi_map_cpu(acpi_handle handle, |
| 168 | phys_cpuid_t physid, int *pcpu) | 168 | phys_cpuid_t physid, u32 acpi_id, int *pcpu) |
| 169 | { | 169 | { |
| 170 | return -ENODEV; | 170 | return -ENODEV; |
| 171 | } | 171 | } |
| @@ -203,7 +203,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) | |||
| 203 | cpu_maps_update_begin(); | 203 | cpu_maps_update_begin(); |
| 204 | cpu_hotplug_begin(); | 204 | cpu_hotplug_begin(); |
| 205 | 205 | ||
| 206 | ret = acpi_map_cpu(pr->handle, pr->phys_id, &pr->id); | 206 | ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id); |
| 207 | if (ret) | 207 | if (ret) |
| 208 | goto out; | 208 | goto out; |
| 209 | 209 | ||
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 95855cb9d6fb..80cb5eb75b63 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
| @@ -677,6 +677,48 @@ static bool acpi_of_match_device(struct acpi_device *adev, | |||
| 677 | return false; | 677 | return false; |
| 678 | } | 678 | } |
| 679 | 679 | ||
| 680 | static bool acpi_of_modalias(struct acpi_device *adev, | ||
| 681 | char *modalias, size_t len) | ||
| 682 | { | ||
| 683 | const union acpi_object *of_compatible; | ||
| 684 | const union acpi_object *obj; | ||
| 685 | const char *str, *chr; | ||
| 686 | |||
| 687 | of_compatible = adev->data.of_compatible; | ||
| 688 | if (!of_compatible) | ||
| 689 | return false; | ||
| 690 | |||
| 691 | if (of_compatible->type == ACPI_TYPE_PACKAGE) | ||
| 692 | obj = of_compatible->package.elements; | ||
| 693 | else /* Must be ACPI_TYPE_STRING. */ | ||
| 694 | obj = of_compatible; | ||
| 695 | |||
| 696 | str = obj->string.pointer; | ||
| 697 | chr = strchr(str, ','); | ||
| 698 | strlcpy(modalias, chr ? chr + 1 : str, len); | ||
| 699 | |||
| 700 | return true; | ||
| 701 | } | ||
| 702 | |||
| 703 | /** | ||
| 704 | * acpi_set_modalias - Set modalias using "compatible" property or supplied ID | ||
| 705 | * @adev: ACPI device object to match | ||
| 706 | * @default_id: ID string to use as default if no compatible string found | ||
| 707 | * @modalias: Pointer to buffer that modalias value will be copied into | ||
| 708 | * @len: Length of modalias buffer | ||
| 709 | * | ||
| 710 | * This is a counterpart of of_modalias_node() for struct acpi_device objects. | ||
| 711 | * If there is a compatible string for @adev, it will be copied to @modalias | ||
| 712 | * with the vendor prefix stripped; otherwise, @default_id will be used. | ||
| 713 | */ | ||
| 714 | void acpi_set_modalias(struct acpi_device *adev, const char *default_id, | ||
| 715 | char *modalias, size_t len) | ||
| 716 | { | ||
| 717 | if (!acpi_of_modalias(adev, modalias, len)) | ||
| 718 | strlcpy(modalias, default_id, len); | ||
| 719 | } | ||
| 720 | EXPORT_SYMBOL_GPL(acpi_set_modalias); | ||
| 721 | |||
| 680 | static bool __acpi_match_device_cls(const struct acpi_device_id *id, | 722 | static bool __acpi_match_device_cls(const struct acpi_device_id *id, |
| 681 | struct acpi_hardware_id *hwid) | 723 | struct acpi_hardware_id *hwid) |
| 682 | { | 724 | { |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 54abb26b7366..a4327af676fe 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
| @@ -130,6 +130,12 @@ void __init acpi_nvs_nosave_s3(void) | |||
| 130 | nvs_nosave_s3 = true; | 130 | nvs_nosave_s3 = true; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static int __init init_nvs_save_s3(const struct dmi_system_id *d) | ||
| 134 | { | ||
| 135 | nvs_nosave_s3 = false; | ||
| 136 | return 0; | ||
| 137 | } | ||
| 138 | |||
| 133 | /* | 139 | /* |
| 134 | * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the | 140 | * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the |
| 135 | * user to request that behavior by using the 'acpi_old_suspend_ordering' | 141 | * user to request that behavior by using the 'acpi_old_suspend_ordering' |
| @@ -324,6 +330,19 @@ static struct dmi_system_id acpisleep_dmi_table[] __initdata = { | |||
| 324 | DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"), | 330 | DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"), |
| 325 | }, | 331 | }, |
| 326 | }, | 332 | }, |
| 333 | /* | ||
| 334 | * https://bugzilla.kernel.org/show_bug.cgi?id=189431 | ||
| 335 | * Lenovo G50-45 is a platform later than 2012, but needs nvs memory | ||
| 336 | * saving during S3. | ||
| 337 | */ | ||
| 338 | { | ||
| 339 | .callback = init_nvs_save_s3, | ||
| 340 | .ident = "Lenovo G50-45", | ||
| 341 | .matches = { | ||
| 342 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 343 | DMI_MATCH(DMI_PRODUCT_NAME, "80E3"), | ||
| 344 | }, | ||
| 345 | }, | ||
| 327 | {}, | 346 | {}, |
| 328 | }; | 347 | }; |
| 329 | 348 | ||
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 583e95042a21..1e52395e90a7 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
| @@ -221,7 +221,8 @@ static int i2c_acpi_get_info(struct acpi_device *adev, | |||
| 221 | 221 | ||
| 222 | acpi_dev_free_resource_list(&resource_list); | 222 | acpi_dev_free_resource_list(&resource_list); |
| 223 | 223 | ||
| 224 | strlcpy(info->type, dev_name(&adev->dev), sizeof(info->type)); | 224 | acpi_set_modalias(adev, dev_name(&adev->dev), info->type, |
| 225 | sizeof(info->type)); | ||
| 225 | 226 | ||
| 226 | return 0; | 227 | return 0; |
| 227 | } | 228 | } |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 656dd3e3220c..ad7f638a0a5b 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
| @@ -1722,13 +1722,15 @@ static acpi_status acpi_register_spi_device(struct spi_master *master, | |||
| 1722 | return AE_OK; | 1722 | return AE_OK; |
| 1723 | } | 1723 | } |
| 1724 | 1724 | ||
| 1725 | acpi_set_modalias(adev, acpi_device_hid(adev), spi->modalias, | ||
| 1726 | sizeof(spi->modalias)); | ||
| 1727 | |||
| 1725 | if (spi->irq < 0) | 1728 | if (spi->irq < 0) |
| 1726 | spi->irq = acpi_dev_gpio_irq_get(adev, 0); | 1729 | spi->irq = acpi_dev_gpio_irq_get(adev, 0); |
| 1727 | 1730 | ||
| 1728 | acpi_device_set_enumerated(adev); | 1731 | acpi_device_set_enumerated(adev); |
| 1729 | 1732 | ||
| 1730 | adev->power.flags.ignore_parent = true; | 1733 | adev->power.flags.ignore_parent = true; |
| 1731 | strlcpy(spi->modalias, acpi_device_hid(adev), sizeof(spi->modalias)); | ||
| 1732 | if (spi_add_device(spi)) { | 1734 | if (spi_add_device(spi)) { |
| 1733 | adev->power.flags.ignore_parent = false; | 1735 | adev->power.flags.ignore_parent = false; |
| 1734 | dev_err(&master->dev, "failed to add SPI device %s from ACPI\n", | 1736 | dev_err(&master->dev, "failed to add SPI device %s from ACPI\n", |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 4242c31ffaee..ef0ae8aaa567 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -522,6 +522,8 @@ void acpi_bus_trim(struct acpi_device *start); | |||
| 522 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); | 522 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); |
| 523 | int acpi_match_device_ids(struct acpi_device *device, | 523 | int acpi_match_device_ids(struct acpi_device *device, |
| 524 | const struct acpi_device_id *ids); | 524 | const struct acpi_device_id *ids); |
| 525 | void acpi_set_modalias(struct acpi_device *adev, const char *default_id, | ||
| 526 | char *modalias, size_t len); | ||
| 525 | int acpi_create_dir(struct acpi_device *); | 527 | int acpi_create_dir(struct acpi_device *); |
| 526 | void acpi_remove_dir(struct acpi_device *); | 528 | void acpi_remove_dir(struct acpi_device *); |
| 527 | 529 | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 5b36974ed60a..6ab47e92c65a 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -291,7 +291,8 @@ bool acpi_processor_validate_proc_id(int proc_id); | |||
| 291 | 291 | ||
| 292 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 292 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
| 293 | /* Arch dependent functions for cpu hotplug support */ | 293 | /* Arch dependent functions for cpu hotplug support */ |
| 294 | int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, int *pcpu); | 294 | int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id, |
| 295 | int *pcpu); | ||
| 295 | int acpi_unmap_cpu(int cpu); | 296 | int acpi_unmap_cpu(int cpu); |
| 296 | int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid); | 297 | int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid); |
| 297 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 298 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
