aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/osl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r--drivers/acpi/osl.c81
1 files changed, 35 insertions, 46 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index bc1604bfa4db..6f49f6437289 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -134,7 +134,7 @@ static char osi_additional_string[OSI_STRING_LENGTH_MAX];
134 */ 134 */
135#define OSI_LINUX_ENABLE 0 135#define OSI_LINUX_ENABLE 0
136 136
137struct osi_linux { 137static struct osi_linux {
138 unsigned int enable:1; 138 unsigned int enable:1;
139 unsigned int dmi:1; 139 unsigned int dmi:1;
140 unsigned int cmdline:1; 140 unsigned int cmdline:1;
@@ -264,11 +264,16 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
264 "System description tables not found\n"); 264 "System description tables not found\n");
265 return 0; 265 return 0;
266 } 266 }
267 } else 267 } else {
268 return acpi_find_rsdp(); 268 acpi_physical_address pa = 0;
269
270 acpi_find_root_pointer(&pa);
271 return pa;
272 }
269} 273}
270 274
271void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size) 275void __iomem *__init_refok
276acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
272{ 277{
273 if (phys > ULONG_MAX) { 278 if (phys > ULONG_MAX) {
274 printk(KERN_ERR PREFIX "Cannot map memory that high\n"); 279 printk(KERN_ERR PREFIX "Cannot map memory that high\n");
@@ -346,7 +351,15 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
346 351
347static irqreturn_t acpi_irq(int irq, void *dev_id) 352static irqreturn_t acpi_irq(int irq, void *dev_id)
348{ 353{
349 return (*acpi_irq_handler) (acpi_irq_context) ? IRQ_HANDLED : IRQ_NONE; 354 u32 handled;
355
356 handled = (*acpi_irq_handler) (acpi_irq_context);
357
358 if (handled) {
359 acpi_irq_handled++;
360 return IRQ_HANDLED;
361 } else
362 return IRQ_NONE;
350} 363}
351 364
352acpi_status 365acpi_status
@@ -355,6 +368,8 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
355{ 368{
356 unsigned int irq; 369 unsigned int irq;
357 370
371 acpi_irq_stats_init();
372
358 /* 373 /*
359 * Ignore the GSI from the core, and use the value in our copy of the 374 * Ignore the GSI from the core, and use the value in our copy of the
360 * FADT. It may not be the same if an interrupt source override exists 375 * FADT. It may not be the same if an interrupt source override exists
@@ -675,25 +690,6 @@ static void acpi_os_execute_deferred(struct work_struct *work)
675 dpc->function(dpc->context); 690 dpc->function(dpc->context);
676 kfree(dpc); 691 kfree(dpc);
677 692
678 /* Yield cpu to notify thread */
679 cond_resched();
680
681 return;
682}
683
684static void acpi_os_execute_notify(struct work_struct *work)
685{
686 struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
687
688 if (!dpc) {
689 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
690 return;
691 }
692
693 dpc->function(dpc->context);
694
695 kfree(dpc);
696
697 return; 693 return;
698} 694}
699 695
@@ -717,7 +713,7 @@ acpi_status acpi_os_execute(acpi_execute_type type,
717{ 713{
718 acpi_status status = AE_OK; 714 acpi_status status = AE_OK;
719 struct acpi_os_dpc *dpc; 715 struct acpi_os_dpc *dpc;
720 716 struct workqueue_struct *queue;
721 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 717 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
722 "Scheduling function [%p(%p)] for deferred execution.\n", 718 "Scheduling function [%p(%p)] for deferred execution.\n",
723 function, context)); 719 function, context));
@@ -741,20 +737,13 @@ acpi_status acpi_os_execute(acpi_execute_type type,
741 dpc->function = function; 737 dpc->function = function;
742 dpc->context = context; 738 dpc->context = context;
743 739
744 if (type == OSL_NOTIFY_HANDLER) { 740 INIT_WORK(&dpc->work, acpi_os_execute_deferred);
745 INIT_WORK(&dpc->work, acpi_os_execute_notify); 741 queue = (type == OSL_NOTIFY_HANDLER) ? kacpi_notify_wq : kacpid_wq;
746 if (!queue_work(kacpi_notify_wq, &dpc->work)) { 742 if (!queue_work(queue, &dpc->work)) {
747 status = AE_ERROR; 743 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
748 kfree(dpc); 744 "Call to queue_work() failed.\n"));
749 } 745 status = AE_ERROR;
750 } else { 746 kfree(dpc);
751 INIT_WORK(&dpc->work, acpi_os_execute_deferred);
752 if (!queue_work(kacpid_wq, &dpc->work)) {
753 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
754 "Call to queue_work() failed.\n"));
755 status = AE_ERROR;
756 kfree(dpc);
757 }
758 } 747 }
759 return_ACPI_STATUS(status); 748 return_ACPI_STATUS(status);
760} 749}
@@ -1349,24 +1338,24 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1349 * 1338 *
1350 * Returns 0 on success 1339 * Returns 0 on success
1351 */ 1340 */
1352int acpi_dmi_dump(void) 1341static int acpi_dmi_dump(void)
1353{ 1342{
1354 1343
1355 if (!dmi_available) 1344 if (!dmi_available)
1356 return -1; 1345 return -1;
1357 1346
1358 printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n", 1347 printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n",
1359 dmi_get_slot(DMI_SYS_VENDOR)); 1348 dmi_get_system_info(DMI_SYS_VENDOR));
1360 printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n", 1349 printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n",
1361 dmi_get_slot(DMI_PRODUCT_NAME)); 1350 dmi_get_system_info(DMI_PRODUCT_NAME));
1362 printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n", 1351 printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n",
1363 dmi_get_slot(DMI_PRODUCT_VERSION)); 1352 dmi_get_system_info(DMI_PRODUCT_VERSION));
1364 printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n", 1353 printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n",
1365 dmi_get_slot(DMI_BOARD_NAME)); 1354 dmi_get_system_info(DMI_BOARD_NAME));
1366 printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n", 1355 printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n",
1367 dmi_get_slot(DMI_BIOS_VENDOR)); 1356 dmi_get_system_info(DMI_BIOS_VENDOR));
1368 printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n", 1357 printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n",
1369 dmi_get_slot(DMI_BIOS_DATE)); 1358 dmi_get_system_info(DMI_BIOS_DATE));
1370 1359
1371 return 0; 1360 return 0;
1372} 1361}