aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/Kconfig2
-rw-r--r--drivers/acpi/acpi_i2c.c2
-rw-r--r--drivers/acpi/apei/cper.c2
-rw-r--r--drivers/acpi/pci_root.c85
-rw-r--r--drivers/acpi/processor_idle.c13
-rw-r--r--drivers/acpi/processor_perflib.c4
-rw-r--r--drivers/acpi/sleep.c8
7 files changed, 64 insertions, 52 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 92ed9692c47e..4bf68c8d4797 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -396,7 +396,7 @@ config ACPI_CUSTOM_METHOD
396 396
397config ACPI_BGRT 397config ACPI_BGRT
398 bool "Boottime Graphics Resource Table support" 398 bool "Boottime Graphics Resource Table support"
399 depends on EFI 399 depends on EFI && X86
400 help 400 help
401 This driver adds support for exposing the ACPI Boottime Graphics 401 This driver adds support for exposing the ACPI Boottime Graphics
402 Resource Table, which allows the operating system to obtain 402 Resource Table, which allows the operating system to obtain
diff --git a/drivers/acpi/acpi_i2c.c b/drivers/acpi/acpi_i2c.c
index 82045e3f5cac..a82c7626aa9b 100644
--- a/drivers/acpi/acpi_i2c.c
+++ b/drivers/acpi/acpi_i2c.c
@@ -90,7 +90,7 @@ void acpi_i2c_register_devices(struct i2c_adapter *adapter)
90 acpi_handle handle; 90 acpi_handle handle;
91 acpi_status status; 91 acpi_status status;
92 92
93 handle = ACPI_HANDLE(&adapter->dev); 93 handle = ACPI_HANDLE(adapter->dev.parent);
94 if (!handle) 94 if (!handle)
95 return; 95 return;
96 96
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
index 1e5d8a40101e..fefc2ca7cc3e 100644
--- a/drivers/acpi/apei/cper.c
+++ b/drivers/acpi/apei/cper.c
@@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
405 return rc; 405 return rc;
406 data_len = estatus->data_length; 406 data_len = estatus->data_length;
407 gdata = (struct acpi_hest_generic_data *)(estatus + 1); 407 gdata = (struct acpi_hest_generic_data *)(estatus + 1);
408 while (data_len > sizeof(*gdata)) { 408 while (data_len >= sizeof(*gdata)) {
409 gedata_len = gdata->error_data_length; 409 gedata_len = gdata->error_data_length;
410 if (gedata_len > data_len - sizeof(*gdata)) 410 if (gedata_len > data_len - sizeof(*gdata))
411 return -EINVAL; 411 return -EINVAL;
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index b80e06e0b2d9..ac8688b89705 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -382,7 +382,6 @@ static int acpi_pci_root_add(struct acpi_device *device,
382 int result; 382 int result;
383 struct acpi_pci_root *root; 383 struct acpi_pci_root *root;
384 u32 flags, base_flags; 384 u32 flags, base_flags;
385 bool is_osc_granted = false;
386 385
387 root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); 386 root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
388 if (!root) 387 if (!root)
@@ -443,6 +442,30 @@ static int acpi_pci_root_add(struct acpi_device *device,
443 flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT; 442 flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT;
444 acpi_pci_osc_support(root, flags); 443 acpi_pci_osc_support(root, flags);
445 444
445 /*
446 * TBD: Need PCI interface for enumeration/configuration of roots.
447 */
448
449 mutex_lock(&acpi_pci_root_lock);
450 list_add_tail(&root->node, &acpi_pci_roots);
451 mutex_unlock(&acpi_pci_root_lock);
452
453 /*
454 * Scan the Root Bridge
455 * --------------------
456 * Must do this prior to any attempt to bind the root device, as the
457 * PCI namespace does not get created until this call is made (and
458 * thus the root bridge's pci_dev does not exist).
459 */
460 root->bus = pci_acpi_scan_root(root);
461 if (!root->bus) {
462 printk(KERN_ERR PREFIX
463 "Bus %04x:%02x not present in PCI namespace\n",
464 root->segment, (unsigned int)root->secondary.start);
465 result = -ENODEV;
466 goto out_del_root;
467 }
468
446 /* Indicate support for various _OSC capabilities. */ 469 /* Indicate support for various _OSC capabilities. */
447 if (pci_ext_cfg_avail()) 470 if (pci_ext_cfg_avail())
448 flags |= OSC_EXT_PCI_CONFIG_SUPPORT; 471 flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
@@ -461,6 +484,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
461 flags = base_flags; 484 flags = base_flags;
462 } 485 }
463 } 486 }
487
464 if (!pcie_ports_disabled 488 if (!pcie_ports_disabled
465 && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { 489 && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
466 flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL 490 flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL
@@ -481,54 +505,28 @@ static int acpi_pci_root_add(struct acpi_device *device,
481 status = acpi_pci_osc_control_set(device->handle, &flags, 505 status = acpi_pci_osc_control_set(device->handle, &flags,
482 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); 506 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
483 if (ACPI_SUCCESS(status)) { 507 if (ACPI_SUCCESS(status)) {
484 is_osc_granted = true;
485 dev_info(&device->dev, 508 dev_info(&device->dev,
486 "ACPI _OSC control (0x%02x) granted\n", flags); 509 "ACPI _OSC control (0x%02x) granted\n", flags);
510 if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
511 /*
512 * We have ASPM control, but the FADT indicates
513 * that it's unsupported. Clear it.
514 */
515 pcie_clear_aspm(root->bus);
516 }
487 } else { 517 } else {
488 is_osc_granted = false;
489 dev_info(&device->dev, 518 dev_info(&device->dev,
490 "ACPI _OSC request failed (%s), " 519 "ACPI _OSC request failed (%s), "
491 "returned control mask: 0x%02x\n", 520 "returned control mask: 0x%02x\n",
492 acpi_format_exception(status), flags); 521 acpi_format_exception(status), flags);
522 pr_info("ACPI _OSC control for PCIe not granted, "
523 "disabling ASPM\n");
524 pcie_no_aspm();
493 } 525 }
494 } else { 526 } else {
495 dev_info(&device->dev, 527 dev_info(&device->dev,
496 "Unable to request _OSC control " 528 "Unable to request _OSC control "
497 "(_OSC support mask: 0x%02x)\n", flags); 529 "(_OSC support mask: 0x%02x)\n", flags);
498 }
499
500 /*
501 * TBD: Need PCI interface for enumeration/configuration of roots.
502 */
503
504 mutex_lock(&acpi_pci_root_lock);
505 list_add_tail(&root->node, &acpi_pci_roots);
506 mutex_unlock(&acpi_pci_root_lock);
507
508 /*
509 * Scan the Root Bridge
510 * --------------------
511 * Must do this prior to any attempt to bind the root device, as the
512 * PCI namespace does not get created until this call is made (and
513 * thus the root bridge's pci_dev does not exist).
514 */
515 root->bus = pci_acpi_scan_root(root);
516 if (!root->bus) {
517 printk(KERN_ERR PREFIX
518 "Bus %04x:%02x not present in PCI namespace\n",
519 root->segment, (unsigned int)root->secondary.start);
520 result = -ENODEV;
521 goto out_del_root;
522 }
523
524 /* ASPM setting */
525 if (is_osc_granted) {
526 if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM)
527 pcie_clear_aspm(root->bus);
528 } else {
529 pr_info("ACPI _OSC control for PCIe not granted, "
530 "disabling ASPM\n");
531 pcie_no_aspm();
532 } 530 }
533 531
534 pci_acpi_add_bus_pm_notifier(device, root->bus); 532 pci_acpi_add_bus_pm_notifier(device, root->bus);
@@ -600,6 +598,7 @@ static void handle_root_bridge_insertion(acpi_handle handle)
600 598
601static void handle_root_bridge_removal(struct acpi_device *device) 599static void handle_root_bridge_removal(struct acpi_device *device)
602{ 600{
601 acpi_status status;
603 struct acpi_eject_event *ej_event; 602 struct acpi_eject_event *ej_event;
604 603
605 ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); 604 ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
@@ -615,7 +614,9 @@ static void handle_root_bridge_removal(struct acpi_device *device)
615 ej_event->device = device; 614 ej_event->device = device;
616 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; 615 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
617 616
618 acpi_bus_hot_remove_device(ej_event); 617 status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, ej_event);
618 if (ACPI_FAILURE(status))
619 kfree(ej_event);
619} 620}
620 621
621static void _handle_hotplug_event_root(struct work_struct *work) 622static void _handle_hotplug_event_root(struct work_struct *work)
@@ -630,8 +631,9 @@ static void _handle_hotplug_event_root(struct work_struct *work)
630 handle = hp_work->handle; 631 handle = hp_work->handle;
631 type = hp_work->type; 632 type = hp_work->type;
632 633
633 root = acpi_pci_find_root(handle); 634 acpi_scan_lock_acquire();
634 635
636 root = acpi_pci_find_root(handle);
635 acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); 637 acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
636 638
637 switch (type) { 639 switch (type) {
@@ -665,6 +667,7 @@ static void _handle_hotplug_event_root(struct work_struct *work)
665 break; 667 break;
666 } 668 }
667 669
670 acpi_scan_lock_release();
668 kfree(hp_work); /* allocated in handle_hotplug_event_bridge */ 671 kfree(hp_work); /* allocated in handle_hotplug_event_bridge */
669 kfree(buffer.pointer); 672 kfree(buffer.pointer);
670} 673}
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index fc95308e9a11..ee255c60bdac 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -66,7 +66,8 @@ module_param(latency_factor, uint, 0644);
66 66
67static DEFINE_PER_CPU(struct cpuidle_device *, acpi_cpuidle_device); 67static DEFINE_PER_CPU(struct cpuidle_device *, acpi_cpuidle_device);
68 68
69static struct acpi_processor_cx *acpi_cstate[CPUIDLE_STATE_MAX]; 69static DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX],
70 acpi_cstate);
70 71
71static int disabled_by_idle_boot_param(void) 72static int disabled_by_idle_boot_param(void)
72{ 73{
@@ -722,7 +723,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
722 struct cpuidle_driver *drv, int index) 723 struct cpuidle_driver *drv, int index)
723{ 724{
724 struct acpi_processor *pr; 725 struct acpi_processor *pr;
725 struct acpi_processor_cx *cx = acpi_cstate[index]; 726 struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
726 727
727 pr = __this_cpu_read(processors); 728 pr = __this_cpu_read(processors);
728 729
@@ -745,7 +746,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
745 */ 746 */
746static int acpi_idle_play_dead(struct cpuidle_device *dev, int index) 747static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
747{ 748{
748 struct acpi_processor_cx *cx = acpi_cstate[index]; 749 struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
749 750
750 ACPI_FLUSH_CPU_CACHE(); 751 ACPI_FLUSH_CPU_CACHE();
751 752
@@ -775,7 +776,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
775 struct cpuidle_driver *drv, int index) 776 struct cpuidle_driver *drv, int index)
776{ 777{
777 struct acpi_processor *pr; 778 struct acpi_processor *pr;
778 struct acpi_processor_cx *cx = acpi_cstate[index]; 779 struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
779 780
780 pr = __this_cpu_read(processors); 781 pr = __this_cpu_read(processors);
781 782
@@ -833,7 +834,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
833 struct cpuidle_driver *drv, int index) 834 struct cpuidle_driver *drv, int index)
834{ 835{
835 struct acpi_processor *pr; 836 struct acpi_processor *pr;
836 struct acpi_processor_cx *cx = acpi_cstate[index]; 837 struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
837 838
838 pr = __this_cpu_read(processors); 839 pr = __this_cpu_read(processors);
839 840
@@ -960,7 +961,7 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
960 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) 961 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
961 continue; 962 continue;
962#endif 963#endif
963 acpi_cstate[count] = cx; 964 per_cpu(acpi_cstate[count], dev->cpu) = cx;
964 965
965 count++; 966 count++;
966 if (count == CPUIDLE_STATE_MAX) 967 if (count == CPUIDLE_STATE_MAX)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 53e7ac9403a7..e854582f29a6 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -465,7 +465,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
465 return result; 465 return result;
466} 466}
467 467
468static int acpi_processor_get_performance_info(struct acpi_processor *pr) 468int acpi_processor_get_performance_info(struct acpi_processor *pr)
469{ 469{
470 int result = 0; 470 int result = 0;
471 acpi_status status = AE_OK; 471 acpi_status status = AE_OK;
@@ -509,7 +509,7 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
509#endif 509#endif
510 return result; 510 return result;
511} 511}
512 512EXPORT_SYMBOL_GPL(acpi_processor_get_performance_info);
513int acpi_processor_notify_smm(struct module *calling_module) 513int acpi_processor_notify_smm(struct module *calling_module)
514{ 514{
515 acpi_status status; 515 acpi_status status;
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 24213033fbae..9c1a435d10e6 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -193,6 +193,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
193 }, 193 },
194 { 194 {
195 .callback = init_nvs_nosave, 195 .callback = init_nvs_nosave,
196 .ident = "Sony Vaio VGN-FW21M",
197 .matches = {
198 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
199 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21M"),
200 },
201 },
202 {
203 .callback = init_nvs_nosave,
196 .ident = "Sony Vaio VPCEB17FX", 204 .ident = "Sony Vaio VPCEB17FX",
197 .matches = { 205 .matches = {
198 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 206 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),